| 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/bytecode-generator.h" | 10 #include "src/interpreter/bytecode-generator.h" |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 Node* constant = __ LoadConstantPoolEntry(index); | 114 Node* constant = __ LoadConstantPoolEntry(index); |
| 115 __ SetAccumulator(constant); | 115 __ SetAccumulator(constant); |
| 116 __ Dispatch(); | 116 __ Dispatch(); |
| 117 } | 117 } |
| 118 | 118 |
| 119 | 119 |
| 120 // LdaUndefined | 120 // LdaUndefined |
| 121 // | 121 // |
| 122 // Load Undefined into the accumulator. | 122 // Load Undefined into the accumulator. |
| 123 void Interpreter::DoLdaUndefined(compiler::InterpreterAssembler* assembler) { | 123 void Interpreter::DoLdaUndefined(compiler::InterpreterAssembler* assembler) { |
| 124 Node* undefined_value = __ HeapConstant(Unique<HeapObject>::CreateImmovable( | 124 Node* undefined_value = |
| 125 isolate_->factory()->undefined_value())); | 125 __ HeapConstant(isolate_->factory()->undefined_value()); |
| 126 __ SetAccumulator(undefined_value); | 126 __ SetAccumulator(undefined_value); |
| 127 __ Dispatch(); | 127 __ Dispatch(); |
| 128 } | 128 } |
| 129 | 129 |
| 130 | 130 |
| 131 // LdaNull | 131 // LdaNull |
| 132 // | 132 // |
| 133 // Load Null into the accumulator. | 133 // Load Null into the accumulator. |
| 134 void Interpreter::DoLdaNull(compiler::InterpreterAssembler* assembler) { | 134 void Interpreter::DoLdaNull(compiler::InterpreterAssembler* assembler) { |
| 135 Node* null_value = __ HeapConstant( | 135 Node* null_value = __ HeapConstant(isolate_->factory()->null_value()); |
| 136 Unique<HeapObject>::CreateImmovable(isolate_->factory()->null_value())); | |
| 137 __ SetAccumulator(null_value); | 136 __ SetAccumulator(null_value); |
| 138 __ Dispatch(); | 137 __ Dispatch(); |
| 139 } | 138 } |
| 140 | 139 |
| 141 | 140 |
| 142 // LdaTheHole | 141 // LdaTheHole |
| 143 // | 142 // |
| 144 // Load TheHole into the accumulator. | 143 // Load TheHole into the accumulator. |
| 145 void Interpreter::DoLdaTheHole(compiler::InterpreterAssembler* assembler) { | 144 void Interpreter::DoLdaTheHole(compiler::InterpreterAssembler* assembler) { |
| 146 Node* the_hole_value = __ HeapConstant(Unique<HeapObject>::CreateImmovable( | 145 Node* the_hole_value = __ HeapConstant(isolate_->factory()->the_hole_value()); |
| 147 isolate_->factory()->the_hole_value())); | |
| 148 __ SetAccumulator(the_hole_value); | 146 __ SetAccumulator(the_hole_value); |
| 149 __ Dispatch(); | 147 __ Dispatch(); |
| 150 } | 148 } |
| 151 | 149 |
| 152 | 150 |
| 153 // LdaTrue | 151 // LdaTrue |
| 154 // | 152 // |
| 155 // Load True into the accumulator. | 153 // Load True into the accumulator. |
| 156 void Interpreter::DoLdaTrue(compiler::InterpreterAssembler* assembler) { | 154 void Interpreter::DoLdaTrue(compiler::InterpreterAssembler* assembler) { |
| 157 Node* true_value = __ HeapConstant( | 155 Node* true_value = __ HeapConstant(isolate_->factory()->true_value()); |
| 158 Unique<HeapObject>::CreateImmovable(isolate_->factory()->true_value())); | |
| 159 __ SetAccumulator(true_value); | 156 __ SetAccumulator(true_value); |
| 160 __ Dispatch(); | 157 __ Dispatch(); |
| 161 } | 158 } |
| 162 | 159 |
| 163 | 160 |
| 164 // LdaFalse | 161 // LdaFalse |
| 165 // | 162 // |
| 166 // Load False into the accumulator. | 163 // Load False into the accumulator. |
| 167 void Interpreter::DoLdaFalse(compiler::InterpreterAssembler* assembler) { | 164 void Interpreter::DoLdaFalse(compiler::InterpreterAssembler* assembler) { |
| 168 Node* false_value = __ HeapConstant( | 165 Node* false_value = __ HeapConstant(isolate_->factory()->false_value()); |
| 169 Unique<HeapObject>::CreateImmovable(isolate_->factory()->false_value())); | |
| 170 __ SetAccumulator(false_value); | 166 __ SetAccumulator(false_value); |
| 171 __ Dispatch(); | 167 __ Dispatch(); |
| 172 } | 168 } |
| 173 | 169 |
| 174 | 170 |
| 175 // Ldar <src> | 171 // Ldar <src> |
| 176 // | 172 // |
| 177 // Load accumulator with value from register <src>. | 173 // Load accumulator with value from register <src>. |
| 178 void Interpreter::DoLdar(compiler::InterpreterAssembler* assembler) { | 174 void Interpreter::DoLdar(compiler::InterpreterAssembler* assembler) { |
| 179 Node* reg_index = __ BytecodeOperandReg(0); | 175 Node* reg_index = __ BytecodeOperandReg(0); |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 251 // | 247 // |
| 252 // Return the value in register 0. | 248 // Return the value in register 0. |
| 253 void Interpreter::DoReturn(compiler::InterpreterAssembler* assembler) { | 249 void Interpreter::DoReturn(compiler::InterpreterAssembler* assembler) { |
| 254 __ Return(); | 250 __ Return(); |
| 255 } | 251 } |
| 256 | 252 |
| 257 | 253 |
| 258 } // namespace interpreter | 254 } // namespace interpreter |
| 259 } // namespace internal | 255 } // namespace internal |
| 260 } // namespace v8 | 256 } // namespace v8 |
| OLD | NEW |