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 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
270 struct CodeStubInterfaceDescriptor { | 270 struct CodeStubInterfaceDescriptor { |
271 CodeStubInterfaceDescriptor(); | 271 CodeStubInterfaceDescriptor(); |
272 int register_param_count_; | 272 int register_param_count_; |
273 const Register* stack_parameter_count_; | 273 const Register* stack_parameter_count_; |
274 // if hint_stack_parameter_count_ > 0, the code stub can optimize the | 274 // if hint_stack_parameter_count_ > 0, the code stub can optimize the |
275 // return sequence. Default value is -1, which means it is ignored. | 275 // return sequence. Default value is -1, which means it is ignored. |
276 int hint_stack_parameter_count_; | 276 int hint_stack_parameter_count_; |
277 StubFunctionMode function_mode_; | 277 StubFunctionMode function_mode_; |
278 Register* register_params_; | 278 Register* register_params_; |
279 Address deoptimization_handler_; | 279 Address deoptimization_handler_; |
280 ExternalReference miss_handler_; | |
281 | 280 |
282 int environment_length() const { | 281 int environment_length() const { |
283 if (stack_parameter_count_ != NULL) { | 282 if (stack_parameter_count_ != NULL) { |
284 return register_param_count_ + 1; | 283 return register_param_count_ + 1; |
285 } | 284 } |
286 return register_param_count_; | 285 return register_param_count_; |
287 } | 286 } |
288 | 287 |
289 bool initialized() const { return register_param_count_ >= 0; } | 288 bool initialized() const { return register_param_count_ >= 0; } |
| 289 |
| 290 void SetMissHandler(ExternalReference handler) { |
| 291 miss_handler_ = handler; |
| 292 has_miss_handler_ = true; |
| 293 } |
| 294 |
| 295 ExternalReference miss_handler() { |
| 296 ASSERT(has_miss_handler_); |
| 297 return miss_handler_; |
| 298 } |
| 299 |
| 300 bool has_miss_handler() { |
| 301 return has_miss_handler_; |
| 302 } |
| 303 |
| 304 private: |
| 305 ExternalReference miss_handler_; |
| 306 bool has_miss_handler_; |
290 }; | 307 }; |
291 | 308 |
292 // A helper to make up for the fact that type Register is not fully | 309 // A helper to make up for the fact that type Register is not fully |
293 // defined outside of the platform directories | 310 // defined outside of the platform directories |
294 #define DESCRIPTOR_GET_PARAMETER_REGISTER(descriptor, index) \ | 311 #define DESCRIPTOR_GET_PARAMETER_REGISTER(descriptor, index) \ |
295 ((index) == (descriptor)->register_param_count_) \ | 312 ((index) == (descriptor)->register_param_count_) \ |
296 ? *((descriptor)->stack_parameter_count_) \ | 313 ? *((descriptor)->stack_parameter_count_) \ |
297 : (descriptor)->register_params_[(index)] | 314 : (descriptor)->register_params_[(index)] |
298 | 315 |
299 | 316 |
300 class HydrogenCodeStub : public CodeStub { | 317 class HydrogenCodeStub : public CodeStub { |
301 public: | 318 public: |
302 enum InitializationState { | 319 enum InitializationState { |
303 CODE_STUB_IS_NOT_MISS, | 320 UNINITIALIZED, |
304 CODE_STUB_IS_MISS | 321 INITIALIZED |
305 }; | 322 }; |
306 | 323 |
307 explicit HydrogenCodeStub(InitializationState state) { | 324 explicit HydrogenCodeStub(InitializationState state = INITIALIZED) { |
308 is_miss_ = (state == CODE_STUB_IS_MISS); | 325 is_uninitialized_ = (state == UNINITIALIZED); |
309 } | 326 } |
310 | 327 |
311 virtual Code::Kind GetCodeKind() const { return Code::STUB; } | 328 virtual Code::Kind GetCodeKind() const { return Code::STUB; } |
312 | 329 |
313 CodeStubInterfaceDescriptor* GetInterfaceDescriptor(Isolate* isolate) { | 330 CodeStubInterfaceDescriptor* GetInterfaceDescriptor(Isolate* isolate) { |
314 return isolate->code_stub_interface_descriptor(MajorKey()); | 331 return isolate->code_stub_interface_descriptor(MajorKey()); |
315 } | 332 } |
316 | 333 |
317 bool IsMiss() { return is_miss_; } | 334 bool IsUninitialized() { return is_uninitialized_; } |
318 | 335 |
319 template<class SubClass> | 336 template<class SubClass> |
320 static Handle<Code> GetUninitialized(Isolate* isolate) { | 337 static Handle<Code> GetUninitialized(Isolate* isolate) { |
321 SubClass::GenerateAheadOfTime(isolate); | 338 SubClass::GenerateAheadOfTime(isolate); |
322 return SubClass().GetCode(isolate); | 339 return SubClass().GetCode(isolate); |
323 } | 340 } |
324 | 341 |
325 virtual void InitializeInterfaceDescriptor( | 342 virtual void InitializeInterfaceDescriptor( |
326 Isolate* isolate, | 343 Isolate* isolate, |
327 CodeStubInterfaceDescriptor* descriptor) = 0; | 344 CodeStubInterfaceDescriptor* descriptor) = 0; |
328 | 345 |
329 // Retrieve the code for the stub. Generate the code if needed. | 346 // Retrieve the code for the stub. Generate the code if needed. |
330 virtual Handle<Code> GenerateCode() = 0; | 347 virtual Handle<Code> GenerateCode() = 0; |
331 | 348 |
332 virtual int NotMissMinorKey() = 0; | 349 virtual int NotMissMinorKey() = 0; |
333 | 350 |
334 Handle<Code> GenerateLightweightMissCode(Isolate* isolate); | 351 Handle<Code> GenerateLightweightMissCode(Isolate* isolate); |
335 | 352 |
336 private: | 353 private: |
337 class MinorKeyBits: public BitField<int, 0, kStubMinorKeyBits - 1> {}; | 354 class MinorKeyBits: public BitField<int, 0, kStubMinorKeyBits - 1> {}; |
338 class IsMissBits: public BitField<bool, kStubMinorKeyBits - 1, 1> {}; | 355 class IsMissBits: public BitField<bool, kStubMinorKeyBits - 1, 1> {}; |
339 | 356 |
340 void GenerateLightweightMiss(MacroAssembler* masm); | 357 void GenerateLightweightMiss(MacroAssembler* masm); |
341 virtual int MinorKey() { | 358 virtual int MinorKey() { |
342 return IsMissBits::encode(is_miss_) | | 359 return IsMissBits::encode(is_uninitialized_) | |
343 MinorKeyBits::encode(NotMissMinorKey()); | 360 MinorKeyBits::encode(NotMissMinorKey()); |
344 } | 361 } |
345 | 362 |
346 bool is_miss_; | 363 bool is_uninitialized_; |
347 }; | 364 }; |
348 | 365 |
349 | 366 |
350 // Helper interface to prepare to/restore after making runtime calls. | 367 // Helper interface to prepare to/restore after making runtime calls. |
351 class RuntimeCallHelper { | 368 class RuntimeCallHelper { |
352 public: | 369 public: |
353 virtual ~RuntimeCallHelper() {} | 370 virtual ~RuntimeCallHelper() {} |
354 | 371 |
355 virtual void BeforeCall(MacroAssembler* masm) const = 0; | 372 virtual void BeforeCall(MacroAssembler* masm) const = 0; |
356 | 373 |
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
509 COPY_ON_WRITE_ELEMENTS, | 526 COPY_ON_WRITE_ELEMENTS, |
510 CLONE_ANY_ELEMENTS, | 527 CLONE_ANY_ELEMENTS, |
511 LAST_CLONE_MODE = CLONE_ANY_ELEMENTS | 528 LAST_CLONE_MODE = CLONE_ANY_ELEMENTS |
512 }; | 529 }; |
513 | 530 |
514 static const int kFastCloneModeCount = LAST_CLONE_MODE + 1; | 531 static const int kFastCloneModeCount = LAST_CLONE_MODE + 1; |
515 | 532 |
516 FastCloneShallowArrayStub(Mode mode, | 533 FastCloneShallowArrayStub(Mode mode, |
517 AllocationSiteMode allocation_site_mode, | 534 AllocationSiteMode allocation_site_mode, |
518 int length) | 535 int length) |
519 : HydrogenCodeStub(CODE_STUB_IS_NOT_MISS), | 536 : mode_(mode), |
520 mode_(mode), | |
521 allocation_site_mode_(allocation_site_mode), | 537 allocation_site_mode_(allocation_site_mode), |
522 length_((mode == COPY_ON_WRITE_ELEMENTS) ? 0 : length) { | 538 length_((mode == COPY_ON_WRITE_ELEMENTS) ? 0 : length) { |
523 ASSERT_GE(length_, 0); | 539 ASSERT_GE(length_, 0); |
524 ASSERT_LE(length_, kMaximumClonedLength); | 540 ASSERT_LE(length_, kMaximumClonedLength); |
525 } | 541 } |
526 | 542 |
527 Mode mode() const { return mode_; } | 543 Mode mode() const { return mode_; } |
528 int length() const { return length_; } | 544 int length() const { return length_; } |
529 AllocationSiteMode allocation_site_mode() const { | 545 AllocationSiteMode allocation_site_mode() const { |
530 return allocation_site_mode_; | 546 return allocation_site_mode_; |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
570 } | 586 } |
571 }; | 587 }; |
572 | 588 |
573 | 589 |
574 class FastCloneShallowObjectStub : public HydrogenCodeStub { | 590 class FastCloneShallowObjectStub : public HydrogenCodeStub { |
575 public: | 591 public: |
576 // Maximum number of properties in copied object. | 592 // Maximum number of properties in copied object. |
577 static const int kMaximumClonedProperties = 6; | 593 static const int kMaximumClonedProperties = 6; |
578 | 594 |
579 explicit FastCloneShallowObjectStub(int length) | 595 explicit FastCloneShallowObjectStub(int length) |
580 : HydrogenCodeStub(CODE_STUB_IS_NOT_MISS), | 596 : length_(length) { |
581 length_(length) { | |
582 ASSERT_GE(length_, 0); | 597 ASSERT_GE(length_, 0); |
583 ASSERT_LE(length_, kMaximumClonedProperties); | 598 ASSERT_LE(length_, kMaximumClonedProperties); |
584 } | 599 } |
585 | 600 |
586 int length() const { return length_; } | 601 int length() const { return length_; } |
587 | 602 |
588 virtual Handle<Code> GenerateCode(); | 603 virtual Handle<Code> GenerateCode(); |
589 | 604 |
590 virtual void InitializeInterfaceDescriptor( | 605 virtual void InitializeInterfaceDescriptor( |
591 Isolate* isolate, | 606 Isolate* isolate, |
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
756 virtual CodeStub::Major MajorKey() { return StoreArrayLength; } | 771 virtual CodeStub::Major MajorKey() { return StoreArrayLength; } |
757 }; | 772 }; |
758 | 773 |
759 | 774 |
760 class HICStub: public HydrogenCodeStub { | 775 class HICStub: public HydrogenCodeStub { |
761 public: | 776 public: |
762 virtual Code::Kind GetCodeKind() const { return kind(); } | 777 virtual Code::Kind GetCodeKind() const { return kind(); } |
763 virtual InlineCacheState GetICState() { return MONOMORPHIC; } | 778 virtual InlineCacheState GetICState() { return MONOMORPHIC; } |
764 | 779 |
765 protected: | 780 protected: |
766 HICStub() : HydrogenCodeStub(CODE_STUB_IS_NOT_MISS) { } | 781 HICStub() { } |
767 class KindBits: public BitField<Code::Kind, 0, 4> {}; | 782 class KindBits: public BitField<Code::Kind, 0, 4> {}; |
768 virtual Code::Kind kind() const = 0; | 783 virtual Code::Kind kind() const = 0; |
769 }; | 784 }; |
770 | 785 |
771 | 786 |
772 class HandlerStub: public HICStub { | 787 class HandlerStub: public HICStub { |
773 public: | 788 public: |
774 virtual Code::Kind GetCodeKind() const { return Code::STUB; } | 789 virtual Code::Kind GetCodeKind() const { return Code::STUB; } |
775 virtual int GetStubFlags() { return kind(); } | 790 virtual int GetStubFlags() { return kind(); } |
776 | 791 |
(...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1069 } | 1084 } |
1070 | 1085 |
1071 void Print(StringStream* stream) const; | 1086 void Print(StringStream* stream) const; |
1072 }; | 1087 }; |
1073 | 1088 |
1074 // At most 6 different types can be distinguished, because the Code object | 1089 // At most 6 different types can be distinguished, because the Code object |
1075 // only has room for a single byte to hold a set and there are two more | 1090 // only has room for a single byte to hold a set and there are two more |
1076 // boolean flags we need to store. :-P | 1091 // boolean flags we need to store. :-P |
1077 STATIC_ASSERT(NUMBER_OF_TYPES <= 6); | 1092 STATIC_ASSERT(NUMBER_OF_TYPES <= 6); |
1078 | 1093 |
1079 CompareNilICStub(EqualityKind kind, NilValue nil, Types types) | 1094 CompareNilICStub(EqualityKind kind, NilValue nil, Types types = Types()) |
1080 : HydrogenCodeStub(CODE_STUB_IS_NOT_MISS), types_(types) { | 1095 : types_(types) { |
1081 equality_kind_ = kind; | 1096 equality_kind_ = kind; |
1082 nil_value_ = nil; | 1097 nil_value_ = nil; |
1083 } | 1098 } |
1084 | 1099 |
1085 explicit CompareNilICStub(Code::ExtraICState ic_state) | 1100 CompareNilICStub(Code::ExtraICState ic_state, |
1086 : HydrogenCodeStub(CODE_STUB_IS_NOT_MISS) { | 1101 InitializationState init_state = INITIALIZED) |
| 1102 : HydrogenCodeStub(init_state) { |
1087 equality_kind_ = EqualityKindField::decode(ic_state); | 1103 equality_kind_ = EqualityKindField::decode(ic_state); |
1088 nil_value_ = NilValueField::decode(ic_state); | 1104 nil_value_ = NilValueField::decode(ic_state); |
1089 types_ = Types(ExtractTypesFromExtraICState(ic_state)); | 1105 types_ = Types(ExtractTypesFromExtraICState(ic_state)); |
1090 } | 1106 } |
1091 | 1107 |
1092 static Handle<Code> GetUninitialized(Isolate* isolate, | 1108 static Handle<Code> GetUninitialized(Isolate* isolate, |
1093 EqualityKind kind, | 1109 EqualityKind kind, |
1094 NilValue nil) { | 1110 NilValue nil) { |
1095 return CompareNilICStub(kind, nil, CODE_STUB_IS_MISS).GetCode(isolate); | 1111 return CompareNilICStub(kind, nil, UNINITIALIZED).GetCode(isolate); |
1096 } | 1112 } |
1097 | 1113 |
1098 virtual void InitializeInterfaceDescriptor( | 1114 virtual void InitializeInterfaceDescriptor( |
1099 Isolate* isolate, | 1115 Isolate* isolate, |
1100 CodeStubInterfaceDescriptor* descriptor); | 1116 CodeStubInterfaceDescriptor* descriptor); |
1101 | 1117 |
1102 static void InitializeForIsolate(Isolate* isolate) { | 1118 static void InitializeForIsolate(Isolate* isolate) { |
1103 CompareNilICStub compare_stub(kStrictEquality, kNullValue, | 1119 CompareNilICStub compare_stub(kStrictEquality, kNullValue, UNINITIALIZED); |
1104 CODE_STUB_IS_MISS); | |
1105 compare_stub.InitializeInterfaceDescriptor( | 1120 compare_stub.InitializeInterfaceDescriptor( |
1106 isolate, | 1121 isolate, |
1107 isolate->code_stub_interface_descriptor(CodeStub::CompareNilIC)); | 1122 isolate->code_stub_interface_descriptor(CodeStub::CompareNilIC)); |
1108 } | 1123 } |
1109 | 1124 |
1110 virtual InlineCacheState GetICState() { | 1125 virtual InlineCacheState GetICState() { |
1111 if (types_ == Types::FullCompare()) { | 1126 if (types_ == Types::FullCompare()) { |
1112 return MEGAMORPHIC; | 1127 return MEGAMORPHIC; |
1113 } else if (types_.Contains(MONOMORPHIC_MAP)) { | 1128 } else if (types_.Contains(MONOMORPHIC_MAP)) { |
1114 return MONOMORPHIC; | 1129 return MONOMORPHIC; |
(...skipping 26 matching lines...) Expand all Loading... |
1141 void ClearTypes() { types_.RemoveAll(); } | 1156 void ClearTypes() { types_.RemoveAll(); } |
1142 void SetKind(EqualityKind kind) { equality_kind_ = kind; } | 1157 void SetKind(EqualityKind kind) { equality_kind_ = kind; } |
1143 | 1158 |
1144 virtual void PrintName(StringStream* stream); | 1159 virtual void PrintName(StringStream* stream); |
1145 | 1160 |
1146 private: | 1161 private: |
1147 friend class CompareNilIC; | 1162 friend class CompareNilIC; |
1148 | 1163 |
1149 CompareNilICStub(EqualityKind kind, NilValue nil, | 1164 CompareNilICStub(EqualityKind kind, NilValue nil, |
1150 InitializationState init_state) | 1165 InitializationState init_state) |
1151 : HydrogenCodeStub(init_state), types_(0) { | 1166 : HydrogenCodeStub(init_state) { |
1152 equality_kind_ = kind; | 1167 equality_kind_ = kind; |
1153 nil_value_ = nil; | 1168 nil_value_ = nil; |
1154 } | 1169 } |
1155 | 1170 |
1156 CompareNilICStub(Code::ExtraICState ic_state, InitializationState init_state) | |
1157 : HydrogenCodeStub(init_state) { | |
1158 equality_kind_ = EqualityKindField::decode(ic_state); | |
1159 nil_value_ = NilValueField::decode(ic_state); | |
1160 types_ = Types(ExtractTypesFromExtraICState(ic_state)); | |
1161 } | |
1162 | |
1163 class EqualityKindField : public BitField<EqualityKind, NUMBER_OF_TYPES, 1> { | 1171 class EqualityKindField : public BitField<EqualityKind, NUMBER_OF_TYPES, 1> { |
1164 }; | 1172 }; |
1165 class NilValueField : public BitField<NilValue, NUMBER_OF_TYPES+1, 1> {}; | 1173 class NilValueField : public BitField<NilValue, NUMBER_OF_TYPES+1, 1> {}; |
1166 | 1174 |
1167 virtual CodeStub::Major MajorKey() { return CompareNilIC; } | 1175 virtual CodeStub::Major MajorKey() { return CompareNilIC; } |
1168 virtual int NotMissMinorKey() { return GetExtraICState(); } | 1176 virtual int NotMissMinorKey() { return GetExtraICState(); } |
1169 | 1177 |
1170 EqualityKind equality_kind_; | 1178 EqualityKind equality_kind_; |
1171 NilValue nil_value_; | 1179 NilValue nil_value_; |
1172 Types types_; | 1180 Types types_; |
(...skipping 387 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1560 private: | 1568 private: |
1561 Major MajorKey() { return KeyedLoadElement; } | 1569 Major MajorKey() { return KeyedLoadElement; } |
1562 int MinorKey() { return DICTIONARY_ELEMENTS; } | 1570 int MinorKey() { return DICTIONARY_ELEMENTS; } |
1563 | 1571 |
1564 DISALLOW_COPY_AND_ASSIGN(KeyedLoadDictionaryElementStub); | 1572 DISALLOW_COPY_AND_ASSIGN(KeyedLoadDictionaryElementStub); |
1565 }; | 1573 }; |
1566 | 1574 |
1567 | 1575 |
1568 class KeyedLoadFastElementStub : public HydrogenCodeStub { | 1576 class KeyedLoadFastElementStub : public HydrogenCodeStub { |
1569 public: | 1577 public: |
1570 KeyedLoadFastElementStub(bool is_js_array, ElementsKind elements_kind) | 1578 KeyedLoadFastElementStub(bool is_js_array, ElementsKind elements_kind) { |
1571 : HydrogenCodeStub(CODE_STUB_IS_NOT_MISS) { | |
1572 bit_field_ = ElementsKindBits::encode(elements_kind) | | 1579 bit_field_ = ElementsKindBits::encode(elements_kind) | |
1573 IsJSArrayBits::encode(is_js_array); | 1580 IsJSArrayBits::encode(is_js_array); |
1574 } | 1581 } |
1575 | 1582 |
1576 bool is_js_array() const { | 1583 bool is_js_array() const { |
1577 return IsJSArrayBits::decode(bit_field_); | 1584 return IsJSArrayBits::decode(bit_field_); |
1578 } | 1585 } |
1579 | 1586 |
1580 ElementsKind elements_kind() const { | 1587 ElementsKind elements_kind() const { |
1581 return ElementsKindBits::decode(bit_field_); | 1588 return ElementsKindBits::decode(bit_field_); |
(...skipping 14 matching lines...) Expand all Loading... |
1596 int NotMissMinorKey() { return bit_field_; } | 1603 int NotMissMinorKey() { return bit_field_; } |
1597 | 1604 |
1598 DISALLOW_COPY_AND_ASSIGN(KeyedLoadFastElementStub); | 1605 DISALLOW_COPY_AND_ASSIGN(KeyedLoadFastElementStub); |
1599 }; | 1606 }; |
1600 | 1607 |
1601 | 1608 |
1602 class KeyedStoreFastElementStub : public HydrogenCodeStub { | 1609 class KeyedStoreFastElementStub : public HydrogenCodeStub { |
1603 public: | 1610 public: |
1604 KeyedStoreFastElementStub(bool is_js_array, | 1611 KeyedStoreFastElementStub(bool is_js_array, |
1605 ElementsKind elements_kind, | 1612 ElementsKind elements_kind, |
1606 KeyedAccessStoreMode mode) | 1613 KeyedAccessStoreMode mode) { |
1607 : HydrogenCodeStub(CODE_STUB_IS_NOT_MISS) { | |
1608 bit_field_ = ElementsKindBits::encode(elements_kind) | | 1614 bit_field_ = ElementsKindBits::encode(elements_kind) | |
1609 IsJSArrayBits::encode(is_js_array) | | 1615 IsJSArrayBits::encode(is_js_array) | |
1610 StoreModeBits::encode(mode); | 1616 StoreModeBits::encode(mode); |
1611 } | 1617 } |
1612 | 1618 |
1613 bool is_js_array() const { | 1619 bool is_js_array() const { |
1614 return IsJSArrayBits::decode(bit_field_); | 1620 return IsJSArrayBits::decode(bit_field_); |
1615 } | 1621 } |
1616 | 1622 |
1617 ElementsKind elements_kind() const { | 1623 ElementsKind elements_kind() const { |
(...skipping 19 matching lines...) Expand all Loading... |
1637 Major MajorKey() { return KeyedStoreElement; } | 1643 Major MajorKey() { return KeyedStoreElement; } |
1638 int NotMissMinorKey() { return bit_field_; } | 1644 int NotMissMinorKey() { return bit_field_; } |
1639 | 1645 |
1640 DISALLOW_COPY_AND_ASSIGN(KeyedStoreFastElementStub); | 1646 DISALLOW_COPY_AND_ASSIGN(KeyedStoreFastElementStub); |
1641 }; | 1647 }; |
1642 | 1648 |
1643 | 1649 |
1644 class TransitionElementsKindStub : public HydrogenCodeStub { | 1650 class TransitionElementsKindStub : public HydrogenCodeStub { |
1645 public: | 1651 public: |
1646 TransitionElementsKindStub(ElementsKind from_kind, | 1652 TransitionElementsKindStub(ElementsKind from_kind, |
1647 ElementsKind to_kind) | 1653 ElementsKind to_kind) { |
1648 : HydrogenCodeStub(CODE_STUB_IS_NOT_MISS) { | |
1649 bit_field_ = FromKindBits::encode(from_kind) | | 1654 bit_field_ = FromKindBits::encode(from_kind) | |
1650 ToKindBits::encode(to_kind); | 1655 ToKindBits::encode(to_kind); |
1651 } | 1656 } |
1652 | 1657 |
1653 ElementsKind from_kind() const { | 1658 ElementsKind from_kind() const { |
1654 return FromKindBits::decode(bit_field_); | 1659 return FromKindBits::decode(bit_field_); |
1655 } | 1660 } |
1656 | 1661 |
1657 ElementsKind to_kind() const { | 1662 ElementsKind to_kind() const { |
1658 return ToKindBits::decode(bit_field_); | 1663 return ToKindBits::decode(bit_field_); |
(...skipping 12 matching lines...) Expand all Loading... |
1671 | 1676 |
1672 Major MajorKey() { return TransitionElementsKind; } | 1677 Major MajorKey() { return TransitionElementsKind; } |
1673 int NotMissMinorKey() { return bit_field_; } | 1678 int NotMissMinorKey() { return bit_field_; } |
1674 | 1679 |
1675 DISALLOW_COPY_AND_ASSIGN(TransitionElementsKindStub); | 1680 DISALLOW_COPY_AND_ASSIGN(TransitionElementsKindStub); |
1676 }; | 1681 }; |
1677 | 1682 |
1678 | 1683 |
1679 class ArrayConstructorStubBase : public HydrogenCodeStub { | 1684 class ArrayConstructorStubBase : public HydrogenCodeStub { |
1680 public: | 1685 public: |
1681 ArrayConstructorStubBase(ElementsKind kind, AllocationSiteMode mode) | 1686 ArrayConstructorStubBase(ElementsKind kind, AllocationSiteMode mode) { |
1682 : HydrogenCodeStub(CODE_STUB_IS_NOT_MISS) { | |
1683 bit_field_ = ElementsKindBits::encode(kind) | | 1687 bit_field_ = ElementsKindBits::encode(kind) | |
1684 AllocationSiteModeBits::encode(mode == TRACK_ALLOCATION_SITE); | 1688 AllocationSiteModeBits::encode(mode == TRACK_ALLOCATION_SITE); |
1685 } | 1689 } |
1686 | 1690 |
1687 ElementsKind elements_kind() const { | 1691 ElementsKind elements_kind() const { |
1688 return ElementsKindBits::decode(bit_field_); | 1692 return ElementsKindBits::decode(bit_field_); |
1689 } | 1693 } |
1690 | 1694 |
1691 AllocationSiteMode mode() const { | 1695 AllocationSiteMode mode() const { |
1692 return AllocationSiteModeBits::decode(bit_field_) | 1696 return AllocationSiteModeBits::decode(bit_field_) |
(...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1990 | 1994 |
1991 // The current function entry hook. | 1995 // The current function entry hook. |
1992 static FunctionEntryHook entry_hook_; | 1996 static FunctionEntryHook entry_hook_; |
1993 | 1997 |
1994 DISALLOW_COPY_AND_ASSIGN(ProfileEntryHookStub); | 1998 DISALLOW_COPY_AND_ASSIGN(ProfileEntryHookStub); |
1995 }; | 1999 }; |
1996 | 2000 |
1997 } } // namespace v8::internal | 2001 } } // namespace v8::internal |
1998 | 2002 |
1999 #endif // V8_CODE_STUBS_H_ | 2003 #endif // V8_CODE_STUBS_H_ |
OLD | NEW |