| 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 1385 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1396 | 1396 |
| 1397 class CallDataUndefinedBits : public BitField<bool, 0, 1> {}; | 1397 class CallDataUndefinedBits : public BitField<bool, 0, 1> {}; |
| 1398 | 1398 |
| 1399 DEFINE_CALL_INTERFACE_DESCRIPTOR(ApiFunction); | 1399 DEFINE_CALL_INTERFACE_DESCRIPTOR(ApiFunction); |
| 1400 DEFINE_PLATFORM_CODE_STUB(CallApiFunction, PlatformCodeStub); | 1400 DEFINE_PLATFORM_CODE_STUB(CallApiFunction, PlatformCodeStub); |
| 1401 }; | 1401 }; |
| 1402 | 1402 |
| 1403 | 1403 |
| 1404 class CallApiAccessorStub : public PlatformCodeStub { | 1404 class CallApiAccessorStub : public PlatformCodeStub { |
| 1405 public: | 1405 public: |
| 1406 CallApiAccessorStub(Isolate* isolate, bool is_store, bool call_data_undefined, | 1406 CallApiAccessorStub(Isolate* isolate, bool is_store, bool call_data_undefined) |
| 1407 bool is_lazy) | |
| 1408 : PlatformCodeStub(isolate) { | 1407 : PlatformCodeStub(isolate) { |
| 1409 minor_key_ = IsStoreBits::encode(is_store) | | 1408 minor_key_ = IsStoreBits::encode(is_store) | |
| 1410 CallDataUndefinedBits::encode(call_data_undefined) | | 1409 CallDataUndefinedBits::encode(call_data_undefined) | |
| 1411 ArgumentBits::encode(is_store ? 1 : 0) | | 1410 ArgumentBits::encode(is_store ? 1 : 0); |
| 1412 IsLazyAccessorBits::encode(is_lazy); | |
| 1413 } | 1411 } |
| 1414 | 1412 |
| 1415 protected: | 1413 protected: |
| 1416 // For CallApiFunctionWithFixedArgsStub, see below. | 1414 // For CallApiFunctionWithFixedArgsStub, see below. |
| 1417 static const int kArgBits = 3; | 1415 static const int kArgBits = 3; |
| 1418 CallApiAccessorStub(Isolate* isolate, int argc, bool call_data_undefined) | 1416 CallApiAccessorStub(Isolate* isolate, int argc, bool call_data_undefined) |
| 1419 : PlatformCodeStub(isolate) { | 1417 : PlatformCodeStub(isolate) { |
| 1420 minor_key_ = IsStoreBits::encode(false) | | 1418 minor_key_ = IsStoreBits::encode(false) | |
| 1421 CallDataUndefinedBits::encode(call_data_undefined) | | 1419 CallDataUndefinedBits::encode(call_data_undefined) | |
| 1422 ArgumentBits::encode(argc); | 1420 ArgumentBits::encode(argc); |
| 1423 } | 1421 } |
| 1424 | 1422 |
| 1425 private: | 1423 private: |
| 1426 bool is_store() const { return IsStoreBits::decode(minor_key_); } | 1424 bool is_store() const { return IsStoreBits::decode(minor_key_); } |
| 1427 bool is_lazy() const { return IsLazyAccessorBits::decode(minor_key_); } | |
| 1428 bool call_data_undefined() const { | 1425 bool call_data_undefined() const { |
| 1429 return CallDataUndefinedBits::decode(minor_key_); | 1426 return CallDataUndefinedBits::decode(minor_key_); |
| 1430 } | 1427 } |
| 1431 int argc() const { return ArgumentBits::decode(minor_key_); } | 1428 int argc() const { return ArgumentBits::decode(minor_key_); } |
| 1432 | 1429 |
| 1433 class IsStoreBits: public BitField<bool, 0, 1> {}; | 1430 class IsStoreBits: public BitField<bool, 0, 1> {}; |
| 1434 class CallDataUndefinedBits: public BitField<bool, 1, 1> {}; | 1431 class CallDataUndefinedBits: public BitField<bool, 1, 1> {}; |
| 1435 class ArgumentBits : public BitField<int, 2, kArgBits> {}; | 1432 class ArgumentBits : public BitField<int, 2, kArgBits> {}; |
| 1436 class IsLazyAccessorBits : public BitField<bool, 3 + kArgBits, 1> {}; | |
| 1437 | 1433 |
| 1438 DEFINE_CALL_INTERFACE_DESCRIPTOR(ApiAccessor); | 1434 DEFINE_CALL_INTERFACE_DESCRIPTOR(ApiAccessor); |
| 1439 DEFINE_PLATFORM_CODE_STUB(CallApiAccessor, PlatformCodeStub); | 1435 DEFINE_PLATFORM_CODE_STUB(CallApiAccessor, PlatformCodeStub); |
| 1440 }; | 1436 }; |
| 1441 | 1437 |
| 1442 | 1438 |
| 1443 // TODO(dcarney): see if it's possible to remove this later without performance | 1439 // TODO(dcarney): see if it's possible to remove this later without performance |
| 1444 // degradation. | 1440 // degradation. |
| 1445 // This is not a real stub, but a way of generating the CallApiAccessorStub | 1441 // This is not a real stub, but a way of generating the CallApiAccessorStub |
| 1446 // (which has the same abi) which makes it clear that it is not an accessor. | 1442 // (which has the same abi) which makes it clear that it is not an accessor. |
| (...skipping 1545 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2992 #undef DEFINE_HYDROGEN_CODE_STUB | 2988 #undef DEFINE_HYDROGEN_CODE_STUB |
| 2993 #undef DEFINE_CODE_STUB | 2989 #undef DEFINE_CODE_STUB |
| 2994 #undef DEFINE_CODE_STUB_BASE | 2990 #undef DEFINE_CODE_STUB_BASE |
| 2995 | 2991 |
| 2996 extern Representation RepresentationFromType(Type* type); | 2992 extern Representation RepresentationFromType(Type* type); |
| 2997 | 2993 |
| 2998 } // namespace internal | 2994 } // namespace internal |
| 2999 } // namespace v8 | 2995 } // namespace v8 |
| 3000 | 2996 |
| 3001 #endif // V8_CODE_STUBS_H_ | 2997 #endif // V8_CODE_STUBS_H_ |
| OLD | NEW |