OLD | NEW |
1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 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/interpreter/interpreter.h" | 5 #include "src/interpreter/interpreter.h" |
6 | 6 |
7 #include <fstream> | 7 #include <fstream> |
8 #include <memory> | 8 #include <memory> |
9 | 9 |
10 #include "src/ast/prettyprinter.h" | 10 #include "src/ast/prettyprinter.h" |
(...skipping 1699 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1710 Node* tenured_raw = __ Word32And( | 1710 Node* tenured_raw = __ Word32And( |
1711 flags, __ Int32Constant(CreateClosureFlags::PretenuredBit::kMask)); | 1711 flags, __ Int32Constant(CreateClosureFlags::PretenuredBit::kMask)); |
1712 Node* tenured = __ SmiTag(tenured_raw); | 1712 Node* tenured = __ SmiTag(tenured_raw); |
1713 Node* result = __ CallRuntime(Runtime::kInterpreterNewClosure, context, | 1713 Node* result = __ CallRuntime(Runtime::kInterpreterNewClosure, context, |
1714 shared, tenured); | 1714 shared, tenured); |
1715 __ SetAccumulator(result); | 1715 __ SetAccumulator(result); |
1716 __ Dispatch(); | 1716 __ Dispatch(); |
1717 } | 1717 } |
1718 } | 1718 } |
1719 | 1719 |
| 1720 // CreateContext |
| 1721 // |
| 1722 // Creates a new context for the function closure in the accumulator. |
| 1723 void Interpreter::DoCreateFunctionContext(InterpreterAssembler* assembler) { |
| 1724 Node* closure = __ LoadRegister(Register::function_closure()); |
| 1725 Node* slots = __ BytecodeOperandImm(0); |
| 1726 Node* context = __ GetContext(); |
| 1727 __ SetAccumulator( |
| 1728 FastNewFunctionContextStub::Generate(assembler, closure, slots, context)); |
| 1729 __ Dispatch(); |
| 1730 } |
| 1731 |
1720 // CreateMappedArguments | 1732 // CreateMappedArguments |
1721 // | 1733 // |
1722 // Creates a new mapped arguments object. | 1734 // Creates a new mapped arguments object. |
1723 void Interpreter::DoCreateMappedArguments(InterpreterAssembler* assembler) { | 1735 void Interpreter::DoCreateMappedArguments(InterpreterAssembler* assembler) { |
1724 Node* closure = __ LoadRegister(Register::function_closure()); | 1736 Node* closure = __ LoadRegister(Register::function_closure()); |
1725 Node* context = __ GetContext(); | 1737 Node* context = __ GetContext(); |
1726 | 1738 |
1727 Label if_duplicate_parameters(assembler, Label::kDeferred); | 1739 Label if_duplicate_parameters(assembler, Label::kDeferred); |
1728 Label if_not_duplicate_parameters(assembler); | 1740 Label if_not_duplicate_parameters(assembler); |
1729 | 1741 |
(...skipping 438 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2168 __ StoreObjectField(generator, JSGeneratorObject::kContinuationOffset, | 2180 __ StoreObjectField(generator, JSGeneratorObject::kContinuationOffset, |
2169 __ SmiTag(new_state)); | 2181 __ SmiTag(new_state)); |
2170 __ SetAccumulator(old_state); | 2182 __ SetAccumulator(old_state); |
2171 | 2183 |
2172 __ Dispatch(); | 2184 __ Dispatch(); |
2173 } | 2185 } |
2174 | 2186 |
2175 } // namespace interpreter | 2187 } // namespace interpreter |
2176 } // namespace internal | 2188 } // namespace internal |
2177 } // namespace v8 | 2189 } // namespace v8 |
OLD | NEW |