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

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

Issue 2504913002: Revert of [refactoring] Split CodeAssemblerState out of CodeAssembler (Closed)
Patch Set: 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 InterpreterDispatchDescriptor descriptor(isolate_); \ 79 InterpreterAssembler assembler(isolate_, &zone, Bytecode::k##Name, \
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, \
86 operand_scale); \ 80 operand_scale); \
87 Do##Name(&assembler); \ 81 Do##Name(&assembler); \
88 Handle<Code> code = compiler::CodeAssembler::GenerateCode(&state); \ 82 Handle<Code> code = assembler.GenerateCode(); \
89 size_t index = GetDispatchTableIndex(Bytecode::k##Name, operand_scale); \ 83 size_t index = GetDispatchTableIndex(Bytecode::k##Name, operand_scale); \
90 dispatch_table_[index] = code->entry(); \ 84 dispatch_table_[index] = code->entry(); \
91 TraceCodegen(code); \ 85 TraceCodegen(code); \
92 PROFILE( \ 86 PROFILE( \
93 isolate_, \ 87 isolate_, \
94 CodeCreateEvent( \ 88 CodeCreateEvent( \
95 CodeEventListener::BYTECODE_HANDLER_TAG, \ 89 CodeEventListener::BYTECODE_HANDLER_TAG, \
96 AbstractCode::cast(*code), \ 90 AbstractCode::cast(*code), \
97 Bytecodes::ToString(Bytecode::k##Name, operand_scale).c_str())); \ 91 Bytecodes::ToString(Bytecode::k##Name, operand_scale).c_str())); \
98 } \ 92 } \
(...skipping 2590 matching lines...) Expand 10 before | Expand all | Expand 10 after
2689 __ StoreObjectField(generator, JSGeneratorObject::kContinuationOffset, 2683 __ StoreObjectField(generator, JSGeneratorObject::kContinuationOffset,
2690 __ SmiTag(new_state)); 2684 __ SmiTag(new_state));
2691 __ SetAccumulator(old_state); 2685 __ SetAccumulator(old_state);
2692 2686
2693 __ Dispatch(); 2687 __ Dispatch();
2694 } 2688 }
2695 2689
2696 } // namespace interpreter 2690 } // namespace interpreter
2697 } // namespace internal 2691 } // namespace internal
2698 } // namespace v8 2692 } // 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