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

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

Issue 2260473003: [interpreter] Add CreateCatchContext bytecode (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: group context bytecodes 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
« no previous file with comments | « src/interpreter/bytecodes.h ('k') | test/cctest/interpreter/bytecode_expectations/ForOf.golden » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 1791 matching lines...) Expand 10 before | Expand all | Expand 10 after
1802 void Interpreter::DoCreateBlockContext(InterpreterAssembler* assembler) { 1802 void Interpreter::DoCreateBlockContext(InterpreterAssembler* assembler) {
1803 Node* index = __ BytecodeOperandIdx(0); 1803 Node* index = __ BytecodeOperandIdx(0);
1804 Node* scope_info = __ LoadConstantPoolEntry(index); 1804 Node* scope_info = __ LoadConstantPoolEntry(index);
1805 Node* closure = __ GetAccumulator(); 1805 Node* closure = __ GetAccumulator();
1806 Node* context = __ GetContext(); 1806 Node* context = __ GetContext();
1807 __ SetAccumulator( 1807 __ SetAccumulator(
1808 __ CallRuntime(Runtime::kPushBlockContext, context, scope_info, closure)); 1808 __ CallRuntime(Runtime::kPushBlockContext, context, scope_info, closure));
1809 __ Dispatch(); 1809 __ Dispatch();
1810 } 1810 }
1811 1811
1812 // CreateCatchContext <exception> <index>
1813 //
1814 // Creates a new context for a catch block with the |exception| in a register,
1815 // the variable name at |index| and the closure in the accumulator.
1816 void Interpreter::DoCreateCatchContext(InterpreterAssembler* assembler) {
1817 Node* exception_reg = __ BytecodeOperandReg(0);
1818 Node* exception = __ LoadRegister(exception_reg);
1819 Node* index = __ BytecodeOperandIdx(1);
1820 Node* name = __ LoadConstantPoolEntry(index);
1821 Node* closure = __ GetAccumulator();
1822 Node* context = __ GetContext();
1823 __ SetAccumulator(__ CallRuntime(Runtime::kPushCatchContext, context, name,
1824 exception, closure));
1825 __ Dispatch();
1826 }
1827
1812 // CreateFunctionContext <slots> 1828 // CreateFunctionContext <slots>
1813 // 1829 //
1814 // Creates a new context with number of |slots| for the function closure. 1830 // Creates a new context with number of |slots| for the function closure.
1815 void Interpreter::DoCreateFunctionContext(InterpreterAssembler* assembler) { 1831 void Interpreter::DoCreateFunctionContext(InterpreterAssembler* assembler) {
1816 Node* closure = __ LoadRegister(Register::function_closure()); 1832 Node* closure = __ LoadRegister(Register::function_closure());
1817 Node* slots = __ BytecodeOperandIdx(0); 1833 Node* slots = __ BytecodeOperandIdx(0);
1818 Node* context = __ GetContext(); 1834 Node* context = __ GetContext();
1819 __ SetAccumulator( 1835 __ SetAccumulator(
1820 FastNewFunctionContextStub::Generate(assembler, closure, slots, context)); 1836 FastNewFunctionContextStub::Generate(assembler, closure, slots, context));
1821 __ Dispatch(); 1837 __ Dispatch();
(...skipping 442 matching lines...) Expand 10 before | Expand all | Expand 10 after
2264 __ StoreObjectField(generator, JSGeneratorObject::kContinuationOffset, 2280 __ StoreObjectField(generator, JSGeneratorObject::kContinuationOffset,
2265 __ SmiTag(new_state)); 2281 __ SmiTag(new_state));
2266 __ SetAccumulator(old_state); 2282 __ SetAccumulator(old_state);
2267 2283
2268 __ Dispatch(); 2284 __ Dispatch();
2269 } 2285 }
2270 2286
2271 } // namespace interpreter 2287 } // namespace interpreter
2272 } // namespace internal 2288 } // namespace internal
2273 } // namespace v8 2289 } // namespace v8
OLDNEW
« no previous file with comments | « src/interpreter/bytecodes.h ('k') | test/cctest/interpreter/bytecode_expectations/ForOf.golden » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698