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