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 | 8 |
9 #include "src/ast/prettyprinter.h" | 9 #include "src/ast/prettyprinter.h" |
10 #include "src/code-factory.h" | 10 #include "src/code-factory.h" |
(...skipping 44 matching lines...) Loading... |
55 #define GENERATE_CODE(Name, ...) \ | 55 #define GENERATE_CODE(Name, ...) \ |
56 { \ | 56 { \ |
57 if (Bytecodes::BytecodeHasHandler(Bytecode::k##Name, operand_scale)) { \ | 57 if (Bytecodes::BytecodeHasHandler(Bytecode::k##Name, operand_scale)) { \ |
58 InterpreterAssembler assembler(isolate_, &zone, Bytecode::k##Name, \ | 58 InterpreterAssembler assembler(isolate_, &zone, Bytecode::k##Name, \ |
59 operand_scale); \ | 59 operand_scale); \ |
60 Do##Name(&assembler); \ | 60 Do##Name(&assembler); \ |
61 Handle<Code> code = assembler.GenerateCode(); \ | 61 Handle<Code> code = assembler.GenerateCode(); \ |
62 size_t index = GetDispatchTableIndex(Bytecode::k##Name, operand_scale); \ | 62 size_t index = GetDispatchTableIndex(Bytecode::k##Name, operand_scale); \ |
63 dispatch_table_[index] = code->entry(); \ | 63 dispatch_table_[index] = code->entry(); \ |
64 TraceCodegen(code); \ | 64 TraceCodegen(code); \ |
65 LOG_CODE_EVENT( \ | 65 PROFILE( \ |
66 isolate_, \ | 66 isolate_, \ |
67 CodeCreateEvent( \ | 67 CodeCreateEvent( \ |
68 Logger::BYTECODE_HANDLER_TAG, AbstractCode::cast(*code), \ | 68 CodeEventListener::BYTECODE_HANDLER_TAG, \ |
| 69 AbstractCode::cast(*code), \ |
69 Bytecodes::ToString(Bytecode::k##Name, operand_scale).c_str())); \ | 70 Bytecodes::ToString(Bytecode::k##Name, operand_scale).c_str())); \ |
70 } \ | 71 } \ |
71 } | 72 } |
72 BYTECODE_LIST(GENERATE_CODE) | 73 BYTECODE_LIST(GENERATE_CODE) |
73 #undef GENERATE_CODE | 74 #undef GENERATE_CODE |
74 } | 75 } |
75 | 76 |
76 // Fill unused entries will the illegal bytecode handler. | 77 // Fill unused entries will the illegal bytecode handler. |
77 size_t illegal_index = | 78 size_t illegal_index = |
78 GetDispatchTableIndex(Bytecode::kIllegal, OperandScale::kSingle); | 79 GetDispatchTableIndex(Bytecode::kIllegal, OperandScale::kSingle); |
(...skipping 1743 matching lines...) Loading... |
1822 __ StoreObjectField(generator, JSGeneratorObject::kContinuationOffset, | 1823 __ StoreObjectField(generator, JSGeneratorObject::kContinuationOffset, |
1823 __ SmiTag(new_state)); | 1824 __ SmiTag(new_state)); |
1824 __ SetAccumulator(old_state); | 1825 __ SetAccumulator(old_state); |
1825 | 1826 |
1826 __ Dispatch(); | 1827 __ Dispatch(); |
1827 } | 1828 } |
1828 | 1829 |
1829 } // namespace interpreter | 1830 } // namespace interpreter |
1830 } // namespace internal | 1831 } // namespace internal |
1831 } // namespace v8 | 1832 } // namespace v8 |
OLD | NEW |