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 "src/ast/prettyprinter.h" | 7 #include "src/ast/prettyprinter.h" |
8 #include "src/code-factory.h" | 8 #include "src/code-factory.h" |
9 #include "src/compiler.h" | 9 #include "src/compiler.h" |
10 #include "src/factory.h" | 10 #include "src/factory.h" |
(...skipping 12 matching lines...) Expand all Loading... |
23 | 23 |
24 #define __ assembler-> | 24 #define __ assembler-> |
25 | 25 |
26 Interpreter::Interpreter(Isolate* isolate) : isolate_(isolate) { | 26 Interpreter::Interpreter(Isolate* isolate) : isolate_(isolate) { |
27 memset(dispatch_table_, 0, sizeof(dispatch_table_)); | 27 memset(dispatch_table_, 0, sizeof(dispatch_table_)); |
28 } | 28 } |
29 | 29 |
30 void Interpreter::Initialize() { | 30 void Interpreter::Initialize() { |
31 DCHECK(FLAG_ignition); | 31 DCHECK(FLAG_ignition); |
32 if (IsDispatchTableInitialized()) return; | 32 if (IsDispatchTableInitialized()) return; |
33 Zone zone; | 33 Zone zone(isolate_->allocator()); |
34 HandleScope scope(isolate_); | 34 HandleScope scope(isolate_); |
35 | 35 |
36 // Generate bytecode handlers for all bytecodes and scales. | 36 // Generate bytecode handlers for all bytecodes and scales. |
37 for (OperandScale operand_scale = OperandScale::kSingle; | 37 for (OperandScale operand_scale = OperandScale::kSingle; |
38 operand_scale <= OperandScale::kMaxValid; | 38 operand_scale <= OperandScale::kMaxValid; |
39 operand_scale = Bytecodes::NextOperandScale(operand_scale)) { | 39 operand_scale = Bytecodes::NextOperandScale(operand_scale)) { |
40 #define GENERATE_CODE(Name, ...) \ | 40 #define GENERATE_CODE(Name, ...) \ |
41 { \ | 41 { \ |
42 if (BytecodeHasHandler(Bytecode::k##Name, operand_scale)) { \ | 42 if (BytecodeHasHandler(Bytecode::k##Name, operand_scale)) { \ |
43 InterpreterAssembler assembler(isolate_, &zone, Bytecode::k##Name, \ | 43 InterpreterAssembler assembler(isolate_, &zone, Bytecode::k##Name, \ |
(...skipping 1577 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1621 // Illegal | 1621 // Illegal |
1622 // | 1622 // |
1623 // An invalid bytecode aborting execution if dispatched. | 1623 // An invalid bytecode aborting execution if dispatched. |
1624 void Interpreter::DoIllegal(InterpreterAssembler* assembler) { | 1624 void Interpreter::DoIllegal(InterpreterAssembler* assembler) { |
1625 __ Abort(kInvalidBytecode); | 1625 __ Abort(kInvalidBytecode); |
1626 } | 1626 } |
1627 | 1627 |
1628 } // namespace interpreter | 1628 } // namespace interpreter |
1629 } // namespace internal | 1629 } // namespace internal |
1630 } // namespace v8 | 1630 } // namespace v8 |
OLD | NEW |