Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1078)

Side by Side Diff: src/code-stubs.h

Issue 1609233002: Do not eagerly instantiate accessors' JSFunction. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Make GCMole happy again. Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/builtins.cc ('k') | src/crankshaft/hydrogen.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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)
1407 : PlatformCodeStub(isolate) { 1408 : PlatformCodeStub(isolate) {
1408 minor_key_ = IsStoreBits::encode(is_store) | 1409 minor_key_ = IsStoreBits::encode(is_store) |
1409 CallDataUndefinedBits::encode(call_data_undefined) | 1410 CallDataUndefinedBits::encode(call_data_undefined) |
1410 ArgumentBits::encode(is_store ? 1 : 0); 1411 ArgumentBits::encode(is_store ? 1 : 0) |
1412 IsLazyAccessorBits::encode(is_lazy);
1411 } 1413 }
1412 1414
1413 protected: 1415 protected:
1414 // For CallApiFunctionWithFixedArgsStub, see below. 1416 // For CallApiFunctionWithFixedArgsStub, see below.
1415 static const int kArgBits = 3; 1417 static const int kArgBits = 3;
1416 CallApiAccessorStub(Isolate* isolate, int argc, bool call_data_undefined) 1418 CallApiAccessorStub(Isolate* isolate, int argc, bool call_data_undefined)
1417 : PlatformCodeStub(isolate) { 1419 : PlatformCodeStub(isolate) {
1418 minor_key_ = IsStoreBits::encode(false) | 1420 minor_key_ = IsStoreBits::encode(false) |
1419 CallDataUndefinedBits::encode(call_data_undefined) | 1421 CallDataUndefinedBits::encode(call_data_undefined) |
1420 ArgumentBits::encode(argc); 1422 ArgumentBits::encode(argc);
1421 } 1423 }
1422 1424
1423 private: 1425 private:
1424 bool is_store() const { return IsStoreBits::decode(minor_key_); } 1426 bool is_store() const { return IsStoreBits::decode(minor_key_); }
1427 bool is_lazy() const { return IsLazyAccessorBits::decode(minor_key_); }
1425 bool call_data_undefined() const { 1428 bool call_data_undefined() const {
1426 return CallDataUndefinedBits::decode(minor_key_); 1429 return CallDataUndefinedBits::decode(minor_key_);
1427 } 1430 }
1428 int argc() const { return ArgumentBits::decode(minor_key_); } 1431 int argc() const { return ArgumentBits::decode(minor_key_); }
1429 1432
1430 class IsStoreBits: public BitField<bool, 0, 1> {}; 1433 class IsStoreBits: public BitField<bool, 0, 1> {};
1431 class CallDataUndefinedBits: public BitField<bool, 1, 1> {}; 1434 class CallDataUndefinedBits: public BitField<bool, 1, 1> {};
1432 class ArgumentBits : public BitField<int, 2, kArgBits> {}; 1435 class ArgumentBits : public BitField<int, 2, kArgBits> {};
1436 class IsLazyAccessorBits : public BitField<bool, 3 + kArgBits, 1> {};
1433 1437
1434 DEFINE_CALL_INTERFACE_DESCRIPTOR(ApiAccessor); 1438 DEFINE_CALL_INTERFACE_DESCRIPTOR(ApiAccessor);
1435 DEFINE_PLATFORM_CODE_STUB(CallApiAccessor, PlatformCodeStub); 1439 DEFINE_PLATFORM_CODE_STUB(CallApiAccessor, PlatformCodeStub);
1436 }; 1440 };
1437 1441
1438 1442
1439 // TODO(dcarney): see if it's possible to remove this later without performance 1443 // TODO(dcarney): see if it's possible to remove this later without performance
1440 // degradation. 1444 // degradation.
1441 // This is not a real stub, but a way of generating the CallApiAccessorStub 1445 // This is not a real stub, but a way of generating the CallApiAccessorStub
1442 // (which has the same abi) which makes it clear that it is not an accessor. 1446 // (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
2988 #undef DEFINE_HYDROGEN_CODE_STUB 2992 #undef DEFINE_HYDROGEN_CODE_STUB
2989 #undef DEFINE_CODE_STUB 2993 #undef DEFINE_CODE_STUB
2990 #undef DEFINE_CODE_STUB_BASE 2994 #undef DEFINE_CODE_STUB_BASE
2991 2995
2992 extern Representation RepresentationFromType(Type* type); 2996 extern Representation RepresentationFromType(Type* type);
2993 2997
2994 } // namespace internal 2998 } // namespace internal
2995 } // namespace v8 2999 } // namespace v8
2996 3000
2997 #endif // V8_CODE_STUBS_H_ 3001 #endif // V8_CODE_STUBS_H_
OLDNEW
« no previous file with comments | « src/builtins.cc ('k') | src/crankshaft/hydrogen.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698