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_CODE_STUBS_H_ | 5 #ifndef V8_CODE_STUBS_H_ |
6 #define V8_CODE_STUBS_H_ | 6 #define V8_CODE_STUBS_H_ |
7 | 7 |
8 #include "src/allocation.h" | 8 #include "src/allocation.h" |
9 #include "src/assembler.h" | 9 #include "src/assembler.h" |
10 #include "src/code-stub-assembler.h" | 10 #include "src/code-stub-assembler.h" |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
133 V(StringNotEqual) \ | 133 V(StringNotEqual) \ |
134 V(StringLessThan) \ | 134 V(StringLessThan) \ |
135 V(StringLessThanOrEqual) \ | 135 V(StringLessThanOrEqual) \ |
136 V(StringGreaterThan) \ | 136 V(StringGreaterThan) \ |
137 V(StringGreaterThanOrEqual) \ | 137 V(StringGreaterThanOrEqual) \ |
138 V(ToBoolean) \ | 138 V(ToBoolean) \ |
139 V(ToInteger) \ | 139 V(ToInteger) \ |
140 V(ToLength) \ | 140 V(ToLength) \ |
141 /* IC Handler stubs */ \ | 141 /* IC Handler stubs */ \ |
142 V(ArrayBufferViewLoadField) \ | 142 V(ArrayBufferViewLoadField) \ |
| 143 V(KeyedLoadSloppyArguments) \ |
| 144 V(KeyedStoreSloppyArguments) \ |
| 145 V(LoadApiGetter) \ |
143 V(LoadConstant) \ | 146 V(LoadConstant) \ |
144 V(LoadFastElement) \ | 147 V(LoadFastElement) \ |
145 V(LoadField) \ | 148 V(LoadField) \ |
146 V(LoadIndexedInterceptor) \ | 149 V(LoadIndexedInterceptor) \ |
147 V(KeyedLoadSloppyArguments) \ | |
148 V(KeyedStoreSloppyArguments) \ | |
149 V(StoreField) \ | 150 V(StoreField) \ |
| 151 V(StoreGlobal) \ |
150 V(StoreInterceptor) \ | 152 V(StoreInterceptor) \ |
151 V(StoreGlobal) \ | |
152 V(StoreTransition) | 153 V(StoreTransition) |
153 | 154 |
154 // List of code stubs only used on ARM 32 bits platforms. | 155 // List of code stubs only used on ARM 32 bits platforms. |
155 #if V8_TARGET_ARCH_ARM | 156 #if V8_TARGET_ARCH_ARM |
156 #define CODE_STUB_LIST_ARM(V) V(DirectCEntry) | 157 #define CODE_STUB_LIST_ARM(V) V(DirectCEntry) |
157 | 158 |
158 #else | 159 #else |
159 #define CODE_STUB_LIST_ARM(V) | 160 #define CODE_STUB_LIST_ARM(V) |
160 #endif | 161 #endif |
161 | 162 |
(...skipping 1287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1449 | 1450 |
1450 protected: | 1451 protected: |
1451 Code::Kind kind() const override { return Code::LOAD_IC; } | 1452 Code::Kind kind() const override { return Code::LOAD_IC; } |
1452 | 1453 |
1453 private: | 1454 private: |
1454 class ConstantIndexBits : public BitField<int, 0, kSubMinorKeyBits> {}; | 1455 class ConstantIndexBits : public BitField<int, 0, kSubMinorKeyBits> {}; |
1455 | 1456 |
1456 DEFINE_HANDLER_CODE_STUB(LoadConstant, HandlerStub); | 1457 DEFINE_HANDLER_CODE_STUB(LoadConstant, HandlerStub); |
1457 }; | 1458 }; |
1458 | 1459 |
| 1460 class LoadApiGetterStub : public TurboFanCodeStub { |
| 1461 public: |
| 1462 LoadApiGetterStub(Isolate* isolate, bool receiver_is_holder, int index) |
| 1463 : TurboFanCodeStub(isolate) { |
| 1464 minor_key_ = IndexBits::encode(index) | |
| 1465 ReceiverIsHolderBits::encode(receiver_is_holder); |
| 1466 } |
| 1467 |
| 1468 Code::Kind GetCodeKind() const override { return Code::HANDLER; } |
| 1469 ExtraICState GetExtraICState() const override { return Code::LOAD_IC; } |
| 1470 InlineCacheState GetICState() const override { return MONOMORPHIC; } |
| 1471 |
| 1472 int index() const { return IndexBits::decode(minor_key_); } |
| 1473 bool receiver_is_holder() const { |
| 1474 return ReceiverIsHolderBits::decode(minor_key_); |
| 1475 } |
| 1476 |
| 1477 private: |
| 1478 class ReceiverIsHolderBits : public BitField<bool, 0, 1> {}; |
| 1479 class IndexBits : public BitField<int, 1, kDescriptorIndexBitCount> {}; |
| 1480 |
| 1481 DEFINE_CALL_INTERFACE_DESCRIPTOR(Load); |
| 1482 DEFINE_TURBOFAN_CODE_STUB(LoadApiGetter, TurboFanCodeStub); |
| 1483 }; |
1459 | 1484 |
1460 class StoreFieldStub : public HandlerStub { | 1485 class StoreFieldStub : public HandlerStub { |
1461 public: | 1486 public: |
1462 StoreFieldStub(Isolate* isolate, FieldIndex index, | 1487 StoreFieldStub(Isolate* isolate, FieldIndex index, |
1463 Representation representation) | 1488 Representation representation) |
1464 : HandlerStub(isolate) { | 1489 : HandlerStub(isolate) { |
1465 int property_index_key = index.GetFieldAccessStubKey(); | 1490 int property_index_key = index.GetFieldAccessStubKey(); |
1466 uint8_t repr = PropertyDetails::EncodeRepresentation(representation); | 1491 uint8_t repr = PropertyDetails::EncodeRepresentation(representation); |
1467 set_sub_minor_key(StoreFieldByIndexBits::encode(property_index_key) | | 1492 set_sub_minor_key(StoreFieldByIndexBits::encode(property_index_key) | |
1468 RepresentationBits::encode(repr)); | 1493 RepresentationBits::encode(repr)); |
(...skipping 1682 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3151 #undef DEFINE_HYDROGEN_CODE_STUB | 3176 #undef DEFINE_HYDROGEN_CODE_STUB |
3152 #undef DEFINE_CODE_STUB | 3177 #undef DEFINE_CODE_STUB |
3153 #undef DEFINE_CODE_STUB_BASE | 3178 #undef DEFINE_CODE_STUB_BASE |
3154 | 3179 |
3155 extern Representation RepresentationFromType(Type* type); | 3180 extern Representation RepresentationFromType(Type* type); |
3156 | 3181 |
3157 } // namespace internal | 3182 } // namespace internal |
3158 } // namespace v8 | 3183 } // namespace v8 |
3159 | 3184 |
3160 #endif // V8_CODE_STUBS_H_ | 3185 #endif // V8_CODE_STUBS_H_ |
OLD | NEW |