Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(163)

Side by Side Diff: src/interpreter/interpreter.cc

Issue 2502293002: Reland of [refactoring] Split CodeAssemblerState out of CodeAssembler (Closed)
Patch Set: fix Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/interface-descriptors.h ('k') | src/interpreter/interpreter-assembler.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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( \
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 = compiler::CodeAssembler::GenerateCode(&state); \
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
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
OLDNEW
« no previous file with comments | « src/interface-descriptors.h ('k') | src/interpreter/interpreter-assembler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698