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/codegen.h" | 10 #include "src/codegen.h" |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
134 V(StringNotEqual) \ | 134 V(StringNotEqual) \ |
135 V(StringLessThan) \ | 135 V(StringLessThan) \ |
136 V(StringLessThanOrEqual) \ | 136 V(StringLessThanOrEqual) \ |
137 V(StringGreaterThan) \ | 137 V(StringGreaterThan) \ |
138 V(StringGreaterThanOrEqual) \ | 138 V(StringGreaterThanOrEqual) \ |
139 V(ToBoolean) \ | 139 V(ToBoolean) \ |
140 V(ToInteger) \ | 140 V(ToInteger) \ |
141 V(ToLength) \ | 141 V(ToLength) \ |
142 /* IC Handler stubs */ \ | 142 /* IC Handler stubs */ \ |
143 V(ArrayBufferViewLoadField) \ | 143 V(ArrayBufferViewLoadField) \ |
144 V(LoadConstant) \ | |
145 V(LoadFastElement) \ | 144 V(LoadFastElement) \ |
146 V(LoadField) \ | 145 V(LoadField) \ |
146 V(LoadConstant) \ | |
Jakob Kummerow
2016/04/19 08:17:20
nit: why not maintain alphabetic ordering?
| |
147 V(LoadApiGetter) \ | |
147 V(LoadIndexedInterceptor) \ | 148 V(LoadIndexedInterceptor) \ |
148 V(KeyedLoadSloppyArguments) \ | 149 V(KeyedLoadSloppyArguments) \ |
149 V(KeyedStoreSloppyArguments) \ | 150 V(KeyedStoreSloppyArguments) \ |
150 V(StoreField) \ | 151 V(StoreField) \ |
151 V(StoreInterceptor) \ | 152 V(StoreInterceptor) \ |
152 V(StoreGlobal) \ | 153 V(StoreGlobal) \ |
153 V(StoreTransition) | 154 V(StoreTransition) |
154 | 155 |
155 // List of code stubs only used on ARM 32 bits platforms. | 156 // List of code stubs only used on ARM 32 bits platforms. |
156 #if V8_TARGET_ARCH_ARM | 157 #if V8_TARGET_ARCH_ARM |
(...skipping 1295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1452 | 1453 |
1453 protected: | 1454 protected: |
1454 Code::Kind kind() const override { return Code::LOAD_IC; } | 1455 Code::Kind kind() const override { return Code::LOAD_IC; } |
1455 | 1456 |
1456 private: | 1457 private: |
1457 class ConstantIndexBits : public BitField<int, 0, kSubMinorKeyBits> {}; | 1458 class ConstantIndexBits : public BitField<int, 0, kSubMinorKeyBits> {}; |
1458 | 1459 |
1459 DEFINE_HANDLER_CODE_STUB(LoadConstant, HandlerStub); | 1460 DEFINE_HANDLER_CODE_STUB(LoadConstant, HandlerStub); |
1460 }; | 1461 }; |
1461 | 1462 |
1463 class LoadApiGetterStub : public TurboFanCodeStub { | |
1464 public: | |
1465 LoadApiGetterStub(Isolate* isolate, bool receiver_is_holder, int index) | |
1466 : TurboFanCodeStub(isolate) { | |
1467 minor_key_ = IndexBits::encode(index) | | |
1468 ReceiverIsHolderBits::encode(receiver_is_holder); | |
1469 } | |
1470 | |
1471 Code::Kind GetCodeKind() const override { return Code::HANDLER; } | |
1472 ExtraICState GetExtraICState() const override { return Code::LOAD_IC; } | |
1473 InlineCacheState GetICState() const override { return MONOMORPHIC; } | |
1474 | |
1475 int index() const { return IndexBits::decode(minor_key_); } | |
1476 bool receiver_is_holder() const { | |
1477 return ReceiverIsHolderBits::decode(minor_key_); | |
1478 } | |
1479 | |
1480 private: | |
1481 class ReceiverIsHolderBits : public BitField<bool, 0, 1> {}; | |
1482 class IndexBits : public BitField<int, 1, kDescriptorIndexBitCount> {}; | |
1483 | |
1484 DEFINE_CALL_INTERFACE_DESCRIPTOR(Load); | |
1485 DEFINE_TURBOFAN_CODE_STUB(LoadApiGetter, TurboFanCodeStub); | |
1486 }; | |
1462 | 1487 |
1463 class StoreFieldStub : public HandlerStub { | 1488 class StoreFieldStub : public HandlerStub { |
1464 public: | 1489 public: |
1465 StoreFieldStub(Isolate* isolate, FieldIndex index, | 1490 StoreFieldStub(Isolate* isolate, FieldIndex index, |
1466 Representation representation) | 1491 Representation representation) |
1467 : HandlerStub(isolate) { | 1492 : HandlerStub(isolate) { |
1468 int property_index_key = index.GetFieldAccessStubKey(); | 1493 int property_index_key = index.GetFieldAccessStubKey(); |
1469 uint8_t repr = PropertyDetails::EncodeRepresentation(representation); | 1494 uint8_t repr = PropertyDetails::EncodeRepresentation(representation); |
1470 set_sub_minor_key(StoreFieldByIndexBits::encode(property_index_key) | | 1495 set_sub_minor_key(StoreFieldByIndexBits::encode(property_index_key) | |
1471 RepresentationBits::encode(repr)); | 1496 RepresentationBits::encode(repr)); |
(...skipping 1691 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3163 #undef DEFINE_HYDROGEN_CODE_STUB | 3188 #undef DEFINE_HYDROGEN_CODE_STUB |
3164 #undef DEFINE_CODE_STUB | 3189 #undef DEFINE_CODE_STUB |
3165 #undef DEFINE_CODE_STUB_BASE | 3190 #undef DEFINE_CODE_STUB_BASE |
3166 | 3191 |
3167 extern Representation RepresentationFromType(Type* type); | 3192 extern Representation RepresentationFromType(Type* type); |
3168 | 3193 |
3169 } // namespace internal | 3194 } // namespace internal |
3170 } // namespace v8 | 3195 } // namespace v8 |
3171 | 3196 |
3172 #endif // V8_CODE_STUBS_H_ | 3197 #endif // V8_CODE_STUBS_H_ |
OLD | NEW |