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/code-stub-assembler.h" | 10 #include "src/code-stub-assembler.h" |
(...skipping 845 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
856 static compiler::Node* Generate(CodeStubAssembler* assembler, | 856 static compiler::Node* Generate(CodeStubAssembler* assembler, |
857 compiler::Node* shared_info, | 857 compiler::Node* shared_info, |
858 compiler::Node* context); | 858 compiler::Node* context); |
859 | 859 |
860 DEFINE_CALL_INTERFACE_DESCRIPTOR(FastNewClosure); | 860 DEFINE_CALL_INTERFACE_DESCRIPTOR(FastNewClosure); |
861 DEFINE_TURBOFAN_CODE_STUB(FastNewClosure, TurboFanCodeStub); | 861 DEFINE_TURBOFAN_CODE_STUB(FastNewClosure, TurboFanCodeStub); |
862 }; | 862 }; |
863 | 863 |
864 class FastNewFunctionContextStub final : public TurboFanCodeStub { | 864 class FastNewFunctionContextStub final : public TurboFanCodeStub { |
865 public: | 865 public: |
| 866 static const int kMaximumSlots = 0x8000; |
| 867 |
866 explicit FastNewFunctionContextStub(Isolate* isolate) | 868 explicit FastNewFunctionContextStub(Isolate* isolate) |
867 : TurboFanCodeStub(isolate) {} | 869 : TurboFanCodeStub(isolate) {} |
868 | 870 |
869 static compiler::Node* Generate(CodeStubAssembler* assembler, | 871 static compiler::Node* Generate(CodeStubAssembler* assembler, |
870 compiler::Node* function, | 872 compiler::Node* function, |
871 compiler::Node* slots, | 873 compiler::Node* slots, |
872 compiler::Node* context); | 874 compiler::Node* context); |
873 | 875 |
874 private: | 876 private: |
| 877 // FastNewFunctionContextStub can only allocate closures which fit in the |
| 878 // new space. |
| 879 STATIC_ASSERT(((kMaximumSlots + Context::MIN_CONTEXT_SLOTS) * kPointerSize + |
| 880 FixedArray::kHeaderSize) < kMaxRegularHeapObjectSize); |
| 881 |
875 DEFINE_CALL_INTERFACE_DESCRIPTOR(FastNewFunctionContext); | 882 DEFINE_CALL_INTERFACE_DESCRIPTOR(FastNewFunctionContext); |
876 DEFINE_TURBOFAN_CODE_STUB(FastNewFunctionContext, TurboFanCodeStub); | 883 DEFINE_TURBOFAN_CODE_STUB(FastNewFunctionContext, TurboFanCodeStub); |
877 }; | 884 }; |
878 | 885 |
879 | 886 |
880 class FastNewObjectStub final : public PlatformCodeStub { | 887 class FastNewObjectStub final : public PlatformCodeStub { |
881 public: | 888 public: |
882 explicit FastNewObjectStub(Isolate* isolate) : PlatformCodeStub(isolate) {} | 889 explicit FastNewObjectStub(Isolate* isolate) : PlatformCodeStub(isolate) {} |
883 | 890 |
884 DEFINE_CALL_INTERFACE_DESCRIPTOR(FastNewObject); | 891 DEFINE_CALL_INTERFACE_DESCRIPTOR(FastNewObject); |
(...skipping 1887 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2772 #undef DEFINE_HYDROGEN_CODE_STUB | 2779 #undef DEFINE_HYDROGEN_CODE_STUB |
2773 #undef DEFINE_CODE_STUB | 2780 #undef DEFINE_CODE_STUB |
2774 #undef DEFINE_CODE_STUB_BASE | 2781 #undef DEFINE_CODE_STUB_BASE |
2775 | 2782 |
2776 extern Representation RepresentationFromMachineType(MachineType type); | 2783 extern Representation RepresentationFromMachineType(MachineType type); |
2777 | 2784 |
2778 } // namespace internal | 2785 } // namespace internal |
2779 } // namespace v8 | 2786 } // namespace v8 |
2780 | 2787 |
2781 #endif // V8_CODE_STUBS_H_ | 2788 #endif // V8_CODE_STUBS_H_ |
OLD | NEW |