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 "src/compiler.h" | 7 #include "src/compiler.h" |
| 8 #include "src/compiler/interpreter-assembler.h" | 8 #include "src/compiler/interpreter-assembler.h" |
| 9 #include "src/factory.h" | 9 #include "src/factory.h" |
| 10 #include "src/interpreter/bytecodes.h" | 10 #include "src/interpreter/bytecodes.h" |
| (...skipping 25 matching lines...) Expand all Loading... | |
| 36 Do##Name(&assembler); \ | 36 Do##Name(&assembler); \ |
| 37 handler_table->set(static_cast<int>(Bytecode::k##Name), \ | 37 handler_table->set(static_cast<int>(Bytecode::k##Name), \ |
| 38 *assembler.GenerateCode()); \ | 38 *assembler.GenerateCode()); \ |
| 39 } | 39 } |
| 40 BYTECODE_LIST(GENERATE_CODE) | 40 BYTECODE_LIST(GENERATE_CODE) |
| 41 #undef GENERATE_CODE | 41 #undef GENERATE_CODE |
| 42 } | 42 } |
| 43 } | 43 } |
| 44 | 44 |
| 45 | 45 |
| 46 // Load literal '0' into the register index specified by the bytecode's | |
| 47 // argument. | |
|
rmcilroy
2015/07/16 10:29:44
Did you mean to drop this comment?
oth
2015/07/16 13:14:39
Nope. Fixed.
| |
| 48 void Interpreter::DoLoadLiteral0(compiler::InterpreterAssembler* assembler) { | 46 void Interpreter::DoLoadLiteral0(compiler::InterpreterAssembler* assembler) { |
| 49 Node* register_index = __ BytecodeArg(0); | 47 Node* register_index = __ BytecodeArg(0); |
| 50 __ StoreRegister(__ NumberConstant(0), register_index); | 48 __ StoreRegister(__ NumberConstant(0), register_index); |
| 51 __ Dispatch(); | 49 __ Dispatch(); |
| 52 } | 50 } |
| 53 | 51 |
| 54 | 52 |
| 55 // Return the value in register 0. | 53 // Return the value in register 0. |
| 56 void Interpreter::DoReturn(compiler::InterpreterAssembler* assembler) { | 54 void Interpreter::DoReturn(compiler::InterpreterAssembler* assembler) { |
| 57 __ Return(__ LoadRegister(0)); | 55 __ Return(__ LoadRegister(0)); |
| 58 } | 56 } |
| 59 | 57 |
| 60 | 58 |
| 61 } // namespace interpreter | 59 } // namespace interpreter |
| 62 } // namespace internal | 60 } // namespace internal |
| 63 } // namespace v8 | 61 } // namespace v8 |
| OLD | NEW |