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 <array> | 7 #include <array> |
8 #include <fstream> | 8 #include <fstream> |
9 #include <memory> | 9 #include <memory> |
10 | 10 |
(...skipping 1344 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1355 } | 1355 } |
1356 } | 1356 } |
1357 | 1357 |
1358 __ Bind(&do_compare); | 1358 __ Bind(&do_compare); |
1359 Node* result; | 1359 Node* result; |
1360 switch (compare_op) { | 1360 switch (compare_op) { |
1361 case Token::EQ: | 1361 case Token::EQ: |
1362 result = assembler->Equal(lhs, rhs, context); | 1362 result = assembler->Equal(lhs, rhs, context); |
1363 break; | 1363 break; |
1364 case Token::EQ_STRICT: | 1364 case Token::EQ_STRICT: |
1365 result = assembler->StrictEqual(lhs, rhs, context); | 1365 result = assembler->StrictEqual(lhs, rhs); |
1366 break; | 1366 break; |
1367 case Token::LT: | 1367 case Token::LT: |
1368 result = assembler->RelationalComparison(CodeStubAssembler::kLessThan, | 1368 result = assembler->RelationalComparison(CodeStubAssembler::kLessThan, |
1369 lhs, rhs, context); | 1369 lhs, rhs, context); |
1370 break; | 1370 break; |
1371 case Token::GT: | 1371 case Token::GT: |
1372 result = assembler->RelationalComparison(CodeStubAssembler::kGreaterThan, | 1372 result = assembler->RelationalComparison(CodeStubAssembler::kGreaterThan, |
1373 lhs, rhs, context); | 1373 lhs, rhs, context); |
1374 break; | 1374 break; |
1375 case Token::LTE: | 1375 case Token::LTE: |
(...skipping 772 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2148 __ SetAccumulator(result.value()); | 2148 __ SetAccumulator(result.value()); |
2149 __ Dispatch(); | 2149 __ Dispatch(); |
2150 } | 2150 } |
2151 | 2151 |
2152 // TypeOf | 2152 // TypeOf |
2153 // | 2153 // |
2154 // Load the accumulator with the string representating type of the | 2154 // Load the accumulator with the string representating type of the |
2155 // object in the accumulator. | 2155 // object in the accumulator. |
2156 void Interpreter::DoTypeOf(InterpreterAssembler* assembler) { | 2156 void Interpreter::DoTypeOf(InterpreterAssembler* assembler) { |
2157 Node* value = __ GetAccumulator(); | 2157 Node* value = __ GetAccumulator(); |
2158 Node* context = __ GetContext(); | 2158 Node* result = assembler->Typeof(value); |
2159 Node* result = assembler->Typeof(value, context); | |
2160 __ SetAccumulator(result); | 2159 __ SetAccumulator(result); |
2161 __ Dispatch(); | 2160 __ Dispatch(); |
2162 } | 2161 } |
2163 | 2162 |
2164 void Interpreter::DoDelete(Runtime::FunctionId function_id, | 2163 void Interpreter::DoDelete(Runtime::FunctionId function_id, |
2165 InterpreterAssembler* assembler) { | 2164 InterpreterAssembler* assembler) { |
2166 Node* reg_index = __ BytecodeOperandReg(0); | 2165 Node* reg_index = __ BytecodeOperandReg(0); |
2167 Node* object = __ LoadRegister(reg_index); | 2166 Node* object = __ LoadRegister(reg_index); |
2168 Node* key = __ GetAccumulator(); | 2167 Node* key = __ GetAccumulator(); |
2169 Node* context = __ GetContext(); | 2168 Node* context = __ GetContext(); |
(...skipping 1308 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3478 __ StoreObjectField(generator, JSGeneratorObject::kContinuationOffset, | 3477 __ StoreObjectField(generator, JSGeneratorObject::kContinuationOffset, |
3479 __ SmiTag(new_state)); | 3478 __ SmiTag(new_state)); |
3480 __ SetAccumulator(old_state); | 3479 __ SetAccumulator(old_state); |
3481 | 3480 |
3482 __ Dispatch(); | 3481 __ Dispatch(); |
3483 } | 3482 } |
3484 | 3483 |
3485 } // namespace interpreter | 3484 } // namespace interpreter |
3486 } // namespace internal | 3485 } // namespace internal |
3487 } // namespace v8 | 3486 } // namespace v8 |
OLD | NEW |