~ubuntu-branches/ubuntu/saucy/libv8/saucy

« back to all changes in this revision

Viewing changes to src/serialize.h

  • Committer: Package Import Robot
  • Author(s): Jérémy Lal
  • Date: 2012-04-07 16:26:13 UTC
  • mfrom: (15.1.27 sid)
  • Revision ID: package-import@ubuntu.com-20120407162613-dqo1m6w9r3fh8tst
Tags: 3.8.9.16-3
* mipsel build fixes :
  + v8_use_mips_abi_hardfloat=false, this lowers EABI requirements.
  + v8_can_use_fpu_instructions=false, detect if FPU is present.
  + set -Wno-unused-but-set-variable only on mipsel.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
// Copyright 2006-2009 the V8 project authors. All rights reserved.
 
1
// Copyright 2012 the V8 project authors. All rights reserved.
2
2
// Redistribution and use in source and binary forms, with or without
3
3
// modification, are permitted provided that the following conditions are
4
4
// met:
228
228
    kFromStart = 0x20,              // Object is described relative to start.
229
229
    // 0x21-0x28                       One per space.
230
230
    // 0x29-0x2f                       Free.
231
 
    // 0x30-0x3f                       Used by misc tags below.
 
231
    // 0x30-0x3f                       Used by misc. tags below.
232
232
    kPointedToMask = 0x3f
233
233
  };
234
234
 
341
341
  // Deserialize a single object and the objects reachable from it.
342
342
  void DeserializePartial(Object** root);
343
343
 
344
 
#ifdef DEBUG
345
 
  virtual void Synchronize(const char* tag);
346
 
#endif
347
 
 
348
344
 private:
349
345
  virtual void VisitPointers(Object** start, Object** end);
350
346
 
359
355
  // Fills in some heap data in an area from start to end (non-inclusive).  The
360
356
  // space id is used for the write barrier.  The object_address is the address
361
357
  // of the object we are writing into, or NULL if we are not writing into an
362
 
  // object, ie if we are writing a series of tagged values that are not on the
363
 
  // heap.
 
358
  // object, i.e. if we are writing a series of tagged values that are not on
 
359
  // the heap.
364
360
  void ReadChunk(
365
361
      Object** start, Object** end, int space, Address object_address);
366
362
  HeapObject* GetAddressFromStart(int space);
485
481
  SerializationAddressMapper* address_mapper() { return &address_mapper_; }
486
482
  void PutRoot(
487
483
      int index, HeapObject* object, HowToCode how, WhereToPoint where);
488
 
#ifdef DEBUG
489
 
  virtual void Synchronize(const char* tag);
490
 
#endif
491
484
 
492
485
 protected:
493
486
  static const int kInvalidRootIndex = -1;
563
556
    return external_reference_encoder_->Encode(addr);
564
557
  }
565
558
 
 
559
  int SpaceAreaSize(int space);
 
560
 
 
561
  Isolate* isolate_;
566
562
  // Keep track of the fullness of each space in order to generate
567
563
  // relative addresses for back references.  Large objects are
568
564
  // just numbered sequentially since relative addresses make no
581
577
  friend class ObjectSerializer;
582
578
  friend class Deserializer;
583
579
 
 
580
 private:
584
581
  DISALLOW_COPY_AND_ASSIGN(Serializer);
585
582
};
586
583
 
632
629
  // Serialize the current state of the heap.  The order is:
633
630
  // 1) Strong references.
634
631
  // 2) Partial snapshot cache.
635
 
  // 3) Weak references (eg the symbol table).
 
632
  // 3) Weak references (e.g. the symbol table).
636
633
  virtual void SerializeStrongReferences();
637
634
  virtual void SerializeObject(Object* o,
638
635
                               HowToCode how_to_code,