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 "src/allocation.h" | 8 #include "src/allocation.h" |
9 #include "src/assert-scope.h" | 9 #include "src/assert-scope.h" |
10 #include "src/builtins.h" | 10 #include "src/builtins.h" |
(...skipping 5442 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
5453 | 5453 |
5454 // [handler_table]: Fixed array containing offsets of exception handlers. | 5454 // [handler_table]: Fixed array containing offsets of exception handlers. |
5455 DECL_ACCESSORS(handler_table, FixedArray) | 5455 DECL_ACCESSORS(handler_table, FixedArray) |
5456 | 5456 |
5457 // [deoptimization_data]: Array containing data for deopt. | 5457 // [deoptimization_data]: Array containing data for deopt. |
5458 DECL_ACCESSORS(deoptimization_data, FixedArray) | 5458 DECL_ACCESSORS(deoptimization_data, FixedArray) |
5459 | 5459 |
5460 // [raw_type_feedback_info]: This field stores various things, depending on | 5460 // [raw_type_feedback_info]: This field stores various things, depending on |
5461 // the kind of the code object. | 5461 // the kind of the code object. |
5462 // FUNCTION => type feedback information. | 5462 // FUNCTION => type feedback information. |
5463 // STUB => various things, e.g. a SMI | 5463 // STUB and ICs => major/minor key as Smi. |
5464 DECL_ACCESSORS(raw_type_feedback_info, Object) | 5464 DECL_ACCESSORS(raw_type_feedback_info, Object) |
5465 inline Object* type_feedback_info(); | 5465 inline Object* type_feedback_info(); |
5466 inline void set_type_feedback_info( | 5466 inline void set_type_feedback_info( |
5467 Object* value, WriteBarrierMode mode = UPDATE_WRITE_BARRIER); | 5467 Object* value, WriteBarrierMode mode = UPDATE_WRITE_BARRIER); |
5468 inline int stub_info(); | 5468 inline uint32_t stub_key(); |
5469 inline void set_stub_info(int info); | 5469 inline void set_stub_key(uint32_t key); |
5470 | 5470 |
5471 // [next_code_link]: Link for lists of optimized or deoptimized code. | 5471 // [next_code_link]: Link for lists of optimized or deoptimized code. |
5472 // Note that storage for this field is overlapped with typefeedback_info. | 5472 // Note that storage for this field is overlapped with typefeedback_info. |
5473 DECL_ACCESSORS(next_code_link, Object) | 5473 DECL_ACCESSORS(next_code_link, Object) |
5474 | 5474 |
5475 // [gc_metadata]: Field used to hold GC related metadata. The contents of this | 5475 // [gc_metadata]: Field used to hold GC related metadata. The contents of this |
5476 // field does not have to be traced during garbage collection since | 5476 // field does not have to be traced during garbage collection since |
5477 // it is only used by the garbage collector itself. | 5477 // it is only used by the garbage collector itself. |
5478 DECL_ACCESSORS(gc_metadata, Object) | 5478 DECL_ACCESSORS(gc_metadata, Object) |
5479 | 5479 |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
5523 inline bool is_invalidated_weak_stub(); | 5523 inline bool is_invalidated_weak_stub(); |
5524 inline void mark_as_invalidated_weak_stub(); | 5524 inline void mark_as_invalidated_weak_stub(); |
5525 | 5525 |
5526 inline bool CanBeWeakStub() { | 5526 inline bool CanBeWeakStub() { |
5527 Kind k = kind(); | 5527 Kind k = kind(); |
5528 return (k == LOAD_IC || k == STORE_IC || k == KEYED_LOAD_IC || | 5528 return (k == LOAD_IC || k == STORE_IC || k == KEYED_LOAD_IC || |
5529 k == KEYED_STORE_IC || k == COMPARE_NIL_IC) && | 5529 k == KEYED_STORE_IC || k == COMPARE_NIL_IC) && |
5530 ic_state() == MONOMORPHIC; | 5530 ic_state() == MONOMORPHIC; |
5531 } | 5531 } |
5532 | 5532 |
5533 inline bool IsCodeStubOrIC(); | |
5534 | |
5533 inline void set_raw_kind_specific_flags1(int value); | 5535 inline void set_raw_kind_specific_flags1(int value); |
5534 inline void set_raw_kind_specific_flags2(int value); | 5536 inline void set_raw_kind_specific_flags2(int value); |
5535 | 5537 |
5536 // [major_key]: For kind STUB or BINARY_OP_IC, the major key. | |
5537 inline int major_key(); | |
5538 inline void set_major_key(int value); | |
5539 inline bool has_major_key(); | |
5540 | |
5541 // For kind STUB or ICs, tells whether or not a code object was generated by | 5538 // For kind STUB or ICs, tells whether or not a code object was generated by |
5542 // the optimizing compiler (but it may not be an optimized function). | 5539 // the optimizing compiler (but it may not be an optimized function). |
5543 bool is_crankshafted(); | 5540 bool is_crankshafted(); |
5544 bool is_hydrogen_stub(); // Crankshafted, but not a function. | 5541 bool is_hydrogen_stub(); // Crankshafted, but not a function. |
5545 inline void set_is_crankshafted(bool value); | 5542 inline void set_is_crankshafted(bool value); |
5546 | 5543 |
5547 // [optimizable]: For FUNCTION kind, tells if it is optimizable. | 5544 // [optimizable]: For FUNCTION kind, tells if it is optimizable. |
5548 inline bool optimizable(); | 5545 inline bool optimizable(); |
5549 inline void set_optimizable(bool value); | 5546 inline void set_optimizable(bool value); |
5550 | 5547 |
(...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
5801 // Max loop nesting marker used to postpose OSR. We don't take loop | 5798 // Max loop nesting marker used to postpose OSR. We don't take loop |
5802 // nesting that is deeper than 5 levels into account. | 5799 // nesting that is deeper than 5 levels into account. |
5803 static const int kMaxLoopNestingMarker = 6; | 5800 static const int kMaxLoopNestingMarker = 6; |
5804 | 5801 |
5805 // Layout description. | 5802 // Layout description. |
5806 static const int kInstructionSizeOffset = HeapObject::kHeaderSize; | 5803 static const int kInstructionSizeOffset = HeapObject::kHeaderSize; |
5807 static const int kRelocationInfoOffset = kInstructionSizeOffset + kIntSize; | 5804 static const int kRelocationInfoOffset = kInstructionSizeOffset + kIntSize; |
5808 static const int kHandlerTableOffset = kRelocationInfoOffset + kPointerSize; | 5805 static const int kHandlerTableOffset = kRelocationInfoOffset + kPointerSize; |
5809 static const int kDeoptimizationDataOffset = | 5806 static const int kDeoptimizationDataOffset = |
5810 kHandlerTableOffset + kPointerSize; | 5807 kHandlerTableOffset + kPointerSize; |
5808 // For FUNCTION kind, we store the type feedback info here. | |
5811 static const int kTypeFeedbackInfoOffset = | 5809 static const int kTypeFeedbackInfoOffset = |
5812 kDeoptimizationDataOffset + kPointerSize; | 5810 kDeoptimizationDataOffset + kPointerSize; |
5813 static const int kNextCodeLinkOffset = kTypeFeedbackInfoOffset + kPointerSize; | 5811 static const int kNextCodeLinkOffset = kTypeFeedbackInfoOffset + kPointerSize; |
5814 static const int kGCMetadataOffset = kNextCodeLinkOffset + kPointerSize; | 5812 static const int kGCMetadataOffset = kNextCodeLinkOffset + kPointerSize; |
5815 static const int kICAgeOffset = | 5813 static const int kICAgeOffset = |
5816 kGCMetadataOffset + kPointerSize; | 5814 kGCMetadataOffset + kPointerSize; |
5817 static const int kFlagsOffset = kICAgeOffset + kIntSize; | 5815 static const int kFlagsOffset = kICAgeOffset + kIntSize; |
5818 static const int kKindSpecificFlags1Offset = kFlagsOffset + kIntSize; | 5816 static const int kKindSpecificFlags1Offset = kFlagsOffset + kIntSize; |
5819 static const int kKindSpecificFlags2Offset = | 5817 static const int kKindSpecificFlags2Offset = |
5820 kKindSpecificFlags1Offset + kIntSize; | 5818 kKindSpecificFlags1Offset + kIntSize; |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
5883 class InvalidatedWeakStubField: public BitField<bool, | 5881 class InvalidatedWeakStubField: public BitField<bool, |
5884 kInvalidatedWeakStubFirstBit, | 5882 kInvalidatedWeakStubFirstBit, |
5885 kInvalidatedWeakStubBitCount> {}; // NOLINT | 5883 kInvalidatedWeakStubBitCount> {}; // NOLINT |
5886 | 5884 |
5887 // KindSpecificFlags2 layout (ALL) | 5885 // KindSpecificFlags2 layout (ALL) |
5888 static const int kIsCrankshaftedBit = 0; | 5886 static const int kIsCrankshaftedBit = 0; |
5889 class IsCrankshaftedField: public BitField<bool, | 5887 class IsCrankshaftedField: public BitField<bool, |
5890 kIsCrankshaftedBit, 1> {}; // NOLINT | 5888 kIsCrankshaftedBit, 1> {}; // NOLINT |
5891 | 5889 |
5892 // KindSpecificFlags2 layout (STUB and OPTIMIZED_FUNCTION) | 5890 // KindSpecificFlags2 layout (STUB and OPTIMIZED_FUNCTION) |
5893 static const int kStubMajorKeyFirstBit = kIsCrankshaftedBit + 1; | 5891 static const int kSafepointTableOffsetFirstBit = kIsCrankshaftedBit + 1; |
5894 static const int kSafepointTableOffsetFirstBit = | |
5895 kStubMajorKeyFirstBit + kStubMajorKeyBits; | |
5896 static const int kSafepointTableOffsetBitCount = 24; | 5892 static const int kSafepointTableOffsetBitCount = 24; |
Jakob Kummerow
2014/07/21 12:23:19
nit: let's add a comment that bits 25-31 (zero-ind
| |
5897 | 5893 |
5898 STATIC_ASSERT(kStubMajorKeyFirstBit + kStubMajorKeyBits <= 32); | |
5899 STATIC_ASSERT(kSafepointTableOffsetFirstBit + | 5894 STATIC_ASSERT(kSafepointTableOffsetFirstBit + |
5900 kSafepointTableOffsetBitCount <= 32); | 5895 kSafepointTableOffsetBitCount <= 32); |
5901 STATIC_ASSERT(1 + kStubMajorKeyBits + | 5896 STATIC_ASSERT(1 + kSafepointTableOffsetBitCount <= 32); |
5902 kSafepointTableOffsetBitCount <= 32); | |
5903 | 5897 |
5904 class SafepointTableOffsetField: public BitField<int, | 5898 class SafepointTableOffsetField: public BitField<int, |
5905 kSafepointTableOffsetFirstBit, | 5899 kSafepointTableOffsetFirstBit, |
5906 kSafepointTableOffsetBitCount> {}; // NOLINT | 5900 kSafepointTableOffsetBitCount> {}; // NOLINT |
5907 class StubMajorKeyField: public BitField<int, | |
5908 kStubMajorKeyFirstBit, kStubMajorKeyBits> {}; // NOLINT | |
5909 | 5901 |
5910 // KindSpecificFlags2 layout (FUNCTION) | 5902 // KindSpecificFlags2 layout (FUNCTION) |
5911 class BackEdgeTableOffsetField: public BitField<int, | 5903 class BackEdgeTableOffsetField: public BitField<int, |
5912 kIsCrankshaftedBit + 1, 27> {}; // NOLINT | 5904 kIsCrankshaftedBit + 1, 27> {}; // NOLINT |
5913 class AllowOSRAtLoopNestingLevelField: public BitField<int, | 5905 class AllowOSRAtLoopNestingLevelField: public BitField<int, |
5914 kIsCrankshaftedBit + 1 + 27, 4> {}; // NOLINT | 5906 kIsCrankshaftedBit + 1 + 27, 4> {}; // NOLINT |
5915 STATIC_ASSERT(AllowOSRAtLoopNestingLevelField::kMax >= kMaxLoopNestingMarker); | 5907 STATIC_ASSERT(AllowOSRAtLoopNestingLevelField::kMax >= kMaxLoopNestingMarker); |
5916 | 5908 |
5917 static const int kArgumentsBits = 16; | 5909 static const int kArgumentsBits = 16; |
5918 static const int kMaxArguments = (1 << kArgumentsBits) - 1; | 5910 static const int kMaxArguments = (1 << kArgumentsBits) - 1; |
(...skipping 5299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
11218 } else { | 11210 } else { |
11219 value &= ~(1 << bit_position); | 11211 value &= ~(1 << bit_position); |
11220 } | 11212 } |
11221 return value; | 11213 return value; |
11222 } | 11214 } |
11223 }; | 11215 }; |
11224 | 11216 |
11225 } } // namespace v8::internal | 11217 } } // namespace v8::internal |
11226 | 11218 |
11227 #endif // V8_OBJECTS_H_ | 11219 #endif // V8_OBJECTS_H_ |
OLD | NEW |