| 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 Handle<Code> code = compiler::CodeAssembler::GenerateCode(&state); | 107 // TODO(ishell): enable verification once all issues are fixed. |
| 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); |
| 108 size_t index = GetDispatchTableIndex(bytecode, operand_scale); | 112 size_t index = GetDispatchTableIndex(bytecode, operand_scale); |
| 109 dispatch_table_[index] = code->entry(); | 113 dispatch_table_[index] = code->entry(); |
| 110 TraceCodegen(code); | 114 TraceCodegen(code); |
| 111 PROFILE(isolate_, CodeCreateEvent( | 115 PROFILE(isolate_, CodeCreateEvent( |
| 112 CodeEventListener::BYTECODE_HANDLER_TAG, | 116 CodeEventListener::BYTECODE_HANDLER_TAG, |
| 113 AbstractCode::cast(*code), | 117 AbstractCode::cast(*code), |
| 114 Bytecodes::ToString(bytecode, operand_scale).c_str())); | 118 Bytecodes::ToString(bytecode, operand_scale).c_str())); |
| 115 } | 119 } |
| 116 | 120 |
| 117 Code* Interpreter::GetBytecodeHandler(Bytecode bytecode, | 121 Code* Interpreter::GetBytecodeHandler(Bytecode bytecode, |
| (...skipping 2738 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2856 __ StoreObjectField(generator, JSGeneratorObject::kContinuationOffset, | 2860 __ StoreObjectField(generator, JSGeneratorObject::kContinuationOffset, |
| 2857 __ SmiTag(new_state)); | 2861 __ SmiTag(new_state)); |
| 2858 __ SetAccumulator(old_state); | 2862 __ SetAccumulator(old_state); |
| 2859 | 2863 |
| 2860 __ Dispatch(); | 2864 __ Dispatch(); |
| 2861 } | 2865 } |
| 2862 | 2866 |
| 2863 } // namespace interpreter | 2867 } // namespace interpreter |
| 2864 } // namespace internal | 2868 } // namespace internal |
| 2865 } // namespace v8 | 2869 } // namespace v8 |
| OLD | NEW |