| 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 1022 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1033 V(JSObject) \ | 1033 V(JSObject) \ |
| 1034 V(JSContextExtensionObject) \ | 1034 V(JSContextExtensionObject) \ |
| 1035 V(JSGeneratorObject) \ | 1035 V(JSGeneratorObject) \ |
| 1036 V(JSModule) \ | 1036 V(JSModule) \ |
| 1037 V(Map) \ | 1037 V(Map) \ |
| 1038 V(DescriptorArray) \ | 1038 V(DescriptorArray) \ |
| 1039 V(TransitionArray) \ | 1039 V(TransitionArray) \ |
| 1040 V(DeoptimizationInputData) \ | 1040 V(DeoptimizationInputData) \ |
| 1041 V(DeoptimizationOutputData) \ | 1041 V(DeoptimizationOutputData) \ |
| 1042 V(DependentCode) \ | 1042 V(DependentCode) \ |
| 1043 V(TypeFeedbackCells) \ | |
| 1044 V(FixedArray) \ | 1043 V(FixedArray) \ |
| 1045 V(FixedDoubleArray) \ | 1044 V(FixedDoubleArray) \ |
| 1046 V(ConstantPoolArray) \ | 1045 V(ConstantPoolArray) \ |
| 1047 V(Context) \ | 1046 V(Context) \ |
| 1048 V(NativeContext) \ | 1047 V(NativeContext) \ |
| 1049 V(ScopeInfo) \ | 1048 V(ScopeInfo) \ |
| 1050 V(JSFunction) \ | 1049 V(JSFunction) \ |
| 1051 V(Code) \ | 1050 V(Code) \ |
| 1052 V(Oddball) \ | 1051 V(Oddball) \ |
| 1053 V(SharedFunctionInfo) \ | 1052 V(SharedFunctionInfo) \ |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1152 V(kEval, "eval") \ | 1151 V(kEval, "eval") \ |
| 1153 V(kExpected0AsASmiSentinel, "Expected 0 as a Smi sentinel") \ | 1152 V(kExpected0AsASmiSentinel, "Expected 0 as a Smi sentinel") \ |
| 1154 V(kExpectedAlignmentMarker, "Expected alignment marker") \ | 1153 V(kExpectedAlignmentMarker, "Expected alignment marker") \ |
| 1155 V(kExpectedAllocationSite, "Expected allocation site") \ | 1154 V(kExpectedAllocationSite, "Expected allocation site") \ |
| 1156 V(kExpectedFunctionObject, "Expected function object in register") \ | 1155 V(kExpectedFunctionObject, "Expected function object in register") \ |
| 1157 V(kExpectedHeapNumber, "Expected HeapNumber") \ | 1156 V(kExpectedHeapNumber, "Expected HeapNumber") \ |
| 1158 V(kExpectedNativeContext, "Expected native context") \ | 1157 V(kExpectedNativeContext, "Expected native context") \ |
| 1159 V(kExpectedNonIdenticalObjects, "Expected non-identical objects") \ | 1158 V(kExpectedNonIdenticalObjects, "Expected non-identical objects") \ |
| 1160 V(kExpectedNonNullContext, "Expected non-null context") \ | 1159 V(kExpectedNonNullContext, "Expected non-null context") \ |
| 1161 V(kExpectedPositiveZero, "Expected +0.0") \ | 1160 V(kExpectedPositiveZero, "Expected +0.0") \ |
| 1162 V(kExpectedPropertyCellInTypeInfoCell, \ | |
| 1163 "Expected property cell in type_info_cell") \ | |
| 1164 V(kExpectedAllocationSiteInCell, \ | 1161 V(kExpectedAllocationSiteInCell, \ |
| 1165 "Expected AllocationSite in property cell") \ | 1162 "Expected AllocationSite in property cell") \ |
| 1166 V(kExpectedPropertyCellInRegisterA2, \ | 1163 V(kExpectedFixedArrayInFeedbackVector, \ |
| 1167 "Expected property cell in register a2") \ | 1164 "Expected fixed array in feedback vector") \ |
| 1168 V(kExpectedPropertyCellInRegisterEbx, \ | 1165 V(kExpectedFixedArrayInRegisterA2, \ |
| 1169 "Expected property cell in register ebx") \ | 1166 "Expected fixed array in register a2") \ |
| 1170 V(kExpectedPropertyCellInRegisterRbx, \ | 1167 V(kExpectedFixedArrayInRegisterEbx, \ |
| 1171 "Expected property cell in register rbx") \ | 1168 "Expected fixed array in register ebx") \ |
| 1169 V(kExpectedFixedArrayInRegisterR2, \ |
| 1170 "Expected fixed array in register r2") \ |
| 1171 V(kExpectedFixedArrayInRegisterRbx, \ |
| 1172 "Expected fixed array in register rbx") \ |
| 1172 V(kExpectedSmiOrHeapNumber, "Expected smi or HeapNumber") \ | 1173 V(kExpectedSmiOrHeapNumber, "Expected smi or HeapNumber") \ |
| 1173 V(kExpectingAlignmentForCopyBytes, \ | 1174 V(kExpectingAlignmentForCopyBytes, \ |
| 1174 "Expecting alignment for CopyBytes") \ | 1175 "Expecting alignment for CopyBytes") \ |
| 1175 V(kExportDeclaration, "Export declaration") \ | 1176 V(kExportDeclaration, "Export declaration") \ |
| 1176 V(kExternalStringExpectedButNotFound, \ | 1177 V(kExternalStringExpectedButNotFound, \ |
| 1177 "External string expected, but not found") \ | 1178 "External string expected, but not found") \ |
| 1178 V(kFailedBailedOutLastTime, "Failed/bailed out last time") \ | 1179 V(kFailedBailedOutLastTime, "Failed/bailed out last time") \ |
| 1179 V(kForInStatementIsNotFastCase, "ForInStatement is not fast case") \ | 1180 V(kForInStatementIsNotFastCase, "ForInStatement is not fast case") \ |
| 1180 V(kForInStatementOptimizationIsDisabled, \ | 1181 V(kForInStatementOptimizationIsDisabled, \ |
| 1181 "ForInStatement optimization is disabled") \ | 1182 "ForInStatement optimization is disabled") \ |
| (...skipping 3923 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5105 | 5106 |
| 5106 #if defined(OBJECT_PRINT) || defined(ENABLE_DISASSEMBLER) | 5107 #if defined(OBJECT_PRINT) || defined(ENABLE_DISASSEMBLER) |
| 5107 void DeoptimizationOutputDataPrint(FILE* out); | 5108 void DeoptimizationOutputDataPrint(FILE* out); |
| 5108 #endif | 5109 #endif |
| 5109 }; | 5110 }; |
| 5110 | 5111 |
| 5111 | 5112 |
| 5112 // Forward declaration. | 5113 // Forward declaration. |
| 5113 class Cell; | 5114 class Cell; |
| 5114 class PropertyCell; | 5115 class PropertyCell; |
| 5115 | |
| 5116 // TypeFeedbackCells is a fixed array used to hold the association between | |
| 5117 // cache cells and AST ids for code generated by the full compiler. | |
| 5118 // The format of the these objects is | |
| 5119 // [i * 2]: Global property cell of ith cache cell. | |
| 5120 // [i * 2 + 1]: Ast ID for ith cache cell. | |
| 5121 class TypeFeedbackCells: public FixedArray { | |
| 5122 public: | |
| 5123 int CellCount() { return length() / 2; } | |
| 5124 static int LengthOfFixedArray(int cell_count) { return cell_count * 2; } | |
| 5125 | |
| 5126 // Accessors for AST ids associated with cache values. | |
| 5127 inline TypeFeedbackId AstId(int index); | |
| 5128 inline void SetAstId(int index, TypeFeedbackId id); | |
| 5129 | |
| 5130 // Accessors for global property cells holding the cache values. | |
| 5131 inline Cell* GetCell(int index); | |
| 5132 inline void SetCell(int index, Cell* cell); | |
| 5133 | |
| 5134 // The object that indicates an uninitialized cache. | |
| 5135 static inline Handle<Object> UninitializedSentinel(Isolate* isolate); | |
| 5136 | |
| 5137 // The object that indicates a megamorphic state. | |
| 5138 static inline Handle<Object> MegamorphicSentinel(Isolate* isolate); | |
| 5139 | |
| 5140 // The object that indicates a monomorphic state of Array with | |
| 5141 // ElementsKind | |
| 5142 static inline Handle<Object> MonomorphicArraySentinel(Isolate* isolate, | |
| 5143 ElementsKind elements_kind); | |
| 5144 | |
| 5145 // A raw version of the uninitialized sentinel that's safe to read during | |
| 5146 // garbage collection (e.g., for patching the cache). | |
| 5147 static inline Object* RawUninitializedSentinel(Heap* heap); | |
| 5148 | |
| 5149 // Casting. | |
| 5150 static inline TypeFeedbackCells* cast(Object* obj); | |
| 5151 | |
| 5152 static const int kForInFastCaseMarker = 0; | |
| 5153 static const int kForInSlowCaseMarker = 1; | |
| 5154 }; | |
| 5155 | |
| 5156 | |
| 5157 // Forward declaration. | |
| 5158 class SafepointEntry; | 5116 class SafepointEntry; |
| 5159 class TypeFeedbackInfo; | 5117 class TypeFeedbackInfo; |
| 5160 | 5118 |
| 5161 // Code describes objects with on-the-fly generated machine code. | 5119 // Code describes objects with on-the-fly generated machine code. |
| 5162 class Code: public HeapObject { | 5120 class Code: public HeapObject { |
| 5163 public: | 5121 public: |
| 5164 // Opaque data type for encapsulating code flags like kind, inline | 5122 // Opaque data type for encapsulating code flags like kind, inline |
| 5165 // cache state, and arguments count. | 5123 // cache state, and arguments count. |
| 5166 typedef uint32_t Flags; | 5124 typedef uint32_t Flags; |
| 5167 | 5125 |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5272 inline void set_flags(Flags flags); | 5230 inline void set_flags(Flags flags); |
| 5273 | 5231 |
| 5274 // [flags]: Access to specific code flags. | 5232 // [flags]: Access to specific code flags. |
| 5275 inline Kind kind(); | 5233 inline Kind kind(); |
| 5276 inline Kind handler_kind() { | 5234 inline Kind handler_kind() { |
| 5277 return static_cast<Kind>(arguments_count()); | 5235 return static_cast<Kind>(arguments_count()); |
| 5278 } | 5236 } |
| 5279 inline InlineCacheState ic_state(); // Only valid for IC stubs. | 5237 inline InlineCacheState ic_state(); // Only valid for IC stubs. |
| 5280 inline ExtraICState extra_ic_state(); // Only valid for IC stubs. | 5238 inline ExtraICState extra_ic_state(); // Only valid for IC stubs. |
| 5281 | 5239 |
| 5282 inline ExtraICState extended_extra_ic_state(); // Only valid for | |
| 5283 // non-call IC stubs. | |
| 5284 static bool needs_extended_extra_ic_state(Kind kind) { | |
| 5285 // TODO(danno): This is a bit of a hack right now since there are still | |
| 5286 // clients of this API that pass "extra" values in for argc. These clients | |
| 5287 // should be retrofitted to used ExtendedExtraICState. | |
| 5288 return kind == COMPARE_NIL_IC || kind == TO_BOOLEAN_IC || | |
| 5289 kind == BINARY_OP_IC; | |
| 5290 } | |
| 5291 | |
| 5292 inline StubType type(); // Only valid for monomorphic IC stubs. | 5240 inline StubType type(); // Only valid for monomorphic IC stubs. |
| 5293 inline int arguments_count(); // Only valid for call IC stubs. | 5241 inline int arguments_count(); // Only valid for call IC stubs. |
| 5294 | 5242 |
| 5295 // Testers for IC stub kinds. | 5243 // Testers for IC stub kinds. |
| 5296 inline bool is_inline_cache_stub(); | 5244 inline bool is_inline_cache_stub(); |
| 5297 inline bool is_debug_stub(); | 5245 inline bool is_debug_stub(); |
| 5298 inline bool is_handler() { return kind() == HANDLER; } | 5246 inline bool is_handler() { return kind() == HANDLER; } |
| 5299 inline bool is_load_stub() { return kind() == LOAD_IC; } | 5247 inline bool is_load_stub() { return kind() == LOAD_IC; } |
| 5300 inline bool is_keyed_load_stub() { return kind() == KEYED_LOAD_IC; } | 5248 inline bool is_keyed_load_stub() { return kind() == KEYED_LOAD_IC; } |
| 5301 inline bool is_store_stub() { return kind() == STORE_IC; } | 5249 inline bool is_store_stub() { return kind() == STORE_IC; } |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5422 // which would make snapshot production non-reproducible. This method wipes | 5370 // which would make snapshot production non-reproducible. This method wipes |
| 5423 // out the to-be-overwritten header data for reproducible snapshots. | 5371 // out the to-be-overwritten header data for reproducible snapshots. |
| 5424 inline void WipeOutHeader(); | 5372 inline void WipeOutHeader(); |
| 5425 | 5373 |
| 5426 // Flags operations. | 5374 // Flags operations. |
| 5427 static inline Flags ComputeFlags( | 5375 static inline Flags ComputeFlags( |
| 5428 Kind kind, | 5376 Kind kind, |
| 5429 InlineCacheState ic_state = UNINITIALIZED, | 5377 InlineCacheState ic_state = UNINITIALIZED, |
| 5430 ExtraICState extra_ic_state = kNoExtraICState, | 5378 ExtraICState extra_ic_state = kNoExtraICState, |
| 5431 StubType type = NORMAL, | 5379 StubType type = NORMAL, |
| 5432 int argc = -1, | 5380 Kind handler_kind = STUB, |
| 5433 InlineCacheHolderFlag holder = OWN_MAP); | 5381 InlineCacheHolderFlag holder = OWN_MAP); |
| 5434 | 5382 |
| 5435 static inline Flags ComputeMonomorphicFlags( | 5383 static inline Flags ComputeMonomorphicFlags( |
| 5436 Kind kind, | 5384 Kind kind, |
| 5437 ExtraICState extra_ic_state = kNoExtraICState, | 5385 ExtraICState extra_ic_state = kNoExtraICState, |
| 5438 InlineCacheHolderFlag holder = OWN_MAP, | 5386 InlineCacheHolderFlag holder = OWN_MAP, |
| 5439 StubType type = NORMAL, | 5387 StubType type = NORMAL, |
| 5440 int argc = -1); | 5388 Kind handler_kind = STUB); |
| 5441 | 5389 |
| 5442 static inline InlineCacheState ExtractICStateFromFlags(Flags flags); | 5390 static inline InlineCacheState ExtractICStateFromFlags(Flags flags); |
| 5443 static inline StubType ExtractTypeFromFlags(Flags flags); | 5391 static inline StubType ExtractTypeFromFlags(Flags flags); |
| 5444 static inline Kind ExtractKindFromFlags(Flags flags); | 5392 static inline Kind ExtractKindFromFlags(Flags flags); |
| 5445 static inline InlineCacheHolderFlag ExtractCacheHolderFromFlags(Flags flags); | 5393 static inline InlineCacheHolderFlag ExtractCacheHolderFromFlags(Flags flags); |
| 5446 static inline ExtraICState ExtractExtraICStateFromFlags(Flags flags); | 5394 static inline ExtraICState ExtractExtraICStateFromFlags(Flags flags); |
| 5447 static inline ExtraICState ExtractExtendedExtraICStateFromFlags(Flags flags); | |
| 5448 static inline int ExtractArgumentsCountFromFlags(Flags flags); | 5395 static inline int ExtractArgumentsCountFromFlags(Flags flags); |
| 5449 | 5396 |
| 5450 static inline Flags RemoveTypeFromFlags(Flags flags); | 5397 static inline Flags RemoveTypeFromFlags(Flags flags); |
| 5451 | 5398 |
| 5452 // Convert a target address into a code object. | 5399 // Convert a target address into a code object. |
| 5453 static inline Code* GetCodeFromTargetAddress(Address address); | 5400 static inline Code* GetCodeFromTargetAddress(Address address); |
| 5454 | 5401 |
| 5455 // Convert an entry address into an object. | 5402 // Convert an entry address into an object. |
| 5456 static inline Object* GetObjectFromEntryAddress(Address location_of_address); | 5403 static inline Object* GetObjectFromEntryAddress(Address location_of_address); |
| 5457 | 5404 |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5508 | 5455 |
| 5509 template<typename StaticVisitor> | 5456 template<typename StaticVisitor> |
| 5510 inline void CodeIterateBody(Heap* heap); | 5457 inline void CodeIterateBody(Heap* heap); |
| 5511 | 5458 |
| 5512 DECLARE_PRINTER(Code) | 5459 DECLARE_PRINTER(Code) |
| 5513 DECLARE_VERIFIER(Code) | 5460 DECLARE_VERIFIER(Code) |
| 5514 | 5461 |
| 5515 void ClearInlineCaches(); | 5462 void ClearInlineCaches(); |
| 5516 void ClearInlineCaches(Kind kind); | 5463 void ClearInlineCaches(Kind kind); |
| 5517 | 5464 |
| 5518 void ClearTypeFeedbackCells(Heap* heap); | 5465 void ClearTypeFeedbackInfo(Heap* heap); |
| 5519 | 5466 |
| 5520 BailoutId TranslatePcOffsetToAstId(uint32_t pc_offset); | 5467 BailoutId TranslatePcOffsetToAstId(uint32_t pc_offset); |
| 5521 uint32_t TranslateAstIdToPcOffset(BailoutId ast_id); | 5468 uint32_t TranslateAstIdToPcOffset(BailoutId ast_id); |
| 5522 | 5469 |
| 5523 #define DECLARE_CODE_AGE_ENUM(X) k##X##CodeAge, | 5470 #define DECLARE_CODE_AGE_ENUM(X) k##X##CodeAge, |
| 5524 enum Age { | 5471 enum Age { |
| 5525 kNotExecutedCodeAge = -2, | 5472 kNotExecutedCodeAge = -2, |
| 5526 kExecutedOnceCodeAge = -1, | 5473 kExecutedOnceCodeAge = -1, |
| 5527 kNoAgeCodeAge = 0, | 5474 kNoAgeCodeAge = 0, |
| 5528 CODE_AGE_LIST(DECLARE_CODE_AGE_ENUM) | 5475 CODE_AGE_LIST(DECLARE_CODE_AGE_ENUM) |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5603 | 5550 |
| 5604 static const int kAllowOSRAtLoopNestingLevelOffset = kFullCodeFlags + 1; | 5551 static const int kAllowOSRAtLoopNestingLevelOffset = kFullCodeFlags + 1; |
| 5605 static const int kProfilerTicksOffset = kAllowOSRAtLoopNestingLevelOffset + 1; | 5552 static const int kProfilerTicksOffset = kAllowOSRAtLoopNestingLevelOffset + 1; |
| 5606 | 5553 |
| 5607 // Flags layout. BitField<type, shift, size>. | 5554 // Flags layout. BitField<type, shift, size>. |
| 5608 class ICStateField: public BitField<InlineCacheState, 0, 3> {}; | 5555 class ICStateField: public BitField<InlineCacheState, 0, 3> {}; |
| 5609 class TypeField: public BitField<StubType, 3, 1> {}; | 5556 class TypeField: public BitField<StubType, 3, 1> {}; |
| 5610 class CacheHolderField: public BitField<InlineCacheHolderFlag, 5, 1> {}; | 5557 class CacheHolderField: public BitField<InlineCacheHolderFlag, 5, 1> {}; |
| 5611 class KindField: public BitField<Kind, 6, 4> {}; | 5558 class KindField: public BitField<Kind, 6, 4> {}; |
| 5612 // TODO(bmeurer): Bit 10 is available for free use. :-) | 5559 // TODO(bmeurer): Bit 10 is available for free use. :-) |
| 5613 class ExtraICStateField: public BitField<ExtraICState, 11, 6> {}; | 5560 class ExtraICStateField: public BitField<ExtraICState, 11, |
| 5614 class ExtendedExtraICStateField: public BitField<ExtraICState, 11, | |
| 5615 PlatformSmiTagging::kSmiValueSize - 11 + 1> {}; // NOLINT | 5561 PlatformSmiTagging::kSmiValueSize - 11 + 1> {}; // NOLINT |
| 5616 STATIC_ASSERT(ExtraICStateField::kShift == ExtendedExtraICStateField::kShift); | |
| 5617 | 5562 |
| 5618 // KindSpecificFlags1 layout (STUB and OPTIMIZED_FUNCTION) | 5563 // KindSpecificFlags1 layout (STUB and OPTIMIZED_FUNCTION) |
| 5619 static const int kStackSlotsFirstBit = 0; | 5564 static const int kStackSlotsFirstBit = 0; |
| 5620 static const int kStackSlotsBitCount = 24; | 5565 static const int kStackSlotsBitCount = 24; |
| 5621 static const int kHasFunctionCacheFirstBit = | 5566 static const int kHasFunctionCacheFirstBit = |
| 5622 kStackSlotsFirstBit + kStackSlotsBitCount; | 5567 kStackSlotsFirstBit + kStackSlotsBitCount; |
| 5623 static const int kHasFunctionCacheBitCount = 1; | 5568 static const int kHasFunctionCacheBitCount = 1; |
| 5624 static const int kMarkedForDeoptimizationFirstBit = | 5569 static const int kMarkedForDeoptimizationFirstBit = |
| 5625 kStackSlotsFirstBit + kStackSlotsBitCount + 1; | 5570 kStackSlotsFirstBit + kStackSlotsBitCount + 1; |
| 5626 static const int kMarkedForDeoptimizationBitCount = 1; | 5571 static const int kMarkedForDeoptimizationBitCount = 1; |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5667 class BackEdgesPatchedForOSRField: public BitField<bool, | 5612 class BackEdgesPatchedForOSRField: public BitField<bool, |
| 5668 kIsCrankshaftedBit + 1 + 29, 1> {}; // NOLINT | 5613 kIsCrankshaftedBit + 1 + 29, 1> {}; // NOLINT |
| 5669 | 5614 |
| 5670 // Signed field cannot be encoded using the BitField class. | 5615 // Signed field cannot be encoded using the BitField class. |
| 5671 static const int kArgumentsCountShift = 17; | 5616 static const int kArgumentsCountShift = 17; |
| 5672 static const int kArgumentsCountMask = ~((1 << kArgumentsCountShift) - 1); | 5617 static const int kArgumentsCountMask = ~((1 << kArgumentsCountShift) - 1); |
| 5673 static const int kArgumentsBits = | 5618 static const int kArgumentsBits = |
| 5674 PlatformSmiTagging::kSmiValueSize - Code::kArgumentsCountShift + 1; | 5619 PlatformSmiTagging::kSmiValueSize - Code::kArgumentsCountShift + 1; |
| 5675 static const int kMaxArguments = (1 << kArgumentsBits) - 1; | 5620 static const int kMaxArguments = (1 << kArgumentsBits) - 1; |
| 5676 | 5621 |
| 5677 // ICs can use either argument count or ExtendedExtraIC, since their storage | |
| 5678 // overlaps. | |
| 5679 STATIC_ASSERT(ExtraICStateField::kShift + | |
| 5680 ExtraICStateField::kSize + kArgumentsBits == | |
| 5681 ExtendedExtraICStateField::kShift + | |
| 5682 ExtendedExtraICStateField::kSize); | |
| 5683 | |
| 5684 // This constant should be encodable in an ARM instruction. | 5622 // This constant should be encodable in an ARM instruction. |
| 5685 static const int kFlagsNotUsedInLookup = | 5623 static const int kFlagsNotUsedInLookup = |
| 5686 TypeField::kMask | CacheHolderField::kMask; | 5624 TypeField::kMask | CacheHolderField::kMask; |
| 5687 | 5625 |
| 5688 private: | 5626 private: |
| 5689 friend class RelocIterator; | 5627 friend class RelocIterator; |
| 5690 | 5628 |
| 5691 void ClearInlineCaches(Kind* kind); | 5629 void ClearInlineCaches(Kind* kind); |
| 5692 | 5630 |
| 5693 // Code aging | 5631 // Code aging |
| (...skipping 2143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7837 public: | 7775 public: |
| 7838 // [type]: the type of error message. | 7776 // [type]: the type of error message. |
| 7839 DECL_ACCESSORS(type, String) | 7777 DECL_ACCESSORS(type, String) |
| 7840 | 7778 |
| 7841 // [arguments]: the arguments for formatting the error message. | 7779 // [arguments]: the arguments for formatting the error message. |
| 7842 DECL_ACCESSORS(arguments, JSArray) | 7780 DECL_ACCESSORS(arguments, JSArray) |
| 7843 | 7781 |
| 7844 // [script]: the script from which the error message originated. | 7782 // [script]: the script from which the error message originated. |
| 7845 DECL_ACCESSORS(script, Object) | 7783 DECL_ACCESSORS(script, Object) |
| 7846 | 7784 |
| 7847 // [stack_trace]: the stack trace for this error message. | |
| 7848 DECL_ACCESSORS(stack_trace, Object) | |
| 7849 | |
| 7850 // [stack_frames]: an array of stack frames for this error object. | 7785 // [stack_frames]: an array of stack frames for this error object. |
| 7851 DECL_ACCESSORS(stack_frames, Object) | 7786 DECL_ACCESSORS(stack_frames, Object) |
| 7852 | 7787 |
| 7853 // [start_position]: the start position in the script for the error message. | 7788 // [start_position]: the start position in the script for the error message. |
| 7854 inline int start_position(); | 7789 inline int start_position(); |
| 7855 inline void set_start_position(int value); | 7790 inline void set_start_position(int value); |
| 7856 | 7791 |
| 7857 // [end_position]: the end position in the script for the error message. | 7792 // [end_position]: the end position in the script for the error message. |
| 7858 inline int end_position(); | 7793 inline int end_position(); |
| 7859 inline void set_end_position(int value); | 7794 inline void set_end_position(int value); |
| 7860 | 7795 |
| 7861 // Casting. | 7796 // Casting. |
| 7862 static inline JSMessageObject* cast(Object* obj); | 7797 static inline JSMessageObject* cast(Object* obj); |
| 7863 | 7798 |
| 7864 // Dispatched behavior. | 7799 // Dispatched behavior. |
| 7865 DECLARE_PRINTER(JSMessageObject) | 7800 DECLARE_PRINTER(JSMessageObject) |
| 7866 DECLARE_VERIFIER(JSMessageObject) | 7801 DECLARE_VERIFIER(JSMessageObject) |
| 7867 | 7802 |
| 7868 // Layout description. | 7803 // Layout description. |
| 7869 static const int kTypeOffset = JSObject::kHeaderSize; | 7804 static const int kTypeOffset = JSObject::kHeaderSize; |
| 7870 static const int kArgumentsOffset = kTypeOffset + kPointerSize; | 7805 static const int kArgumentsOffset = kTypeOffset + kPointerSize; |
| 7871 static const int kScriptOffset = kArgumentsOffset + kPointerSize; | 7806 static const int kScriptOffset = kArgumentsOffset + kPointerSize; |
| 7872 static const int kStackTraceOffset = kScriptOffset + kPointerSize; | 7807 static const int kStackFramesOffset = kScriptOffset + kPointerSize; |
| 7873 static const int kStackFramesOffset = kStackTraceOffset + kPointerSize; | |
| 7874 static const int kStartPositionOffset = kStackFramesOffset + kPointerSize; | 7808 static const int kStartPositionOffset = kStackFramesOffset + kPointerSize; |
| 7875 static const int kEndPositionOffset = kStartPositionOffset + kPointerSize; | 7809 static const int kEndPositionOffset = kStartPositionOffset + kPointerSize; |
| 7876 static const int kSize = kEndPositionOffset + kPointerSize; | 7810 static const int kSize = kEndPositionOffset + kPointerSize; |
| 7877 | 7811 |
| 7878 typedef FixedBodyDescriptor<HeapObject::kMapOffset, | 7812 typedef FixedBodyDescriptor<HeapObject::kMapOffset, |
| 7879 kStackFramesOffset + kPointerSize, | 7813 kStackFramesOffset + kPointerSize, |
| 7880 kSize> BodyDescriptor; | 7814 kSize> BodyDescriptor; |
| 7881 }; | 7815 }; |
| 7882 | 7816 |
| 7883 | 7817 |
| (...skipping 338 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8222 inline void change_ic_with_type_info_count(int count); | 8156 inline void change_ic_with_type_info_count(int count); |
| 8223 | 8157 |
| 8224 inline void initialize_storage(); | 8158 inline void initialize_storage(); |
| 8225 | 8159 |
| 8226 inline void change_own_type_change_checksum(); | 8160 inline void change_own_type_change_checksum(); |
| 8227 inline int own_type_change_checksum(); | 8161 inline int own_type_change_checksum(); |
| 8228 | 8162 |
| 8229 inline void set_inlined_type_change_checksum(int checksum); | 8163 inline void set_inlined_type_change_checksum(int checksum); |
| 8230 inline bool matches_inlined_type_change_checksum(int checksum); | 8164 inline bool matches_inlined_type_change_checksum(int checksum); |
| 8231 | 8165 |
| 8232 DECL_ACCESSORS(type_feedback_cells, TypeFeedbackCells) | 8166 DECL_ACCESSORS(feedback_vector, FixedArray) |
| 8233 | 8167 |
| 8234 static inline TypeFeedbackInfo* cast(Object* obj); | 8168 static inline TypeFeedbackInfo* cast(Object* obj); |
| 8235 | 8169 |
| 8236 // Dispatched behavior. | 8170 // Dispatched behavior. |
| 8237 DECLARE_PRINTER(TypeFeedbackInfo) | 8171 DECLARE_PRINTER(TypeFeedbackInfo) |
| 8238 DECLARE_VERIFIER(TypeFeedbackInfo) | 8172 DECLARE_VERIFIER(TypeFeedbackInfo) |
| 8239 | 8173 |
| 8240 static const int kStorage1Offset = HeapObject::kHeaderSize; | 8174 static const int kStorage1Offset = HeapObject::kHeaderSize; |
| 8241 static const int kStorage2Offset = kStorage1Offset + kPointerSize; | 8175 static const int kStorage2Offset = kStorage1Offset + kPointerSize; |
| 8242 static const int kTypeFeedbackCellsOffset = kStorage2Offset + kPointerSize; | 8176 static const int kFeedbackVectorOffset = |
| 8243 static const int kSize = kTypeFeedbackCellsOffset + kPointerSize; | 8177 kStorage2Offset + kPointerSize; |
| 8178 static const int kSize = kFeedbackVectorOffset + kPointerSize; |
| 8179 |
| 8180 // The object that indicates an uninitialized cache. |
| 8181 static inline Handle<Object> UninitializedSentinel(Isolate* isolate); |
| 8182 |
| 8183 // The object that indicates a megamorphic state. |
| 8184 static inline Handle<Object> MegamorphicSentinel(Isolate* isolate); |
| 8185 |
| 8186 // The object that indicates a monomorphic state of Array with |
| 8187 // ElementsKind |
| 8188 static inline Handle<Object> MonomorphicArraySentinel(Isolate* isolate, |
| 8189 ElementsKind elements_kind); |
| 8190 |
| 8191 // A raw version of the uninitialized sentinel that's safe to read during |
| 8192 // garbage collection (e.g., for patching the cache). |
| 8193 static inline Object* RawUninitializedSentinel(Heap* heap); |
| 8194 |
| 8195 static const int kForInFastCaseMarker = 0; |
| 8196 static const int kForInSlowCaseMarker = 1; |
| 8244 | 8197 |
| 8245 private: | 8198 private: |
| 8246 static const int kTypeChangeChecksumBits = 7; | 8199 static const int kTypeChangeChecksumBits = 7; |
| 8247 | 8200 |
| 8248 class ICTotalCountField: public BitField<int, 0, | 8201 class ICTotalCountField: public BitField<int, 0, |
| 8249 kSmiValueSize - kTypeChangeChecksumBits> {}; // NOLINT | 8202 kSmiValueSize - kTypeChangeChecksumBits> {}; // NOLINT |
| 8250 class OwnTypeChangeChecksum: public BitField<int, | 8203 class OwnTypeChangeChecksum: public BitField<int, |
| 8251 kSmiValueSize - kTypeChangeChecksumBits, | 8204 kSmiValueSize - kTypeChangeChecksumBits, |
| 8252 kTypeChangeChecksumBits> {}; // NOLINT | 8205 kTypeChangeChecksumBits> {}; // NOLINT |
| 8253 class ICsWithTypeInfoCountField: public BitField<int, 0, | 8206 class ICsWithTypeInfoCountField: public BitField<int, 0, |
| (...skipping 2550 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 10804 } else { | 10757 } else { |
| 10805 value &= ~(1 << bit_position); | 10758 value &= ~(1 << bit_position); |
| 10806 } | 10759 } |
| 10807 return value; | 10760 return value; |
| 10808 } | 10761 } |
| 10809 }; | 10762 }; |
| 10810 | 10763 |
| 10811 } } // namespace v8::internal | 10764 } } // namespace v8::internal |
| 10812 | 10765 |
| 10813 #endif // V8_OBJECTS_H_ | 10766 #endif // V8_OBJECTS_H_ |
| OLD | NEW |