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 1975 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1986 void Interpreter::DoCreateBlockContext(InterpreterAssembler* assembler) { | 1986 void Interpreter::DoCreateBlockContext(InterpreterAssembler* assembler) { |
1987 Node* index = __ BytecodeOperandIdx(0); | 1987 Node* index = __ BytecodeOperandIdx(0); |
1988 Node* scope_info = __ LoadConstantPoolEntry(index); | 1988 Node* scope_info = __ LoadConstantPoolEntry(index); |
1989 Node* closure = __ GetAccumulator(); | 1989 Node* closure = __ GetAccumulator(); |
1990 Node* context = __ GetContext(); | 1990 Node* context = __ GetContext(); |
1991 __ SetAccumulator( | 1991 __ SetAccumulator( |
1992 __ CallRuntime(Runtime::kPushBlockContext, context, scope_info, closure)); | 1992 __ CallRuntime(Runtime::kPushBlockContext, context, scope_info, closure)); |
1993 __ Dispatch(); | 1993 __ Dispatch(); |
1994 } | 1994 } |
1995 | 1995 |
1996 // CreateCatchContext <exception> <index> | 1996 // CreateCatchContext <exception> <name_idx> <scope_info_idx> |
1997 // | 1997 // |
1998 // Creates a new context for a catch block with the |exception| in a register, | 1998 // Creates a new context for a catch block with the |exception| in a register, |
1999 // the variable name at |index| and the closure in the accumulator. | 1999 // the variable name at |name_idx|, the ScopeInfo at |scope_info_idx|, and the |
| 2000 // closure in the accumulator. |
2000 void Interpreter::DoCreateCatchContext(InterpreterAssembler* assembler) { | 2001 void Interpreter::DoCreateCatchContext(InterpreterAssembler* assembler) { |
2001 Node* exception_reg = __ BytecodeOperandReg(0); | 2002 Node* exception_reg = __ BytecodeOperandReg(0); |
2002 Node* exception = __ LoadRegister(exception_reg); | 2003 Node* exception = __ LoadRegister(exception_reg); |
2003 Node* index = __ BytecodeOperandIdx(1); | 2004 Node* name_idx = __ BytecodeOperandIdx(1); |
2004 Node* name = __ LoadConstantPoolEntry(index); | 2005 Node* name = __ LoadConstantPoolEntry(name_idx); |
| 2006 Node* scope_info_idx = __ BytecodeOperandIdx(2); |
| 2007 Node* scope_info = __ LoadConstantPoolEntry(scope_info_idx); |
2005 Node* closure = __ GetAccumulator(); | 2008 Node* closure = __ GetAccumulator(); |
2006 Node* context = __ GetContext(); | 2009 Node* context = __ GetContext(); |
2007 __ SetAccumulator(__ CallRuntime(Runtime::kPushCatchContext, context, name, | 2010 __ SetAccumulator(__ CallRuntime(Runtime::kPushCatchContext, context, name, |
2008 exception, closure)); | 2011 exception, scope_info, closure)); |
2009 __ Dispatch(); | 2012 __ Dispatch(); |
2010 } | 2013 } |
2011 | 2014 |
2012 // CreateFunctionContext <slots> | 2015 // CreateFunctionContext <slots> |
2013 // | 2016 // |
2014 // Creates a new context with number of |slots| for the function closure. | 2017 // Creates a new context with number of |slots| for the function closure. |
2015 void Interpreter::DoCreateFunctionContext(InterpreterAssembler* assembler) { | 2018 void Interpreter::DoCreateFunctionContext(InterpreterAssembler* assembler) { |
2016 Node* closure = __ LoadRegister(Register::function_closure()); | 2019 Node* closure = __ LoadRegister(Register::function_closure()); |
2017 Node* slots = __ BytecodeOperandIdx(0); | 2020 Node* slots = __ BytecodeOperandIdx(0); |
2018 Node* context = __ GetContext(); | 2021 Node* context = __ GetContext(); |
(...skipping 445 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2464 __ StoreObjectField(generator, JSGeneratorObject::kContinuationOffset, | 2467 __ StoreObjectField(generator, JSGeneratorObject::kContinuationOffset, |
2465 __ SmiTag(new_state)); | 2468 __ SmiTag(new_state)); |
2466 __ SetAccumulator(old_state); | 2469 __ SetAccumulator(old_state); |
2467 | 2470 |
2468 __ Dispatch(); | 2471 __ Dispatch(); |
2469 } | 2472 } |
2470 | 2473 |
2471 } // namespace interpreter | 2474 } // namespace interpreter |
2472 } // namespace internal | 2475 } // namespace internal |
2473 } // namespace v8 | 2476 } // namespace v8 |
OLD | NEW |