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 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 OperandScale operand_scale, | 97 OperandScale operand_scale, |
98 BytecodeGeneratorFunc generator) { | 98 BytecodeGeneratorFunc generator) { |
99 if (!Bytecodes::BytecodeHasHandler(bytecode, operand_scale)) return; | 99 if (!Bytecodes::BytecodeHasHandler(bytecode, operand_scale)) return; |
100 | 100 |
101 InterpreterDispatchDescriptor descriptor(isolate_); | 101 InterpreterDispatchDescriptor descriptor(isolate_); |
102 compiler::CodeAssemblerState state( | 102 compiler::CodeAssemblerState state( |
103 isolate_, zone, descriptor, Code::ComputeFlags(Code::BYTECODE_HANDLER), | 103 isolate_, zone, descriptor, Code::ComputeFlags(Code::BYTECODE_HANDLER), |
104 Bytecodes::ToString(bytecode), Bytecodes::ReturnCount(bytecode)); | 104 Bytecodes::ToString(bytecode), Bytecodes::ReturnCount(bytecode)); |
105 InterpreterAssembler assembler(&state, bytecode, operand_scale); | 105 InterpreterAssembler assembler(&state, bytecode, operand_scale); |
106 (this->*generator)(&assembler); | 106 (this->*generator)(&assembler); |
107 // TODO(ishell): enable verification once all issues are fixed. | 107 Handle<Code> code = compiler::CodeAssembler::GenerateCode(&state); |
108 // Enable verification only in mksnapshot. | |
109 bool verify_graph = FLAG_csa_verify && FLAG_startup_blob != nullptr; | |
110 Handle<Code> code = | |
111 compiler::CodeAssembler::GenerateCode(&state, verify_graph); | |
112 size_t index = GetDispatchTableIndex(bytecode, operand_scale); | 108 size_t index = GetDispatchTableIndex(bytecode, operand_scale); |
113 dispatch_table_[index] = code->entry(); | 109 dispatch_table_[index] = code->entry(); |
114 TraceCodegen(code); | 110 TraceCodegen(code); |
115 PROFILE(isolate_, CodeCreateEvent( | 111 PROFILE(isolate_, CodeCreateEvent( |
116 CodeEventListener::BYTECODE_HANDLER_TAG, | 112 CodeEventListener::BYTECODE_HANDLER_TAG, |
117 AbstractCode::cast(*code), | 113 AbstractCode::cast(*code), |
118 Bytecodes::ToString(bytecode, operand_scale).c_str())); | 114 Bytecodes::ToString(bytecode, operand_scale).c_str())); |
119 } | 115 } |
120 | 116 |
121 Code* Interpreter::GetBytecodeHandler(Bytecode bytecode, | 117 Code* Interpreter::GetBytecodeHandler(Bytecode bytecode, |
(...skipping 2738 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2860 __ StoreObjectField(generator, JSGeneratorObject::kContinuationOffset, | 2856 __ StoreObjectField(generator, JSGeneratorObject::kContinuationOffset, |
2861 __ SmiTag(new_state)); | 2857 __ SmiTag(new_state)); |
2862 __ SetAccumulator(old_state); | 2858 __ SetAccumulator(old_state); |
2863 | 2859 |
2864 __ Dispatch(); | 2860 __ Dispatch(); |
2865 } | 2861 } |
2866 | 2862 |
2867 } // namespace interpreter | 2863 } // namespace interpreter |
2868 } // namespace internal | 2864 } // namespace internal |
2869 } // namespace v8 | 2865 } // namespace v8 |
OLD | NEW |