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

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

Issue 2435023002: Use a different map to distinguish eval contexts (Closed)
Patch Set: Changes based on review commnets Created 4 years 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
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 794 matching lines...) Expand 10 before | Expand all | Expand 10 after
805 static compiler::Node* Generate(CodeStubAssembler* assembler, 805 static compiler::Node* Generate(CodeStubAssembler* assembler,
806 compiler::Node* shared_info, 806 compiler::Node* shared_info,
807 compiler::Node* context); 807 compiler::Node* context);
808 808
809 DEFINE_CALL_INTERFACE_DESCRIPTOR(FastNewClosure); 809 DEFINE_CALL_INTERFACE_DESCRIPTOR(FastNewClosure);
810 DEFINE_TURBOFAN_CODE_STUB(FastNewClosure, TurboFanCodeStub); 810 DEFINE_TURBOFAN_CODE_STUB(FastNewClosure, TurboFanCodeStub);
811 }; 811 };
812 812
813 class FastNewFunctionContextStub final : public TurboFanCodeStub { 813 class FastNewFunctionContextStub final : public TurboFanCodeStub {
814 public: 814 public:
815 static const int kMaximumSlots = 0x8000; 815 static int MaximumSlots();
816 816
817 explicit FastNewFunctionContextStub(Isolate* isolate) 817 explicit FastNewFunctionContextStub(Isolate* isolate, ScopeType scope_type)
818 : TurboFanCodeStub(isolate) {} 818 : TurboFanCodeStub(isolate) {
819 minor_key_ = ScopeTypeBits::encode(scope_type);
820 }
819 821
820 static compiler::Node* Generate(CodeStubAssembler* assembler, 822 static compiler::Node* Generate(CodeStubAssembler* assembler,
821 compiler::Node* function, 823 compiler::Node* function,
822 compiler::Node* slots, 824 compiler::Node* slots,
823 compiler::Node* context); 825 compiler::Node* context,
826 ScopeType scope_type);
827
828 ScopeType scope_type() const {
829 return static_cast<ScopeType>(ScopeTypeBits::decode(minor_key_));
830 }
824 831
825 private: 832 private:
833 static const int kMaximumSlots = 0x8000;
834 static const int kSmallMaximumSlots = 10;
835
826 // FastNewFunctionContextStub can only allocate closures which fit in the 836 // FastNewFunctionContextStub can only allocate closures which fit in the
827 // new space. 837 // new space.
828 STATIC_ASSERT(((kMaximumSlots + Context::MIN_CONTEXT_SLOTS) * kPointerSize + 838 STATIC_ASSERT(((kMaximumSlots + Context::MIN_CONTEXT_SLOTS) * kPointerSize +
829 FixedArray::kHeaderSize) < kMaxRegularHeapObjectSize); 839 FixedArray::kHeaderSize) < kMaxRegularHeapObjectSize);
830 840
831 DEFINE_CALL_INTERFACE_DESCRIPTOR(FastNewFunctionContext); 841 DEFINE_CALL_INTERFACE_DESCRIPTOR(FastNewFunctionContext);
832 DEFINE_TURBOFAN_CODE_STUB(FastNewFunctionContext, TurboFanCodeStub); 842 DEFINE_TURBOFAN_CODE_STUB(FastNewFunctionContext, TurboFanCodeStub);
843
844 class ScopeTypeBits : public BitField<bool, 0, 8> {};
Michael Starzinger 2016/12/15 09:42:59 nit: Can we move this up three lines, so that the
Dan Ehrenberg 2016/12/15 23:51:50 Done.
833 }; 845 };
834 846
835
836 class FastNewObjectStub final : public PlatformCodeStub { 847 class FastNewObjectStub final : public PlatformCodeStub {
837 public: 848 public:
838 explicit FastNewObjectStub(Isolate* isolate) : PlatformCodeStub(isolate) {} 849 explicit FastNewObjectStub(Isolate* isolate) : PlatformCodeStub(isolate) {}
839 850
840 DEFINE_CALL_INTERFACE_DESCRIPTOR(FastNewObject); 851 DEFINE_CALL_INTERFACE_DESCRIPTOR(FastNewObject);
841 DEFINE_PLATFORM_CODE_STUB(FastNewObject, PlatformCodeStub); 852 DEFINE_PLATFORM_CODE_STUB(FastNewObject, PlatformCodeStub);
842 }; 853 };
843 854
844 855
845 // TODO(turbofan): This stub should be possible to write in TurboFan 856 // TODO(turbofan): This stub should be possible to write in TurboFan
(...skipping 1797 matching lines...) Expand 10 before | Expand all | Expand 10 after
2643 #undef DEFINE_PLATFORM_CODE_STUB 2654 #undef DEFINE_PLATFORM_CODE_STUB
2644 #undef DEFINE_HANDLER_CODE_STUB 2655 #undef DEFINE_HANDLER_CODE_STUB
2645 #undef DEFINE_HYDROGEN_CODE_STUB 2656 #undef DEFINE_HYDROGEN_CODE_STUB
2646 #undef DEFINE_CODE_STUB 2657 #undef DEFINE_CODE_STUB
2647 #undef DEFINE_CODE_STUB_BASE 2658 #undef DEFINE_CODE_STUB_BASE
2648 2659
2649 } // namespace internal 2660 } // namespace internal
2650 } // namespace v8 2661 } // namespace v8
2651 2662
2652 #endif // V8_CODE_STUBS_H_ 2663 #endif // V8_CODE_STUBS_H_
OLDNEW
« no previous file with comments | « src/code-factory.cc ('k') | src/code-stubs.cc » ('j') | src/debug/debug-scopes.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698