| 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/code-factory.h" | 7 #include "src/code-factory.h" |
| 8 #include "src/compiler.h" | 8 #include "src/compiler.h" |
| 9 #include "src/compiler/interpreter-assembler.h" | 9 #include "src/compiler/interpreter-assembler.h" |
| 10 #include "src/factory.h" | 10 #include "src/factory.h" |
| 11 #include "src/interpreter/bytecode-generator.h" | 11 #include "src/interpreter/bytecode-generator.h" |
| 12 #include "src/interpreter/bytecodes.h" | 12 #include "src/interpreter/bytecodes.h" |
| 13 #include "src/zone.h" | 13 #include "src/zone.h" |
| 14 | 14 |
| 15 namespace v8 { | 15 namespace v8 { |
| 16 namespace internal { | 16 namespace internal { |
| 17 namespace interpreter { | 17 namespace interpreter { |
| 18 | 18 |
| 19 using compiler::Node; | 19 using compiler::Node; |
| 20 |
| 20 #define __ assembler-> | 21 #define __ assembler-> |
| 21 | 22 |
| 22 | 23 |
| 23 Interpreter::Interpreter(Isolate* isolate) | 24 Interpreter::Interpreter(Isolate* isolate) |
| 24 : isolate_(isolate) {} | 25 : isolate_(isolate) {} |
| 25 | 26 |
| 26 | 27 |
| 27 // static | 28 // static |
| 28 Handle<FixedArray> Interpreter::CreateUninitializedInterpreterTable( | 29 Handle<FixedArray> Interpreter::CreateUninitializedInterpreterTable( |
| 29 Isolate* isolate) { | 30 Isolate* isolate) { |
| (...skipping 1151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1181 } | 1182 } |
| 1182 | 1183 |
| 1183 | 1184 |
| 1184 // JumpIfToBooleanTrue <imm8> | 1185 // JumpIfToBooleanTrue <imm8> |
| 1185 // | 1186 // |
| 1186 // Jump by number of bytes represented by an immediate operand if the object | 1187 // Jump by number of bytes represented by an immediate operand if the object |
| 1187 // referenced by the accumulator is true when the object is cast to boolean. | 1188 // referenced by the accumulator is true when the object is cast to boolean. |
| 1188 void Interpreter::DoJumpIfToBooleanTrue( | 1189 void Interpreter::DoJumpIfToBooleanTrue( |
| 1189 compiler::InterpreterAssembler* assembler) { | 1190 compiler::InterpreterAssembler* assembler) { |
| 1190 Node* accumulator = __ GetAccumulator(); | 1191 Node* accumulator = __ GetAccumulator(); |
| 1191 Node* relative_jump = __ BytecodeOperandImm(0); | |
| 1192 Node* to_boolean_value = | 1192 Node* to_boolean_value = |
| 1193 __ CallRuntime(Runtime::kInterpreterToBoolean, accumulator); | 1193 __ CallRuntime(Runtime::kInterpreterToBoolean, accumulator); |
| 1194 Node* relative_jump = __ BytecodeOperandImm(0); |
| 1194 Node* true_value = __ BooleanConstant(true); | 1195 Node* true_value = __ BooleanConstant(true); |
| 1195 __ JumpIfWordEqual(to_boolean_value, true_value, relative_jump); | 1196 __ JumpIfWordEqual(to_boolean_value, true_value, relative_jump); |
| 1196 } | 1197 } |
| 1197 | 1198 |
| 1198 | 1199 |
| 1199 // JumpIfToBooleanTrueConstant <idx> | 1200 // JumpIfToBooleanTrueConstant <idx> |
| 1200 // | 1201 // |
| 1201 // Jump by number of bytes in the Smi in the |idx| entry in the constant pool | 1202 // Jump by number of bytes in the Smi in the |idx| entry in the constant pool |
| 1202 // if the object referenced by the accumulator is true when the object is cast | 1203 // if the object referenced by the accumulator is true when the object is cast |
| 1203 // to boolean. | 1204 // to boolean. |
| (...skipping 10 matching lines...) Expand all Loading... |
| 1214 } | 1215 } |
| 1215 | 1216 |
| 1216 | 1217 |
| 1217 // JumpIfToBooleanFalse <imm8> | 1218 // JumpIfToBooleanFalse <imm8> |
| 1218 // | 1219 // |
| 1219 // Jump by number of bytes represented by an immediate operand if the object | 1220 // Jump by number of bytes represented by an immediate operand if the object |
| 1220 // referenced by the accumulator is false when the object is cast to boolean. | 1221 // referenced by the accumulator is false when the object is cast to boolean. |
| 1221 void Interpreter::DoJumpIfToBooleanFalse( | 1222 void Interpreter::DoJumpIfToBooleanFalse( |
| 1222 compiler::InterpreterAssembler* assembler) { | 1223 compiler::InterpreterAssembler* assembler) { |
| 1223 Node* accumulator = __ GetAccumulator(); | 1224 Node* accumulator = __ GetAccumulator(); |
| 1224 Node* relative_jump = __ BytecodeOperandImm(0); | |
| 1225 Node* to_boolean_value = | 1225 Node* to_boolean_value = |
| 1226 __ CallRuntime(Runtime::kInterpreterToBoolean, accumulator); | 1226 __ CallRuntime(Runtime::kInterpreterToBoolean, accumulator); |
| 1227 Node* relative_jump = __ BytecodeOperandImm(0); |
| 1227 Node* false_value = __ BooleanConstant(false); | 1228 Node* false_value = __ BooleanConstant(false); |
| 1228 __ JumpIfWordEqual(to_boolean_value, false_value, relative_jump); | 1229 __ JumpIfWordEqual(to_boolean_value, false_value, relative_jump); |
| 1229 } | 1230 } |
| 1230 | 1231 |
| 1231 | 1232 |
| 1232 // JumpIfToBooleanFalseConstant <idx> | 1233 // JumpIfToBooleanFalseConstant <idx> |
| 1233 // | 1234 // |
| 1234 // Jump by number of bytes in the Smi in the |idx| entry in the constant pool | 1235 // Jump by number of bytes in the Smi in the |idx| entry in the constant pool |
| 1235 // if the object referenced by the accumulator is false when the object is cast | 1236 // if the object referenced by the accumulator is false when the object is cast |
| 1236 // to boolean. | 1237 // to boolean. |
| (...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1497 Node* cache_length = __ LoadFixedArrayElement(for_in_state, 3); | 1498 Node* cache_length = __ LoadFixedArrayElement(for_in_state, 3); |
| 1498 Node* result = __ CallRuntime(Runtime::kForInDone, index, cache_length); | 1499 Node* result = __ CallRuntime(Runtime::kForInDone, index, cache_length); |
| 1499 __ SetAccumulator(result); | 1500 __ SetAccumulator(result); |
| 1500 __ Dispatch(); | 1501 __ Dispatch(); |
| 1501 } | 1502 } |
| 1502 | 1503 |
| 1503 | 1504 |
| 1504 } // namespace interpreter | 1505 } // namespace interpreter |
| 1505 } // namespace internal | 1506 } // namespace internal |
| 1506 } // namespace v8 | 1507 } // namespace v8 |
| OLD | NEW |