OLD | NEW |
1 // Copyright 2016 the V8 project authors. All rights reserved. | 1 // Copyright 2016 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 #include "src/code-stub-assembler.h" | 5 #include "src/code-stub-assembler.h" |
6 | 6 |
7 namespace v8 { | 7 namespace v8 { |
8 namespace internal { | 8 namespace internal { |
9 | 9 |
10 typedef compiler::Node Node; | 10 typedef compiler::Node Node; |
11 typedef compiler::CodeAssemblerState CodeAssemblerState; | 11 typedef compiler::CodeAssemblerState CodeAssemblerState; |
12 | 12 |
13 class ConstructorBuiltinsAssembler : public CodeStubAssembler { | 13 class ConstructorBuiltinsAssembler : public CodeStubAssembler { |
14 public: | 14 public: |
15 explicit ConstructorBuiltinsAssembler(CodeAssemblerState* state) | 15 explicit ConstructorBuiltinsAssembler(CodeAssemblerState* state) |
16 : CodeStubAssembler(state) {} | 16 : CodeStubAssembler(state) {} |
17 | 17 |
18 Node* EmitFastNewClosure(Node* shared_info, Node* context); | 18 Node* EmitFastNewClosure(Node* shared_info, Node* context); |
| 19 Node* EmitFastNewFunctionContext(Node* closure, Node* slots, Node* context, |
| 20 ScopeType scope_type); |
| 21 static int MaximumFunctionContextSlots(); |
| 22 |
| 23 private: |
| 24 static const int kMaximumSlots = 0x8000; |
| 25 static const int kSmallMaximumSlots = 10; |
| 26 |
| 27 // FastNewFunctionContext can only allocate closures which fit in the |
| 28 // new space. |
| 29 STATIC_ASSERT(((kMaximumSlots + Context::MIN_CONTEXT_SLOTS) * kPointerSize + |
| 30 FixedArray::kHeaderSize) < kMaxRegularHeapObjectSize); |
19 }; | 31 }; |
20 | 32 |
21 } // namespace internal | 33 } // namespace internal |
22 } // namespace v8 | 34 } // namespace v8 |
OLD | NEW |