OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef V8_OBJECTS_H_ | 5 #ifndef V8_OBJECTS_H_ |
6 #define V8_OBJECTS_H_ | 6 #define V8_OBJECTS_H_ |
7 | 7 |
8 #include <iosfwd> | 8 #include <iosfwd> |
9 | 9 |
10 #include "src/allocation.h" | 10 #include "src/allocation.h" |
(...skipping 5114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5125 // compiler (but it may not be an optimized function). | 5125 // compiler (but it may not be an optimized function). |
5126 inline bool is_crankshafted(); | 5126 inline bool is_crankshafted(); |
5127 inline bool is_hydrogen_stub(); // Crankshafted, but not a function. | 5127 inline bool is_hydrogen_stub(); // Crankshafted, but not a function. |
5128 inline void set_is_crankshafted(bool value); | 5128 inline void set_is_crankshafted(bool value); |
5129 | 5129 |
5130 // [is_turbofanned]: For kind STUB or OPTIMIZED_FUNCTION, tells whether the | 5130 // [is_turbofanned]: For kind STUB or OPTIMIZED_FUNCTION, tells whether the |
5131 // code object was generated by the TurboFan optimizing compiler. | 5131 // code object was generated by the TurboFan optimizing compiler. |
5132 inline bool is_turbofanned(); | 5132 inline bool is_turbofanned(); |
5133 inline void set_is_turbofanned(bool value); | 5133 inline void set_is_turbofanned(bool value); |
5134 | 5134 |
| 5135 // [can_have_weak_objects]: For kind OPTIMIZED_FUNCTION, tells whether the |
| 5136 // embedded objects in code should be treated weakly. |
| 5137 inline bool can_have_weak_objects(); |
| 5138 inline void set_can_have_weak_objects(bool value); |
| 5139 |
5135 // [optimizable]: For FUNCTION kind, tells if it is optimizable. | 5140 // [optimizable]: For FUNCTION kind, tells if it is optimizable. |
5136 inline bool optimizable(); | 5141 inline bool optimizable(); |
5137 inline void set_optimizable(bool value); | 5142 inline void set_optimizable(bool value); |
5138 | 5143 |
5139 // [has_deoptimization_support]: For FUNCTION kind, tells if it has | 5144 // [has_deoptimization_support]: For FUNCTION kind, tells if it has |
5140 // deoptimization support. | 5145 // deoptimization support. |
5141 inline bool has_deoptimization_support(); | 5146 inline bool has_deoptimization_support(); |
5142 inline void set_has_deoptimization_support(bool value); | 5147 inline void set_has_deoptimization_support(bool value); |
5143 | 5148 |
5144 // [has_debug_break_slots]: For FUNCTION kind, tells if it has | 5149 // [has_debug_break_slots]: For FUNCTION kind, tells if it has |
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5382 bool CanDeoptAt(Address pc); | 5387 bool CanDeoptAt(Address pc); |
5383 | 5388 |
5384 #ifdef VERIFY_HEAP | 5389 #ifdef VERIFY_HEAP |
5385 void VerifyEmbeddedObjectsDependency(); | 5390 void VerifyEmbeddedObjectsDependency(); |
5386 #endif | 5391 #endif |
5387 | 5392 |
5388 #ifdef DEBUG | 5393 #ifdef DEBUG |
5389 void VerifyEmbeddedObjectsInFullCode(); | 5394 void VerifyEmbeddedObjectsInFullCode(); |
5390 #endif // DEBUG | 5395 #endif // DEBUG |
5391 | 5396 |
5392 inline bool CanContainWeakObjects() { return is_optimized_code(); } | 5397 inline bool CanContainWeakObjects() { |
| 5398 return is_optimized_code() && can_have_weak_objects(); |
| 5399 } |
5393 | 5400 |
5394 inline bool IsWeakObject(Object* object) { | 5401 inline bool IsWeakObject(Object* object) { |
5395 return (is_optimized_code() && !is_turbofanned() && | 5402 return (CanContainWeakObjects() && IsWeakObjectInOptimizedCode(object)); |
5396 IsWeakObjectInOptimizedCode(object)); | |
5397 } | 5403 } |
5398 | 5404 |
5399 static inline bool IsWeakObjectInOptimizedCode(Object* object); | 5405 static inline bool IsWeakObjectInOptimizedCode(Object* object); |
5400 | 5406 |
5401 // Max loop nesting marker used to postpose OSR. We don't take loop | 5407 // Max loop nesting marker used to postpose OSR. We don't take loop |
5402 // nesting that is deeper than 5 levels into account. | 5408 // nesting that is deeper than 5 levels into account. |
5403 static const int kMaxLoopNestingMarker = 6; | 5409 static const int kMaxLoopNestingMarker = 6; |
5404 | 5410 |
5405 // Layout description. | 5411 // Layout description. |
5406 static const int kRelocationInfoOffset = HeapObject::kHeaderSize; | 5412 static const int kRelocationInfoOffset = HeapObject::kHeaderSize; |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5452 class ExtraICStateField: public BitField<ExtraICState, 11, | 5458 class ExtraICStateField: public BitField<ExtraICState, 11, |
5453 PlatformSmiTagging::kSmiValueSize - 11 + 1> {}; // NOLINT | 5459 PlatformSmiTagging::kSmiValueSize - 11 + 1> {}; // NOLINT |
5454 | 5460 |
5455 // KindSpecificFlags1 layout (STUB and OPTIMIZED_FUNCTION) | 5461 // KindSpecificFlags1 layout (STUB and OPTIMIZED_FUNCTION) |
5456 static const int kStackSlotsFirstBit = 0; | 5462 static const int kStackSlotsFirstBit = 0; |
5457 static const int kStackSlotsBitCount = 24; | 5463 static const int kStackSlotsBitCount = 24; |
5458 static const int kHasFunctionCacheBit = | 5464 static const int kHasFunctionCacheBit = |
5459 kStackSlotsFirstBit + kStackSlotsBitCount; | 5465 kStackSlotsFirstBit + kStackSlotsBitCount; |
5460 static const int kMarkedForDeoptimizationBit = kHasFunctionCacheBit + 1; | 5466 static const int kMarkedForDeoptimizationBit = kHasFunctionCacheBit + 1; |
5461 static const int kIsTurbofannedBit = kMarkedForDeoptimizationBit + 1; | 5467 static const int kIsTurbofannedBit = kMarkedForDeoptimizationBit + 1; |
| 5468 static const int kCanHaveWeakObjects = kIsTurbofannedBit + 1; |
5462 | 5469 |
5463 STATIC_ASSERT(kStackSlotsFirstBit + kStackSlotsBitCount <= 32); | 5470 STATIC_ASSERT(kStackSlotsFirstBit + kStackSlotsBitCount <= 32); |
5464 STATIC_ASSERT(kIsTurbofannedBit + 1 <= 32); | 5471 STATIC_ASSERT(kCanHaveWeakObjects + 1 <= 32); |
5465 | 5472 |
5466 class StackSlotsField: public BitField<int, | 5473 class StackSlotsField: public BitField<int, |
5467 kStackSlotsFirstBit, kStackSlotsBitCount> {}; // NOLINT | 5474 kStackSlotsFirstBit, kStackSlotsBitCount> {}; // NOLINT |
5468 class HasFunctionCacheField : public BitField<bool, kHasFunctionCacheBit, 1> { | 5475 class HasFunctionCacheField : public BitField<bool, kHasFunctionCacheBit, 1> { |
5469 }; // NOLINT | 5476 }; // NOLINT |
5470 class MarkedForDeoptimizationField | 5477 class MarkedForDeoptimizationField |
5471 : public BitField<bool, kMarkedForDeoptimizationBit, 1> {}; // NOLINT | 5478 : public BitField<bool, kMarkedForDeoptimizationBit, 1> {}; // NOLINT |
5472 class IsTurbofannedField : public BitField<bool, kIsTurbofannedBit, 1> { | 5479 class IsTurbofannedField : public BitField<bool, kIsTurbofannedBit, 1> { |
5473 }; // NOLINT | 5480 }; // NOLINT |
| 5481 class CanHaveWeakObjectsField |
| 5482 : public BitField<bool, kCanHaveWeakObjects, 1> {}; // NOLINT |
5474 | 5483 |
5475 // KindSpecificFlags2 layout (ALL) | 5484 // KindSpecificFlags2 layout (ALL) |
5476 static const int kIsCrankshaftedBit = 0; | 5485 static const int kIsCrankshaftedBit = 0; |
5477 class IsCrankshaftedField: public BitField<bool, | 5486 class IsCrankshaftedField: public BitField<bool, |
5478 kIsCrankshaftedBit, 1> {}; // NOLINT | 5487 kIsCrankshaftedBit, 1> {}; // NOLINT |
5479 | 5488 |
5480 // KindSpecificFlags2 layout (STUB and OPTIMIZED_FUNCTION) | 5489 // KindSpecificFlags2 layout (STUB and OPTIMIZED_FUNCTION) |
5481 static const int kSafepointTableOffsetFirstBit = kIsCrankshaftedBit + 1; | 5490 static const int kSafepointTableOffsetFirstBit = kIsCrankshaftedBit + 1; |
5482 static const int kSafepointTableOffsetBitCount = 24; | 5491 static const int kSafepointTableOffsetBitCount = 24; |
5483 | 5492 |
(...skipping 5426 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10910 } else { | 10919 } else { |
10911 value &= ~(1 << bit_position); | 10920 value &= ~(1 << bit_position); |
10912 } | 10921 } |
10913 return value; | 10922 return value; |
10914 } | 10923 } |
10915 }; | 10924 }; |
10916 | 10925 |
10917 } } // namespace v8::internal | 10926 } } // namespace v8::internal |
10918 | 10927 |
10919 #endif // V8_OBJECTS_H_ | 10928 #endif // V8_OBJECTS_H_ |
OLD | NEW |