Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(218)

Side by Side Diff: src/objects.h

Issue 148343005: A64: Synchronize with r18147. (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/a64
Patch Set: Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/object-observe.js ('k') | src/objects.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after
174 STORE_AND_GROW_TRANSITION_SMI_TO_DOUBLE, 174 STORE_AND_GROW_TRANSITION_SMI_TO_DOUBLE,
175 STORE_AND_GROW_TRANSITION_DOUBLE_TO_OBJECT, 175 STORE_AND_GROW_TRANSITION_DOUBLE_TO_OBJECT,
176 STORE_AND_GROW_TRANSITION_HOLEY_SMI_TO_OBJECT, 176 STORE_AND_GROW_TRANSITION_HOLEY_SMI_TO_OBJECT,
177 STORE_AND_GROW_TRANSITION_HOLEY_SMI_TO_DOUBLE, 177 STORE_AND_GROW_TRANSITION_HOLEY_SMI_TO_DOUBLE,
178 STORE_AND_GROW_TRANSITION_HOLEY_DOUBLE_TO_OBJECT, 178 STORE_AND_GROW_TRANSITION_HOLEY_DOUBLE_TO_OBJECT,
179 STORE_NO_TRANSITION_IGNORE_OUT_OF_BOUNDS, 179 STORE_NO_TRANSITION_IGNORE_OUT_OF_BOUNDS,
180 STORE_NO_TRANSITION_HANDLE_COW 180 STORE_NO_TRANSITION_HANDLE_COW
181 }; 181 };
182 182
183 183
184 enum ContextualMode {
185 NOT_CONTEXTUAL,
186 CONTEXTUAL
187 };
188
189
184 static const int kGrowICDelta = STORE_AND_GROW_NO_TRANSITION - 190 static const int kGrowICDelta = STORE_AND_GROW_NO_TRANSITION -
185 STANDARD_STORE; 191 STANDARD_STORE;
186 STATIC_ASSERT(STANDARD_STORE == 0); 192 STATIC_ASSERT(STANDARD_STORE == 0);
187 STATIC_ASSERT(kGrowICDelta == 193 STATIC_ASSERT(kGrowICDelta ==
188 STORE_AND_GROW_TRANSITION_SMI_TO_OBJECT - 194 STORE_AND_GROW_TRANSITION_SMI_TO_OBJECT -
189 STORE_TRANSITION_SMI_TO_OBJECT); 195 STORE_TRANSITION_SMI_TO_OBJECT);
190 STATIC_ASSERT(kGrowICDelta == 196 STATIC_ASSERT(kGrowICDelta ==
191 STORE_AND_GROW_TRANSITION_SMI_TO_DOUBLE - 197 STORE_AND_GROW_TRANSITION_SMI_TO_DOUBLE -
192 STORE_TRANSITION_SMI_TO_DOUBLE); 198 STORE_TRANSITION_SMI_TO_DOUBLE);
193 STATIC_ASSERT(kGrowICDelta == 199 STATIC_ASSERT(kGrowICDelta ==
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
292 // that piggy-back on marking can use the parity to ensure that they only 298 // that piggy-back on marking can use the parity to ensure that they only
293 // perform an operation on an object once per marking phase: they record the 299 // perform an operation on an object once per marking phase: they record the
294 // MarkingParity when they visit an object, and only re-visit the object when it 300 // MarkingParity when they visit an object, and only re-visit the object when it
295 // is marked again and the MarkingParity changes. 301 // is marked again and the MarkingParity changes.
296 enum MarkingParity { 302 enum MarkingParity {
297 NO_MARKING_PARITY, 303 NO_MARKING_PARITY,
298 ODD_MARKING_PARITY, 304 ODD_MARKING_PARITY,
299 EVEN_MARKING_PARITY 305 EVEN_MARKING_PARITY
300 }; 306 };
301 307
308 // ICs store extra state in a Code object. The default extra state is
309 // kNoExtraICState.
310 typedef int ExtraICState;
311 static const ExtraICState kNoExtraICState = 0;
312
302 // Instance size sentinel for objects of variable size. 313 // Instance size sentinel for objects of variable size.
303 const int kVariableSizeSentinel = 0; 314 const int kVariableSizeSentinel = 0;
304 315
305 const int kStubMajorKeyBits = 6; 316 const int kStubMajorKeyBits = 6;
306 const int kStubMinorKeyBits = kBitsPerInt - kSmiTagSize - kStubMajorKeyBits; 317 const int kStubMinorKeyBits = kBitsPerInt - kSmiTagSize - kStubMajorKeyBits;
307 318
308 // All Maps have a field instance_type containing a InstanceType. 319 // All Maps have a field instance_type containing a InstanceType.
309 // It describes the type of the instances. 320 // It describes the type of the instances.
310 // 321 //
311 // As an example, a JavaScript object is a heap object and its map 322 // As an example, a JavaScript object is a heap object and its map
(...skipping 1082 matching lines...) Expand 10 before | Expand all | Expand 10 after
1394 inline bool IsExternal(); 1405 inline bool IsExternal();
1395 inline bool IsAccessorInfo(); 1406 inline bool IsAccessorInfo();
1396 1407
1397 inline bool IsStruct(); 1408 inline bool IsStruct();
1398 #define DECLARE_STRUCT_PREDICATE(NAME, Name, name) inline bool Is##Name(); 1409 #define DECLARE_STRUCT_PREDICATE(NAME, Name, name) inline bool Is##Name();
1399 STRUCT_LIST(DECLARE_STRUCT_PREDICATE) 1410 STRUCT_LIST(DECLARE_STRUCT_PREDICATE)
1400 #undef DECLARE_STRUCT_PREDICATE 1411 #undef DECLARE_STRUCT_PREDICATE
1401 1412
1402 INLINE(bool IsSpecObject()); 1413 INLINE(bool IsSpecObject());
1403 INLINE(bool IsSpecFunction()); 1414 INLINE(bool IsSpecFunction());
1415 bool IsCallable();
1404 1416
1405 // Oddball testing. 1417 // Oddball testing.
1406 INLINE(bool IsUndefined()); 1418 INLINE(bool IsUndefined());
1407 INLINE(bool IsNull()); 1419 INLINE(bool IsNull());
1408 INLINE(bool IsTheHole()); // Shadows MaybeObject's implementation. 1420 INLINE(bool IsTheHole()); // Shadows MaybeObject's implementation.
1409 INLINE(bool IsUninitialized()); 1421 INLINE(bool IsUninitialized());
1410 INLINE(bool IsTrue()); 1422 INLINE(bool IsTrue());
1411 INLINE(bool IsFalse()); 1423 INLINE(bool IsFalse());
1412 inline bool IsArgumentsMarker(); 1424 inline bool IsArgumentsMarker();
1413 inline bool NonFailureIsHeapObject(); 1425 inline bool NonFailureIsHeapObject();
(...skipping 1259 matching lines...) Expand 10 before | Expand all | Expand 10 after
2673 public: 2685 public:
2674 static inline int SizeOf(Map* map, HeapObject* object); 2686 static inline int SizeOf(Map* map, HeapObject* object);
2675 }; 2687 };
2676 2688
2677 // Enqueue change record for Object.observe. May cause GC. 2689 // Enqueue change record for Object.observe. May cause GC.
2678 static void EnqueueChangeRecord(Handle<JSObject> object, 2690 static void EnqueueChangeRecord(Handle<JSObject> object,
2679 const char* type, 2691 const char* type,
2680 Handle<Name> name, 2692 Handle<Name> name,
2681 Handle<Object> old_value); 2693 Handle<Object> old_value);
2682 2694
2683 // Deliver change records to observers. May cause GC.
2684 static void DeliverChangeRecords(Isolate* isolate);
2685
2686 private: 2695 private:
2687 friend class DictionaryElementsAccessor; 2696 friend class DictionaryElementsAccessor;
2688 friend class JSReceiver; 2697 friend class JSReceiver;
2689 friend class Object; 2698 friend class Object;
2690 2699
2691 static void UpdateAllocationSite(Handle<JSObject> object, 2700 static void UpdateAllocationSite(Handle<JSObject> object,
2692 ElementsKind to_kind); 2701 ElementsKind to_kind);
2693 MUST_USE_RESULT MaybeObject* UpdateAllocationSite(ElementsKind to_kind); 2702 MUST_USE_RESULT MaybeObject* UpdateAllocationSite(ElementsKind to_kind);
2694 2703
2695 // Used from Object::GetProperty(). 2704 // Used from Object::GetProperty().
(...skipping 2376 matching lines...) Expand 10 before | Expand all | Expand 10 after
5072 STATIC_ASSERT(NUMBER_OF_KINDS <= 16); 5081 STATIC_ASSERT(NUMBER_OF_KINDS <= 16);
5073 5082
5074 static const char* Kind2String(Kind kind); 5083 static const char* Kind2String(Kind kind);
5075 5084
5076 // Types of stubs. 5085 // Types of stubs.
5077 enum StubType { 5086 enum StubType {
5078 NORMAL, 5087 NORMAL,
5079 FAST 5088 FAST
5080 }; 5089 };
5081 5090
5082 typedef int ExtraICState;
5083
5084 static const ExtraICState kNoExtraICState = 0;
5085
5086 static const int kPrologueOffsetNotSet = -1; 5091 static const int kPrologueOffsetNotSet = -1;
5087 5092
5088 #ifdef ENABLE_DISASSEMBLER 5093 #ifdef ENABLE_DISASSEMBLER
5089 // Printing 5094 // Printing
5090 static const char* ICState2String(InlineCacheState state); 5095 static const char* ICState2String(InlineCacheState state);
5091 static const char* StubType2String(StubType type); 5096 static const char* StubType2String(StubType type);
5092 static void PrintExtraICState(FILE* out, Kind kind, ExtraICState extra); 5097 static void PrintExtraICState(FILE* out, Kind kind, ExtraICState extra);
5093 void Disassemble(const char* name, FILE* out = stdout); 5098 void Disassemble(const char* name, FILE* out = stdout);
5094 #endif // ENABLE_DISASSEMBLER 5099 #endif // ENABLE_DISASSEMBLER
5095 5100
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after
5295 5300
5296 // The entire code object including its header is copied verbatim to the 5301 // The entire code object including its header is copied verbatim to the
5297 // snapshot so that it can be written in one, fast, memcpy during 5302 // snapshot so that it can be written in one, fast, memcpy during
5298 // deserialization. The deserializer will overwrite some pointers, rather 5303 // deserialization. The deserializer will overwrite some pointers, rather
5299 // like a runtime linker, but the random allocation addresses used in the 5304 // like a runtime linker, but the random allocation addresses used in the
5300 // mksnapshot process would still be present in the unlinked snapshot data, 5305 // mksnapshot process would still be present in the unlinked snapshot data,
5301 // which would make snapshot production non-reproducible. This method wipes 5306 // which would make snapshot production non-reproducible. This method wipes
5302 // out the to-be-overwritten header data for reproducible snapshots. 5307 // out the to-be-overwritten header data for reproducible snapshots.
5303 inline void WipeOutHeader(); 5308 inline void WipeOutHeader();
5304 5309
5305 class ExtraICStateStrictMode: public BitField<StrictModeFlag, 0, 1> {};
5306 class ExtraICStateKeyedAccessStoreMode:
5307 public BitField<KeyedAccessStoreMode, 1, 4> {}; // NOLINT
5308
5309 static inline StrictModeFlag GetStrictMode(ExtraICState extra_ic_state) {
5310 return ExtraICStateStrictMode::decode(extra_ic_state);
5311 }
5312
5313 static inline KeyedAccessStoreMode GetKeyedAccessStoreMode(
5314 ExtraICState extra_ic_state) {
5315 return ExtraICStateKeyedAccessStoreMode::decode(extra_ic_state);
5316 }
5317
5318 static inline ExtraICState ComputeExtraICState(
5319 KeyedAccessStoreMode store_mode,
5320 StrictModeFlag strict_mode) {
5321 return ExtraICStateKeyedAccessStoreMode::encode(store_mode) |
5322 ExtraICStateStrictMode::encode(strict_mode);
5323 }
5324
5325 // Flags operations. 5310 // Flags operations.
5326 static inline Flags ComputeFlags( 5311 static inline Flags ComputeFlags(
5327 Kind kind, 5312 Kind kind,
5328 InlineCacheState ic_state = UNINITIALIZED, 5313 InlineCacheState ic_state = UNINITIALIZED,
5329 ExtraICState extra_ic_state = kNoExtraICState, 5314 ExtraICState extra_ic_state = kNoExtraICState,
5330 StubType type = NORMAL, 5315 StubType type = NORMAL,
5331 int argc = -1, 5316 int argc = -1,
5332 InlineCacheHolderFlag holder = OWN_MAP); 5317 InlineCacheHolderFlag holder = OWN_MAP);
5333 5318
5334 static inline Flags ComputeMonomorphicFlags( 5319 static inline Flags ComputeMonomorphicFlags(
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after
5498 public BitField<bool, 0, 1> {}; // NOLINT 5483 public BitField<bool, 0, 1> {}; // NOLINT
5499 class FullCodeFlagsHasDebugBreakSlotsField: public BitField<bool, 1, 1> {}; 5484 class FullCodeFlagsHasDebugBreakSlotsField: public BitField<bool, 1, 1> {};
5500 class FullCodeFlagsIsCompiledOptimizable: public BitField<bool, 2, 1> {}; 5485 class FullCodeFlagsIsCompiledOptimizable: public BitField<bool, 2, 1> {};
5501 5486
5502 static const int kAllowOSRAtLoopNestingLevelOffset = kFullCodeFlags + 1; 5487 static const int kAllowOSRAtLoopNestingLevelOffset = kFullCodeFlags + 1;
5503 static const int kProfilerTicksOffset = kAllowOSRAtLoopNestingLevelOffset + 1; 5488 static const int kProfilerTicksOffset = kAllowOSRAtLoopNestingLevelOffset + 1;
5504 5489
5505 // Flags layout. BitField<type, shift, size>. 5490 // Flags layout. BitField<type, shift, size>.
5506 class ICStateField: public BitField<InlineCacheState, 0, 3> {}; 5491 class ICStateField: public BitField<InlineCacheState, 0, 3> {};
5507 class TypeField: public BitField<StubType, 3, 1> {}; 5492 class TypeField: public BitField<StubType, 3, 1> {};
5508 class CacheHolderField: public BitField<InlineCacheHolderFlag, 6, 1> {}; 5493 class CacheHolderField: public BitField<InlineCacheHolderFlag, 5, 1> {};
5509 class KindField: public BitField<Kind, 7, 4> {}; 5494 class KindField: public BitField<Kind, 6, 4> {};
5510 class IsPregeneratedField: public BitField<bool, 11, 1> {}; 5495 class IsPregeneratedField: public BitField<bool, 10, 1> {};
5511 class ExtraICStateField: public BitField<ExtraICState, 12, 5> {}; 5496 class ExtraICStateField: public BitField<ExtraICState, 11, 6> {};
5512 class ExtendedExtraICStateField: public BitField<ExtraICState, 12, 5497 class ExtendedExtraICStateField: public BitField<ExtraICState, 11,
5513 PlatformSmiTagging::kSmiValueSize - 12 + 1> {}; // NOLINT 5498 PlatformSmiTagging::kSmiValueSize - 11 + 1> {}; // NOLINT
5514 STATIC_ASSERT(ExtraICStateField::kShift == ExtendedExtraICStateField::kShift); 5499 STATIC_ASSERT(ExtraICStateField::kShift == ExtendedExtraICStateField::kShift);
5515 5500
5516 // KindSpecificFlags1 layout (STUB and OPTIMIZED_FUNCTION) 5501 // KindSpecificFlags1 layout (STUB and OPTIMIZED_FUNCTION)
5517 static const int kStackSlotsFirstBit = 0; 5502 static const int kStackSlotsFirstBit = 0;
5518 static const int kStackSlotsBitCount = 24; 5503 static const int kStackSlotsBitCount = 24;
5519 static const int kHasFunctionCacheFirstBit = 5504 static const int kHasFunctionCacheFirstBit =
5520 kStackSlotsFirstBit + kStackSlotsBitCount; 5505 kStackSlotsFirstBit + kStackSlotsBitCount;
5521 static const int kHasFunctionCacheBitCount = 1; 5506 static const int kHasFunctionCacheBitCount = 1;
5522 static const int kMarkedForDeoptimizationFirstBit = 5507 static const int kMarkedForDeoptimizationFirstBit =
5523 kStackSlotsFirstBit + kStackSlotsBitCount + 1; 5508 kStackSlotsFirstBit + kStackSlotsBitCount + 1;
(...skipping 2630 matching lines...) Expand 10 before | Expand all | Expand 10 after
8154 enum AllocationSiteMode { 8139 enum AllocationSiteMode {
8155 DONT_TRACK_ALLOCATION_SITE, 8140 DONT_TRACK_ALLOCATION_SITE,
8156 TRACK_ALLOCATION_SITE, 8141 TRACK_ALLOCATION_SITE,
8157 LAST_ALLOCATION_SITE_MODE = TRACK_ALLOCATION_SITE 8142 LAST_ALLOCATION_SITE_MODE = TRACK_ALLOCATION_SITE
8158 }; 8143 };
8159 8144
8160 8145
8161 class AllocationSite: public Struct { 8146 class AllocationSite: public Struct {
8162 public: 8147 public:
8163 static const uint32_t kMaximumArrayBytesToPretransition = 8 * 1024; 8148 static const uint32_t kMaximumArrayBytesToPretransition = 8 * 1024;
8149 static const double kPretenureRatio;
8150 static const int kPretenureMinimumCreated = 100;
8151
8152 // Values for pretenure decision field.
8153 enum {
8154 kUndecided = 0,
8155 kDontTenure = 1,
8156 kTenure = 2,
8157 kZombie = 3
8158 };
8164 8159
8165 DECL_ACCESSORS(transition_info, Object) 8160 DECL_ACCESSORS(transition_info, Object)
8166 // nested_site threads a list of sites that represent nested literals 8161 // nested_site threads a list of sites that represent nested literals
8167 // walked in a particular order. So [[1, 2], 1, 2] will have one 8162 // walked in a particular order. So [[1, 2], 1, 2] will have one
8168 // nested_site, but [[1, 2], 3, [4]] will have a list of two. 8163 // nested_site, but [[1, 2], 3, [4]] will have a list of two.
8169 DECL_ACCESSORS(nested_site, Object) 8164 DECL_ACCESSORS(nested_site, Object)
8170 DECL_ACCESSORS(memento_found_count, Smi) 8165 DECL_ACCESSORS(memento_found_count, Smi)
8171 DECL_ACCESSORS(memento_create_count, Smi) 8166 DECL_ACCESSORS(memento_create_count, Smi)
8167 // TODO(mvstanton): we don't need a whole integer to record pretenure
8168 // decision. Consider sharing space with memento_found_count.
8172 DECL_ACCESSORS(pretenure_decision, Smi) 8169 DECL_ACCESSORS(pretenure_decision, Smi)
8173 DECL_ACCESSORS(dependent_code, DependentCode) 8170 DECL_ACCESSORS(dependent_code, DependentCode)
8174 DECL_ACCESSORS(weak_next, Object) 8171 DECL_ACCESSORS(weak_next, Object)
8175 8172
8176 inline void Initialize(); 8173 inline void Initialize();
8177 8174
8178 bool HasNestedSites() {
8179 return nested_site()->IsAllocationSite();
8180 }
8181
8182 // This method is expensive, it should only be called for reporting. 8175 // This method is expensive, it should only be called for reporting.
8183 bool IsNestedSite(); 8176 bool IsNestedSite();
8184 8177
8185 class ElementsKindBits: public BitField<ElementsKind, 0, 15> {}; 8178 class ElementsKindBits: public BitField<ElementsKind, 0, 15> {};
8186 class UnusedBits: public BitField<int, 15, 14> {}; 8179 class UnusedBits: public BitField<int, 15, 14> {};
8187 class DoNotInlineBit: public BitField<bool, 29, 1> {}; 8180 class DoNotInlineBit: public BitField<bool, 29, 1> {};
8188 8181
8182 inline void IncrementMementoFoundCount();
8183
8184 inline void IncrementMementoCreateCount();
8185
8186 PretenureFlag GetPretenureMode() {
8187 int mode = pretenure_decision()->value();
8188 // Zombie objects "decide" to be untenured.
8189 return (mode == kTenure) ? TENURED : NOT_TENURED;
8190 }
8191
8192 // The pretenuring decision is made during gc, and the zombie state allows
8193 // us to recognize when an allocation site is just being kept alive because
8194 // a later traversal of new space may discover AllocationMementos that point
8195 // to this AllocationSite.
8196 bool IsZombie() {
8197 return pretenure_decision()->value() == kZombie;
8198 }
8199
8200 inline void MarkZombie();
8201
8202 inline bool DigestPretenuringFeedback();
8203
8189 ElementsKind GetElementsKind() { 8204 ElementsKind GetElementsKind() {
8190 ASSERT(!SitePointsToLiteral()); 8205 ASSERT(!SitePointsToLiteral());
8191 int value = Smi::cast(transition_info())->value(); 8206 int value = Smi::cast(transition_info())->value();
8192 return ElementsKindBits::decode(value); 8207 return ElementsKindBits::decode(value);
8193 } 8208 }
8194 8209
8195 void SetElementsKind(ElementsKind kind) { 8210 void SetElementsKind(ElementsKind kind) {
8196 int value = Smi::cast(transition_info())->value(); 8211 int value = Smi::cast(transition_info())->value();
8197 set_transition_info(Smi::FromInt(ElementsKindBits::update(value, kind)), 8212 set_transition_info(Smi::FromInt(ElementsKindBits::update(value, kind)),
8198 SKIP_WRITE_BARRIER); 8213 SKIP_WRITE_BARRIER);
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
8252 static const int kPointerFieldsBeginOffset = kTransitionInfoOffset; 8267 static const int kPointerFieldsBeginOffset = kTransitionInfoOffset;
8253 static const int kPointerFieldsEndOffset = kDependentCodeOffset; 8268 static const int kPointerFieldsEndOffset = kDependentCodeOffset;
8254 8269
8255 // For other visitors, use the fixed body descriptor below. 8270 // For other visitors, use the fixed body descriptor below.
8256 typedef FixedBodyDescriptor<HeapObject::kHeaderSize, 8271 typedef FixedBodyDescriptor<HeapObject::kHeaderSize,
8257 kDependentCodeOffset + kPointerSize, 8272 kDependentCodeOffset + kPointerSize,
8258 kSize> BodyDescriptor; 8273 kSize> BodyDescriptor;
8259 8274
8260 private: 8275 private:
8261 inline DependentCode::DependencyGroup ToDependencyGroup(Reason reason); 8276 inline DependentCode::DependencyGroup ToDependencyGroup(Reason reason);
8277 bool PretenuringDecisionMade() {
8278 return pretenure_decision()->value() != kUndecided;
8279 }
8280
8262 DISALLOW_IMPLICIT_CONSTRUCTORS(AllocationSite); 8281 DISALLOW_IMPLICIT_CONSTRUCTORS(AllocationSite);
8263 }; 8282 };
8264 8283
8265 8284
8266 class AllocationMemento: public Struct { 8285 class AllocationMemento: public Struct {
8267 public: 8286 public:
8268 static const int kAllocationSiteOffset = HeapObject::kHeaderSize; 8287 static const int kAllocationSiteOffset = HeapObject::kHeaderSize;
8269 static const int kSize = kAllocationSiteOffset + kPointerSize; 8288 static const int kSize = kAllocationSiteOffset + kPointerSize;
8270 8289
8271 DECL_ACCESSORS(allocation_site, Object) 8290 DECL_ACCESSORS(allocation_site, Object)
8272 8291
8273 bool IsValid() { return allocation_site()->IsAllocationSite(); } 8292 bool IsValid() {
8293 return allocation_site()->IsAllocationSite() &&
8294 !AllocationSite::cast(allocation_site())->IsZombie();
8295 }
8274 AllocationSite* GetAllocationSite() { 8296 AllocationSite* GetAllocationSite() {
8275 ASSERT(IsValid()); 8297 ASSERT(IsValid());
8276 return AllocationSite::cast(allocation_site()); 8298 return AllocationSite::cast(allocation_site());
8277 } 8299 }
8278 8300
8279 DECLARE_PRINTER(AllocationMemento) 8301 DECLARE_PRINTER(AllocationMemento)
8280 DECLARE_VERIFIER(AllocationMemento) 8302 DECLARE_VERIFIER(AllocationMemento)
8281 8303
8282 // Returns NULL if no AllocationMemento is available for object. 8304 // Returns NULL if no AllocationMemento is available for object.
8283 static AllocationMemento* FindForJSObject(JSObject* object, 8305 static AllocationMemento* FindForJSObject(JSObject* object,
(...skipping 2352 matching lines...) Expand 10 before | Expand all | Expand 10 after
10636 } else { 10658 } else {
10637 value &= ~(1 << bit_position); 10659 value &= ~(1 << bit_position);
10638 } 10660 }
10639 return value; 10661 return value;
10640 } 10662 }
10641 }; 10663 };
10642 10664
10643 } } // namespace v8::internal 10665 } } // namespace v8::internal
10644 10666
10645 #endif // V8_OBJECTS_H_ 10667 #endif // V8_OBJECTS_H_
OLDNEW
« no previous file with comments | « src/object-observe.js ('k') | src/objects.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698