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-assembler.h" | 5 #include "src/interpreter/interpreter-assembler.h" |
6 | 6 |
7 #include <limits> | 7 #include <limits> |
8 #include <ostream> | 8 #include <ostream> |
9 | 9 |
10 #include "src/code-factory.h" | 10 #include "src/code-factory.h" |
(...skipping 433 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
444 } | 444 } |
445 | 445 |
446 Node* InterpreterAssembler::BytecodeOperandImmIntPtr(int operand_index) { | 446 Node* InterpreterAssembler::BytecodeOperandImmIntPtr(int operand_index) { |
447 return ChangeInt32ToIntPtr(BytecodeOperandImm(operand_index)); | 447 return ChangeInt32ToIntPtr(BytecodeOperandImm(operand_index)); |
448 } | 448 } |
449 | 449 |
450 Node* InterpreterAssembler::BytecodeOperandImmSmi(int operand_index) { | 450 Node* InterpreterAssembler::BytecodeOperandImmSmi(int operand_index) { |
451 return SmiFromWord32(BytecodeOperandImm(operand_index)); | 451 return SmiFromWord32(BytecodeOperandImm(operand_index)); |
452 } | 452 } |
453 | 453 |
454 Node* InterpreterAssembler::BytecodeOperandIdx(int operand_index) { | 454 Node* InterpreterAssembler::BytecodeOperandIdxInt32(int operand_index) { |
455 DCHECK(OperandType::kIdx == | 455 DCHECK(OperandType::kIdx == |
456 Bytecodes::GetOperandType(bytecode_, operand_index)); | 456 Bytecodes::GetOperandType(bytecode_, operand_index)); |
457 OperandSize operand_size = | 457 OperandSize operand_size = |
458 Bytecodes::GetOperandSize(bytecode_, operand_index, operand_scale()); | 458 Bytecodes::GetOperandSize(bytecode_, operand_index, operand_scale()); |
459 return ChangeUint32ToWord( | 459 return BytecodeUnsignedOperand(operand_index, operand_size); |
460 BytecodeUnsignedOperand(operand_index, operand_size)); | 460 } |
461 | |
462 Node* InterpreterAssembler::BytecodeOperandIdx(int operand_index) { | |
463 return ChangeUint32ToWord(BytecodeOperandIdxInt32(operand_index)); | |
461 } | 464 } |
462 | 465 |
463 Node* InterpreterAssembler::BytecodeOperandIdxSmi(int operand_index) { | 466 Node* InterpreterAssembler::BytecodeOperandIdxSmi(int operand_index) { |
464 return SmiTag(BytecodeOperandIdx(operand_index)); | 467 return SmiTag(BytecodeOperandIdx(operand_index)); |
rmcilroy
2017/02/17 11:37:19
nit - could this use the new BytecodeOperandIdxInt
danno
2017/02/17 17:18:43
It requires a word. Otherwise, it needs to be expl
| |
465 } | 468 } |
466 | 469 |
467 Node* InterpreterAssembler::BytecodeOperandReg(int operand_index) { | 470 Node* InterpreterAssembler::BytecodeOperandReg(int operand_index) { |
468 DCHECK(Bytecodes::IsRegisterOperandType( | 471 DCHECK(Bytecodes::IsRegisterOperandType( |
469 Bytecodes::GetOperandType(bytecode_, operand_index))); | 472 Bytecodes::GetOperandType(bytecode_, operand_index))); |
470 OperandSize operand_size = | 473 OperandSize operand_size = |
471 Bytecodes::GetOperandSize(bytecode_, operand_index, operand_scale()); | 474 Bytecodes::GetOperandSize(bytecode_, operand_index, operand_scale()); |
472 return ChangeInt32ToIntPtr( | 475 return ChangeInt32ToIntPtr( |
473 BytecodeSignedOperand(operand_index, operand_size)); | 476 BytecodeSignedOperand(operand_index, operand_size)); |
474 } | 477 } |
(...skipping 943 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1418 Goto(&loop); | 1421 Goto(&loop); |
1419 } | 1422 } |
1420 Bind(&done_loop); | 1423 Bind(&done_loop); |
1421 | 1424 |
1422 return array; | 1425 return array; |
1423 } | 1426 } |
1424 | 1427 |
1425 } // namespace interpreter | 1428 } // namespace interpreter |
1426 } // namespace internal | 1429 } // namespace internal |
1427 } // namespace v8 | 1430 } // namespace v8 |
OLD | NEW |