Chromium Code Reviews| 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 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 69 const OperandScale kOperandScales[] = { | 69 const OperandScale kOperandScales[] = { |
| 70 #define VALUE(Name, _) OperandScale::k##Name, | 70 #define VALUE(Name, _) OperandScale::k##Name, |
| 71 OPERAND_SCALE_LIST(VALUE) | 71 OPERAND_SCALE_LIST(VALUE) |
| 72 #undef VALUE | 72 #undef VALUE |
| 73 }; | 73 }; |
| 74 | 74 |
| 75 for (OperandScale operand_scale : kOperandScales) { | 75 for (OperandScale operand_scale : kOperandScales) { |
| 76 #define GENERATE_CODE(Name, ...) \ | 76 #define GENERATE_CODE(Name, ...) \ |
| 77 { \ | 77 { \ |
| 78 if (Bytecodes::BytecodeHasHandler(Bytecode::k##Name, operand_scale)) { \ | 78 if (Bytecodes::BytecodeHasHandler(Bytecode::k##Name, operand_scale)) { \ |
| 79 InterpreterAssembler assembler(isolate_, &zone, Bytecode::k##Name, \ | 79 InterpreterDispatchDescriptor descriptor(isolate_); \ |
| 80 compiler::CodeAssemblerState state( \ | |
|
Michael Starzinger
2016/11/15 11:53:08
Actually, come to think of it, we could use the sa
Igor Sheludko
2016/11/15 13:06:35
Then we will be passing a pointer to not yet const
Jakob Kummerow
2016/11/15 13:40:32
For now that would work; but our plans for further
| |
| 81 isolate_, &zone, descriptor, \ | |
| 82 Code::ComputeFlags(Code::BYTECODE_HANDLER), \ | |
| 83 Bytecodes::ToString(Bytecode::k##Name), \ | |
| 84 Bytecodes::ReturnCount(Bytecode::k##Name)); \ | |
| 85 InterpreterAssembler assembler(&state, Bytecode::k##Name, \ | |
| 80 operand_scale); \ | 86 operand_scale); \ |
| 81 Do##Name(&assembler); \ | 87 Do##Name(&assembler); \ |
| 82 Handle<Code> code = assembler.GenerateCode(); \ | 88 Handle<Code> code = state.GenerateCode(); \ |
| 83 size_t index = GetDispatchTableIndex(Bytecode::k##Name, operand_scale); \ | 89 size_t index = GetDispatchTableIndex(Bytecode::k##Name, operand_scale); \ |
| 84 dispatch_table_[index] = code->entry(); \ | 90 dispatch_table_[index] = code->entry(); \ |
| 85 TraceCodegen(code); \ | 91 TraceCodegen(code); \ |
| 86 PROFILE( \ | 92 PROFILE( \ |
| 87 isolate_, \ | 93 isolate_, \ |
| 88 CodeCreateEvent( \ | 94 CodeCreateEvent( \ |
| 89 CodeEventListener::BYTECODE_HANDLER_TAG, \ | 95 CodeEventListener::BYTECODE_HANDLER_TAG, \ |
| 90 AbstractCode::cast(*code), \ | 96 AbstractCode::cast(*code), \ |
| 91 Bytecodes::ToString(Bytecode::k##Name, operand_scale).c_str())); \ | 97 Bytecodes::ToString(Bytecode::k##Name, operand_scale).c_str())); \ |
| 92 } \ | 98 } \ |
| (...skipping 2590 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2683 __ StoreObjectField(generator, JSGeneratorObject::kContinuationOffset, | 2689 __ StoreObjectField(generator, JSGeneratorObject::kContinuationOffset, |
| 2684 __ SmiTag(new_state)); | 2690 __ SmiTag(new_state)); |
| 2685 __ SetAccumulator(old_state); | 2691 __ SetAccumulator(old_state); |
| 2686 | 2692 |
| 2687 __ Dispatch(); | 2693 __ Dispatch(); |
| 2688 } | 2694 } |
| 2689 | 2695 |
| 2690 } // namespace interpreter | 2696 } // namespace interpreter |
| 2691 } // namespace internal | 2697 } // namespace internal |
| 2692 } // namespace v8 | 2698 } // namespace v8 |
| OLD | NEW |