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

Side by Side Diff: src/interpreter/interpreter.cc

Issue 2255793002: [interpreter] Add CreateWithContext bytecode (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: add to AllBytecodesGenerated Created 4 years, 4 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
OLDNEW
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 1803 matching lines...) Expand 10 before | Expand all | Expand 10 after
1814 // Creates a new context with number of |slots| for the function closure. 1814 // Creates a new context with number of |slots| for the function closure.
1815 void Interpreter::DoCreateFunctionContext(InterpreterAssembler* assembler) { 1815 void Interpreter::DoCreateFunctionContext(InterpreterAssembler* assembler) {
1816 Node* closure = __ LoadRegister(Register::function_closure()); 1816 Node* closure = __ LoadRegister(Register::function_closure());
1817 Node* slots = __ BytecodeOperandIdx(0); 1817 Node* slots = __ BytecodeOperandIdx(0);
1818 Node* context = __ GetContext(); 1818 Node* context = __ GetContext();
1819 __ SetAccumulator( 1819 __ SetAccumulator(
1820 FastNewFunctionContextStub::Generate(assembler, closure, slots, context)); 1820 FastNewFunctionContextStub::Generate(assembler, closure, slots, context));
1821 __ Dispatch(); 1821 __ Dispatch();
1822 } 1822 }
1823 1823
1824 // CreateWithContext <register>
1825 //
1826 // Creates a new context for a with-statement with the object in |register| and
1827 // the closure in the accumulator.
1828 void Interpreter::DoCreateWithContext(InterpreterAssembler* assembler) {
1829 Node* reg_index = __ BytecodeOperandReg(0);
1830 Node* object = __ LoadRegister(reg_index);
1831 Node* closure = __ GetAccumulator();
1832 Node* context = __ GetContext();
1833 __ SetAccumulator(
1834 __ CallRuntime(Runtime::kPushWithContext, context, object, closure));
1835 __ Dispatch();
1836 }
1837
1824 // CreateMappedArguments 1838 // CreateMappedArguments
1825 // 1839 //
1826 // Creates a new mapped arguments object. 1840 // Creates a new mapped arguments object.
1827 void Interpreter::DoCreateMappedArguments(InterpreterAssembler* assembler) { 1841 void Interpreter::DoCreateMappedArguments(InterpreterAssembler* assembler) {
1828 Node* closure = __ LoadRegister(Register::function_closure()); 1842 Node* closure = __ LoadRegister(Register::function_closure());
1829 Node* context = __ GetContext(); 1843 Node* context = __ GetContext();
1830 1844
1831 Label if_duplicate_parameters(assembler, Label::kDeferred); 1845 Label if_duplicate_parameters(assembler, Label::kDeferred);
1832 Label if_not_duplicate_parameters(assembler); 1846 Label if_not_duplicate_parameters(assembler);
1833 1847
(...skipping 416 matching lines...) Expand 10 before | Expand all | Expand 10 after
2250 __ StoreObjectField(generator, JSGeneratorObject::kContinuationOffset, 2264 __ StoreObjectField(generator, JSGeneratorObject::kContinuationOffset,
2251 __ SmiTag(new_state)); 2265 __ SmiTag(new_state));
2252 __ SetAccumulator(old_state); 2266 __ SetAccumulator(old_state);
2253 2267
2254 __ Dispatch(); 2268 __ Dispatch();
2255 } 2269 }
2256 2270
2257 } // namespace interpreter 2271 } // namespace interpreter
2258 } // namespace internal 2272 } // namespace internal
2259 } // namespace v8 2273 } // namespace v8
OLDNEW
« no previous file with comments | « src/interpreter/bytecodes.h ('k') | test/cctest/interpreter/bytecode_expectations/WithStatement.golden » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698