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 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 Node* smi_int = __ SmiTag(raw_int); | 103 Node* smi_int = __ SmiTag(raw_int); |
104 __ SetAccumulator(smi_int); | 104 __ SetAccumulator(smi_int); |
105 __ Dispatch(); | 105 __ Dispatch(); |
106 } | 106 } |
107 | 107 |
108 | 108 |
109 // LdaUndefined | 109 // LdaUndefined |
110 // | 110 // |
111 // Load Undefined into the accumulator. | 111 // Load Undefined into the accumulator. |
112 void Interpreter::DoLdaUndefined(compiler::InterpreterAssembler* assembler) { | 112 void Interpreter::DoLdaUndefined(compiler::InterpreterAssembler* assembler) { |
113 Node* undefined_value = __ HeapConstant(Unique<HeapObject>::CreateImmovable( | 113 Node* undefined_value = |
114 isolate_->factory()->undefined_value())); | 114 __ HeapConstant(isolate_->factory()->undefined_value()); |
115 __ SetAccumulator(undefined_value); | 115 __ SetAccumulator(undefined_value); |
116 __ Dispatch(); | 116 __ Dispatch(); |
117 } | 117 } |
118 | 118 |
119 | 119 |
120 // LdaNull | 120 // LdaNull |
121 // | 121 // |
122 // Load Null into the accumulator. | 122 // Load Null into the accumulator. |
123 void Interpreter::DoLdaNull(compiler::InterpreterAssembler* assembler) { | 123 void Interpreter::DoLdaNull(compiler::InterpreterAssembler* assembler) { |
124 Node* null_value = __ HeapConstant( | 124 Node* null_value = __ HeapConstant(isolate_->factory()->null_value()); |
125 Unique<HeapObject>::CreateImmovable(isolate_->factory()->null_value())); | |
126 __ SetAccumulator(null_value); | 125 __ SetAccumulator(null_value); |
127 __ Dispatch(); | 126 __ Dispatch(); |
128 } | 127 } |
129 | 128 |
130 | 129 |
131 // LdaTheHole | 130 // LdaTheHole |
132 // | 131 // |
133 // Load TheHole into the accumulator. | 132 // Load TheHole into the accumulator. |
134 void Interpreter::DoLdaTheHole(compiler::InterpreterAssembler* assembler) { | 133 void Interpreter::DoLdaTheHole(compiler::InterpreterAssembler* assembler) { |
135 Node* the_hole_value = __ HeapConstant(Unique<HeapObject>::CreateImmovable( | 134 Node* the_hole_value = __ HeapConstant(isolate_->factory()->the_hole_value()); |
136 isolate_->factory()->the_hole_value())); | |
137 __ SetAccumulator(the_hole_value); | 135 __ SetAccumulator(the_hole_value); |
138 __ Dispatch(); | 136 __ Dispatch(); |
139 } | 137 } |
140 | 138 |
141 | 139 |
142 // LdaTrue | 140 // LdaTrue |
143 // | 141 // |
144 // Load True into the accumulator. | 142 // Load True into the accumulator. |
145 void Interpreter::DoLdaTrue(compiler::InterpreterAssembler* assembler) { | 143 void Interpreter::DoLdaTrue(compiler::InterpreterAssembler* assembler) { |
146 Node* true_value = __ HeapConstant( | 144 Node* true_value = __ HeapConstant(isolate_->factory()->true_value()); |
147 Unique<HeapObject>::CreateImmovable(isolate_->factory()->true_value())); | |
148 __ SetAccumulator(true_value); | 145 __ SetAccumulator(true_value); |
149 __ Dispatch(); | 146 __ Dispatch(); |
150 } | 147 } |
151 | 148 |
152 | 149 |
153 // LdaFalse | 150 // LdaFalse |
154 // | 151 // |
155 // Load False into the accumulator. | 152 // Load False into the accumulator. |
156 void Interpreter::DoLdaFalse(compiler::InterpreterAssembler* assembler) { | 153 void Interpreter::DoLdaFalse(compiler::InterpreterAssembler* assembler) { |
157 Node* false_value = __ HeapConstant( | 154 Node* false_value = __ HeapConstant(isolate_->factory()->false_value()); |
158 Unique<HeapObject>::CreateImmovable(isolate_->factory()->false_value())); | |
159 __ SetAccumulator(false_value); | 155 __ SetAccumulator(false_value); |
160 __ Dispatch(); | 156 __ Dispatch(); |
161 } | 157 } |
162 | 158 |
163 | 159 |
164 // Ldar <src> | 160 // Ldar <src> |
165 // | 161 // |
166 // Load accumulator with value from register <src>. | 162 // Load accumulator with value from register <src>. |
167 void Interpreter::DoLdar(compiler::InterpreterAssembler* assembler) { | 163 void Interpreter::DoLdar(compiler::InterpreterAssembler* assembler) { |
168 Node* reg_index = __ BytecodeOperandReg(0); | 164 Node* reg_index = __ BytecodeOperandReg(0); |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
240 // | 236 // |
241 // Return the value in register 0. | 237 // Return the value in register 0. |
242 void Interpreter::DoReturn(compiler::InterpreterAssembler* assembler) { | 238 void Interpreter::DoReturn(compiler::InterpreterAssembler* assembler) { |
243 __ Return(); | 239 __ Return(); |
244 } | 240 } |
245 | 241 |
246 | 242 |
247 } // namespace interpreter | 243 } // namespace interpreter |
248 } // namespace internal | 244 } // namespace internal |
249 } // namespace v8 | 245 } // namespace v8 |
OLD | NEW |