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

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

Issue 2248633002: [interpreter] Add CreateBlockContext bytecode (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: comments 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 1777 matching lines...) Expand 10 before | Expand all | Expand 10 after
1788 Node* tenured_raw = __ Word32And( 1788 Node* tenured_raw = __ Word32And(
1789 flags, __ Int32Constant(CreateClosureFlags::PretenuredBit::kMask)); 1789 flags, __ Int32Constant(CreateClosureFlags::PretenuredBit::kMask));
1790 Node* tenured = __ SmiTag(tenured_raw); 1790 Node* tenured = __ SmiTag(tenured_raw);
1791 Node* result = __ CallRuntime(Runtime::kInterpreterNewClosure, context, 1791 Node* result = __ CallRuntime(Runtime::kInterpreterNewClosure, context,
1792 shared, tenured); 1792 shared, tenured);
1793 __ SetAccumulator(result); 1793 __ SetAccumulator(result);
1794 __ Dispatch(); 1794 __ Dispatch();
1795 } 1795 }
1796 } 1796 }
1797 1797
1798 // CreateBlockContext <index>
1799 //
1800 // Creates a new block context with the scope info constant at |index| and the
1801 // closure in the accumulator.
1802 void Interpreter::DoCreateBlockContext(InterpreterAssembler* assembler) {
1803 Node* index = __ BytecodeOperandIdx(0);
1804 Node* scope_info = __ LoadConstantPoolEntry(index);
1805 Node* closure = __ GetAccumulator();
1806 Node* context = __ GetContext();
1807 __ SetAccumulator(
1808 __ CallRuntime(Runtime::kPushBlockContext, context, scope_info, closure));
1809 __ Dispatch();
1810 }
1811
1798 // CreateFunctionContext <slots> 1812 // CreateFunctionContext <slots>
1799 // 1813 //
1800 // 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.
1801 void Interpreter::DoCreateFunctionContext(InterpreterAssembler* assembler) { 1815 void Interpreter::DoCreateFunctionContext(InterpreterAssembler* assembler) {
1802 Node* closure = __ LoadRegister(Register::function_closure()); 1816 Node* closure = __ LoadRegister(Register::function_closure());
1803 Node* slots = __ BytecodeOperandIdx(0); 1817 Node* slots = __ BytecodeOperandIdx(0);
1804 Node* context = __ GetContext(); 1818 Node* context = __ GetContext();
1805 __ SetAccumulator( 1819 __ SetAccumulator(
1806 FastNewFunctionContextStub::Generate(assembler, closure, slots, context)); 1820 FastNewFunctionContextStub::Generate(assembler, closure, slots, context));
1807 __ Dispatch(); 1821 __ Dispatch();
(...skipping 428 matching lines...) Expand 10 before | Expand all | Expand 10 after
2236 __ StoreObjectField(generator, JSGeneratorObject::kContinuationOffset, 2250 __ StoreObjectField(generator, JSGeneratorObject::kContinuationOffset,
2237 __ SmiTag(new_state)); 2251 __ SmiTag(new_state));
2238 __ SetAccumulator(old_state); 2252 __ SetAccumulator(old_state);
2239 2253
2240 __ Dispatch(); 2254 __ Dispatch();
2241 } 2255 }
2242 2256
2243 } // namespace interpreter 2257 } // namespace interpreter
2244 } // namespace internal 2258 } // namespace internal
2245 } // namespace v8 2259 } // namespace v8
OLDNEW
« no previous file with comments | « src/interpreter/bytecodes.h ('k') | test/cctest/interpreter/bytecode_expectations/BasicLoops.golden » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698