| OLD | NEW |
| 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 1019 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1030 V(JSObject) \ | 1030 V(JSObject) \ |
| 1031 V(JSContextExtensionObject) \ | 1031 V(JSContextExtensionObject) \ |
| 1032 V(JSGeneratorObject) \ | 1032 V(JSGeneratorObject) \ |
| 1033 V(JSModule) \ | 1033 V(JSModule) \ |
| 1034 V(Map) \ | 1034 V(Map) \ |
| 1035 V(DescriptorArray) \ | 1035 V(DescriptorArray) \ |
| 1036 V(TransitionArray) \ | 1036 V(TransitionArray) \ |
| 1037 V(DeoptimizationInputData) \ | 1037 V(DeoptimizationInputData) \ |
| 1038 V(DeoptimizationOutputData) \ | 1038 V(DeoptimizationOutputData) \ |
| 1039 V(DependentCode) \ | 1039 V(DependentCode) \ |
| 1040 V(TypeFeedbackCells) \ | |
| 1041 V(FixedArray) \ | 1040 V(FixedArray) \ |
| 1042 V(FixedDoubleArray) \ | 1041 V(FixedDoubleArray) \ |
| 1043 V(ConstantPoolArray) \ | 1042 V(ConstantPoolArray) \ |
| 1044 V(Context) \ | 1043 V(Context) \ |
| 1045 V(NativeContext) \ | 1044 V(NativeContext) \ |
| 1046 V(ScopeInfo) \ | 1045 V(ScopeInfo) \ |
| 1047 V(JSFunction) \ | 1046 V(JSFunction) \ |
| 1048 V(Code) \ | 1047 V(Code) \ |
| 1049 V(Oddball) \ | 1048 V(Oddball) \ |
| 1050 V(SharedFunctionInfo) \ | 1049 V(SharedFunctionInfo) \ |
| (...skipping 3998 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5049 | 5048 |
| 5050 #if defined(OBJECT_PRINT) || defined(ENABLE_DISASSEMBLER) | 5049 #if defined(OBJECT_PRINT) || defined(ENABLE_DISASSEMBLER) |
| 5051 void DeoptimizationOutputDataPrint(FILE* out); | 5050 void DeoptimizationOutputDataPrint(FILE* out); |
| 5052 #endif | 5051 #endif |
| 5053 }; | 5052 }; |
| 5054 | 5053 |
| 5055 | 5054 |
| 5056 // Forward declaration. | 5055 // Forward declaration. |
| 5057 class Cell; | 5056 class Cell; |
| 5058 class PropertyCell; | 5057 class PropertyCell; |
| 5059 | |
| 5060 // TypeFeedbackCells is a fixed array used to hold the association between | |
| 5061 // cache cells and AST ids for code generated by the full compiler. | |
| 5062 // The format of the these objects is | |
| 5063 // [i * 2]: Global property cell of ith cache cell. | |
| 5064 // [i * 2 + 1]: Ast ID for ith cache cell. | |
| 5065 class TypeFeedbackCells: public FixedArray { | |
| 5066 public: | |
| 5067 int CellCount() { return length() / 2; } | |
| 5068 static int LengthOfFixedArray(int cell_count) { return cell_count * 2; } | |
| 5069 | |
| 5070 // Accessors for AST ids associated with cache values. | |
| 5071 inline TypeFeedbackId AstId(int index); | |
| 5072 inline void SetAstId(int index, TypeFeedbackId id); | |
| 5073 | |
| 5074 // Accessors for global property cells holding the cache values. | |
| 5075 inline Cell* GetCell(int index); | |
| 5076 inline void SetCell(int index, Cell* cell); | |
| 5077 | |
| 5078 // The object that indicates an uninitialized cache. | |
| 5079 static inline Handle<Object> UninitializedSentinel(Isolate* isolate); | |
| 5080 | |
| 5081 // The object that indicates a megamorphic state. | |
| 5082 static inline Handle<Object> MegamorphicSentinel(Isolate* isolate); | |
| 5083 | |
| 5084 // The object that indicates a monomorphic state of Array with | |
| 5085 // ElementsKind | |
| 5086 static inline Handle<Object> MonomorphicArraySentinel(Isolate* isolate, | |
| 5087 ElementsKind elements_kind); | |
| 5088 | |
| 5089 // A raw version of the uninitialized sentinel that's safe to read during | |
| 5090 // garbage collection (e.g., for patching the cache). | |
| 5091 static inline Object* RawUninitializedSentinel(Heap* heap); | |
| 5092 | |
| 5093 // Casting. | |
| 5094 static inline TypeFeedbackCells* cast(Object* obj); | |
| 5095 | |
| 5096 static const int kForInFastCaseMarker = 0; | |
| 5097 static const int kForInSlowCaseMarker = 1; | |
| 5098 }; | |
| 5099 | |
| 5100 | |
| 5101 // Forward declaration. | |
| 5102 class SafepointEntry; | 5058 class SafepointEntry; |
| 5103 class TypeFeedbackInfo; | 5059 class TypeFeedbackInfo; |
| 5104 | 5060 |
| 5105 // Code describes objects with on-the-fly generated machine code. | 5061 // Code describes objects with on-the-fly generated machine code. |
| 5106 class Code: public HeapObject { | 5062 class Code: public HeapObject { |
| 5107 public: | 5063 public: |
| 5108 // Opaque data type for encapsulating code flags like kind, inline | 5064 // Opaque data type for encapsulating code flags like kind, inline |
| 5109 // cache state, and arguments count. | 5065 // cache state, and arguments count. |
| 5110 typedef uint32_t Flags; | 5066 typedef uint32_t Flags; |
| 5111 | 5067 |
| (...skipping 349 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5461 | 5417 |
| 5462 template<typename StaticVisitor> | 5418 template<typename StaticVisitor> |
| 5463 inline void CodeIterateBody(Heap* heap); | 5419 inline void CodeIterateBody(Heap* heap); |
| 5464 | 5420 |
| 5465 DECLARE_PRINTER(Code) | 5421 DECLARE_PRINTER(Code) |
| 5466 DECLARE_VERIFIER(Code) | 5422 DECLARE_VERIFIER(Code) |
| 5467 | 5423 |
| 5468 void ClearInlineCaches(); | 5424 void ClearInlineCaches(); |
| 5469 void ClearInlineCaches(Kind kind); | 5425 void ClearInlineCaches(Kind kind); |
| 5470 | 5426 |
| 5471 void ClearTypeFeedbackCells(Heap* heap); | 5427 void ClearTypeFeedbackInfo(Heap* heap); |
| 5472 | 5428 |
| 5473 BailoutId TranslatePcOffsetToAstId(uint32_t pc_offset); | 5429 BailoutId TranslatePcOffsetToAstId(uint32_t pc_offset); |
| 5474 uint32_t TranslateAstIdToPcOffset(BailoutId ast_id); | 5430 uint32_t TranslateAstIdToPcOffset(BailoutId ast_id); |
| 5475 | 5431 |
| 5476 #define DECLARE_CODE_AGE_ENUM(X) k##X##CodeAge, | 5432 #define DECLARE_CODE_AGE_ENUM(X) k##X##CodeAge, |
| 5477 enum Age { | 5433 enum Age { |
| 5478 kNotExecutedCodeAge = -2, | 5434 kNotExecutedCodeAge = -2, |
| 5479 kExecutedOnceCodeAge = -1, | 5435 kExecutedOnceCodeAge = -1, |
| 5480 kNoAgeCodeAge = 0, | 5436 kNoAgeCodeAge = 0, |
| 5481 CODE_AGE_LIST(DECLARE_CODE_AGE_ENUM) | 5437 CODE_AGE_LIST(DECLARE_CODE_AGE_ENUM) |
| (...skipping 2692 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8174 inline void change_ic_with_type_info_count(int count); | 8130 inline void change_ic_with_type_info_count(int count); |
| 8175 | 8131 |
| 8176 inline void initialize_storage(); | 8132 inline void initialize_storage(); |
| 8177 | 8133 |
| 8178 inline void change_own_type_change_checksum(); | 8134 inline void change_own_type_change_checksum(); |
| 8179 inline int own_type_change_checksum(); | 8135 inline int own_type_change_checksum(); |
| 8180 | 8136 |
| 8181 inline void set_inlined_type_change_checksum(int checksum); | 8137 inline void set_inlined_type_change_checksum(int checksum); |
| 8182 inline bool matches_inlined_type_change_checksum(int checksum); | 8138 inline bool matches_inlined_type_change_checksum(int checksum); |
| 8183 | 8139 |
| 8184 DECL_ACCESSORS(type_feedback_cells, TypeFeedbackCells) | 8140 DECL_ACCESSORS(feedback_vector, FixedArray) |
| 8185 | 8141 |
| 8186 static inline TypeFeedbackInfo* cast(Object* obj); | 8142 static inline TypeFeedbackInfo* cast(Object* obj); |
| 8187 | 8143 |
| 8188 // Dispatched behavior. | 8144 // Dispatched behavior. |
| 8189 DECLARE_PRINTER(TypeFeedbackInfo) | 8145 DECLARE_PRINTER(TypeFeedbackInfo) |
| 8190 DECLARE_VERIFIER(TypeFeedbackInfo) | 8146 DECLARE_VERIFIER(TypeFeedbackInfo) |
| 8191 | 8147 |
| 8192 static const int kStorage1Offset = HeapObject::kHeaderSize; | 8148 static const int kStorage1Offset = HeapObject::kHeaderSize; |
| 8193 static const int kStorage2Offset = kStorage1Offset + kPointerSize; | 8149 static const int kStorage2Offset = kStorage1Offset + kPointerSize; |
| 8194 static const int kTypeFeedbackCellsOffset = kStorage2Offset + kPointerSize; | 8150 static const int kFeedbackVectorOffset = |
| 8195 static const int kSize = kTypeFeedbackCellsOffset + kPointerSize; | 8151 kStorage2Offset + kPointerSize; |
| 8152 static const int kSize = kFeedbackVectorOffset + kPointerSize; |
| 8153 |
| 8154 // The object that indicates an uninitialized cache. |
| 8155 static inline Handle<Object> UninitializedSentinel(Isolate* isolate); |
| 8156 |
| 8157 // The object that indicates a megamorphic state. |
| 8158 static inline Handle<Object> MegamorphicSentinel(Isolate* isolate); |
| 8159 |
| 8160 // The object that indicates a monomorphic state of Array with |
| 8161 // ElementsKind |
| 8162 static inline Handle<Object> MonomorphicArraySentinel(Isolate* isolate, |
| 8163 ElementsKind elements_kind); |
| 8164 |
| 8165 // A raw version of the uninitialized sentinel that's safe to read during |
| 8166 // garbage collection (e.g., for patching the cache). |
| 8167 static inline Object* RawUninitializedSentinel(Heap* heap); |
| 8168 |
| 8169 static const int kForInFastCaseMarker = 0; |
| 8170 static const int kForInSlowCaseMarker = 1; |
| 8196 | 8171 |
| 8197 private: | 8172 private: |
| 8198 static const int kTypeChangeChecksumBits = 7; | 8173 static const int kTypeChangeChecksumBits = 7; |
| 8199 | 8174 |
| 8200 class ICTotalCountField: public BitField<int, 0, | 8175 class ICTotalCountField: public BitField<int, 0, |
| 8201 kSmiValueSize - kTypeChangeChecksumBits> {}; // NOLINT | 8176 kSmiValueSize - kTypeChangeChecksumBits> {}; // NOLINT |
| 8202 class OwnTypeChangeChecksum: public BitField<int, | 8177 class OwnTypeChangeChecksum: public BitField<int, |
| 8203 kSmiValueSize - kTypeChangeChecksumBits, | 8178 kSmiValueSize - kTypeChangeChecksumBits, |
| 8204 kTypeChangeChecksumBits> {}; // NOLINT | 8179 kTypeChangeChecksumBits> {}; // NOLINT |
| 8205 class ICsWithTypeInfoCountField: public BitField<int, 0, | 8180 class ICsWithTypeInfoCountField: public BitField<int, 0, |
| (...skipping 2550 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 10756 } else { | 10731 } else { |
| 10757 value &= ~(1 << bit_position); | 10732 value &= ~(1 << bit_position); |
| 10758 } | 10733 } |
| 10759 return value; | 10734 return value; |
| 10760 } | 10735 } |
| 10761 }; | 10736 }; |
| 10762 | 10737 |
| 10763 } } // namespace v8::internal | 10738 } } // namespace v8::internal |
| 10764 | 10739 |
| 10765 #endif // V8_OBJECTS_H_ | 10740 #endif // V8_OBJECTS_H_ |
| OLD | NEW |