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