| 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 1369 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1380 | 1380 |
| 1381 class CallDataUndefinedBits : public BitField<bool, 0, 1> {}; | 1381 class CallDataUndefinedBits : public BitField<bool, 0, 1> {}; |
| 1382 | 1382 |
| 1383 DEFINE_CALL_INTERFACE_DESCRIPTOR(ApiFunction); | 1383 DEFINE_CALL_INTERFACE_DESCRIPTOR(ApiFunction); |
| 1384 DEFINE_PLATFORM_CODE_STUB(CallApiFunction, PlatformCodeStub); | 1384 DEFINE_PLATFORM_CODE_STUB(CallApiFunction, PlatformCodeStub); |
| 1385 }; | 1385 }; |
| 1386 | 1386 |
| 1387 | 1387 |
| 1388 class CallApiAccessorStub : public PlatformCodeStub { | 1388 class CallApiAccessorStub : public PlatformCodeStub { |
| 1389 public: | 1389 public: |
| 1390 CallApiAccessorStub(Isolate* isolate, bool is_store, bool call_data_undefined) | 1390 CallApiAccessorStub(Isolate* isolate, bool is_store, bool call_data_undefined, |
| 1391 bool is_lazy) |
| 1391 : PlatformCodeStub(isolate) { | 1392 : PlatformCodeStub(isolate) { |
| 1392 minor_key_ = IsStoreBits::encode(is_store) | | 1393 minor_key_ = IsStoreBits::encode(is_store) | |
| 1393 CallDataUndefinedBits::encode(call_data_undefined) | | 1394 CallDataUndefinedBits::encode(call_data_undefined) | |
| 1394 ArgumentBits::encode(is_store ? 1 : 0); | 1395 ArgumentBits::encode(is_store ? 1 : 0) | |
| 1396 IsLazyAccessorBits::encode(is_lazy); |
| 1395 } | 1397 } |
| 1396 | 1398 |
| 1397 protected: | 1399 protected: |
| 1398 // For CallApiFunctionWithFixedArgsStub, see below. | 1400 // For CallApiFunctionWithFixedArgsStub, see below. |
| 1399 static const int kArgBits = 3; | 1401 static const int kArgBits = 3; |
| 1400 CallApiAccessorStub(Isolate* isolate, int argc, bool call_data_undefined) | 1402 CallApiAccessorStub(Isolate* isolate, int argc, bool call_data_undefined) |
| 1401 : PlatformCodeStub(isolate) { | 1403 : PlatformCodeStub(isolate) { |
| 1402 minor_key_ = IsStoreBits::encode(false) | | 1404 minor_key_ = IsStoreBits::encode(false) | |
| 1403 CallDataUndefinedBits::encode(call_data_undefined) | | 1405 CallDataUndefinedBits::encode(call_data_undefined) | |
| 1404 ArgumentBits::encode(argc); | 1406 ArgumentBits::encode(argc); |
| 1405 } | 1407 } |
| 1406 | 1408 |
| 1407 private: | 1409 private: |
| 1408 bool is_store() const { return IsStoreBits::decode(minor_key_); } | 1410 bool is_store() const { return IsStoreBits::decode(minor_key_); } |
| 1411 bool is_lazy() const { return IsLazyAccessorBits::decode(minor_key_); } |
| 1409 bool call_data_undefined() const { | 1412 bool call_data_undefined() const { |
| 1410 return CallDataUndefinedBits::decode(minor_key_); | 1413 return CallDataUndefinedBits::decode(minor_key_); |
| 1411 } | 1414 } |
| 1412 int argc() const { return ArgumentBits::decode(minor_key_); } | 1415 int argc() const { return ArgumentBits::decode(minor_key_); } |
| 1413 | 1416 |
| 1414 class IsStoreBits: public BitField<bool, 0, 1> {}; | 1417 class IsStoreBits: public BitField<bool, 0, 1> {}; |
| 1415 class CallDataUndefinedBits: public BitField<bool, 1, 1> {}; | 1418 class CallDataUndefinedBits: public BitField<bool, 1, 1> {}; |
| 1416 class ArgumentBits : public BitField<int, 2, kArgBits> {}; | 1419 class ArgumentBits : public BitField<int, 2, kArgBits> {}; |
| 1420 class IsLazyAccessorBits : public BitField<bool, 3 + kArgBits, 1> {}; |
| 1417 | 1421 |
| 1418 DEFINE_CALL_INTERFACE_DESCRIPTOR(ApiAccessor); | 1422 DEFINE_CALL_INTERFACE_DESCRIPTOR(ApiAccessor); |
| 1419 DEFINE_PLATFORM_CODE_STUB(CallApiAccessor, PlatformCodeStub); | 1423 DEFINE_PLATFORM_CODE_STUB(CallApiAccessor, PlatformCodeStub); |
| 1420 }; | 1424 }; |
| 1421 | 1425 |
| 1422 | 1426 |
| 1423 // TODO(dcarney): see if it's possible to remove this later without performance | 1427 // TODO(dcarney): see if it's possible to remove this later without performance |
| 1424 // degradation. | 1428 // degradation. |
| 1425 // This is not a real stub, but a way of generating the CallApiAccessorStub | 1429 // This is not a real stub, but a way of generating the CallApiAccessorStub |
| 1426 // (which has the same abi) which makes it clear that it is not an accessor. | 1430 // (which has the same abi) which makes it clear that it is not an accessor. |
| (...skipping 1547 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2974 #undef DEFINE_HYDROGEN_CODE_STUB | 2978 #undef DEFINE_HYDROGEN_CODE_STUB |
| 2975 #undef DEFINE_CODE_STUB | 2979 #undef DEFINE_CODE_STUB |
| 2976 #undef DEFINE_CODE_STUB_BASE | 2980 #undef DEFINE_CODE_STUB_BASE |
| 2977 | 2981 |
| 2978 extern Representation RepresentationFromType(Type* type); | 2982 extern Representation RepresentationFromType(Type* type); |
| 2979 | 2983 |
| 2980 } // namespace internal | 2984 } // namespace internal |
| 2981 } // namespace v8 | 2985 } // namespace v8 |
| 2982 | 2986 |
| 2983 #endif // V8_CODE_STUBS_H_ | 2987 #endif // V8_CODE_STUBS_H_ |
| OLD | NEW |