OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 1538 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1549 __ j(parity_even, chunk_->GetAssemblyLabel(false_block)); | 1549 __ j(parity_even, chunk_->GetAssemblyLabel(false_block)); |
1550 } else { | 1550 } else { |
1551 EmitCmpI(left, right); | 1551 EmitCmpI(left, right); |
1552 } | 1552 } |
1553 | 1553 |
1554 Condition cc = TokenToCondition(instr->op(), instr->is_double()); | 1554 Condition cc = TokenToCondition(instr->op(), instr->is_double()); |
1555 EmitBranch(true_block, false_block, cc); | 1555 EmitBranch(true_block, false_block, cc); |
1556 } | 1556 } |
1557 | 1557 |
1558 | 1558 |
1559 void LCodeGen::DoCmpJSObjectEq(LCmpJSObjectEq* instr) { | 1559 void LCodeGen::DoCmpObjectEq(LCmpObjectEq* instr) { |
1560 Register left = ToRegister(instr->InputAt(0)); | 1560 Register left = ToRegister(instr->InputAt(0)); |
1561 Register right = ToRegister(instr->InputAt(1)); | 1561 Register right = ToRegister(instr->InputAt(1)); |
1562 Register result = ToRegister(instr->result()); | 1562 Register result = ToRegister(instr->result()); |
1563 | 1563 |
1564 Label different, done; | 1564 Label different, done; |
1565 __ cmpq(left, right); | 1565 __ cmpq(left, right); |
1566 __ j(not_equal, &different, Label::kNear); | 1566 __ j(not_equal, &different, Label::kNear); |
1567 __ LoadRoot(result, Heap::kTrueValueRootIndex); | 1567 __ LoadRoot(result, Heap::kTrueValueRootIndex); |
1568 __ jmp(&done, Label::kNear); | 1568 __ jmp(&done, Label::kNear); |
1569 __ bind(&different); | 1569 __ bind(&different); |
1570 __ LoadRoot(result, Heap::kFalseValueRootIndex); | 1570 __ LoadRoot(result, Heap::kFalseValueRootIndex); |
1571 __ bind(&done); | 1571 __ bind(&done); |
1572 } | 1572 } |
1573 | 1573 |
1574 | 1574 |
1575 void LCodeGen::DoCmpJSObjectEqAndBranch(LCmpJSObjectEqAndBranch* instr) { | 1575 void LCodeGen::DoCmpObjectEqAndBranch(LCmpObjectEqAndBranch* instr) { |
1576 Register left = ToRegister(instr->InputAt(0)); | 1576 Register left = ToRegister(instr->InputAt(0)); |
1577 Register right = ToRegister(instr->InputAt(1)); | 1577 Register right = ToRegister(instr->InputAt(1)); |
1578 int false_block = chunk_->LookupDestination(instr->false_block_id()); | 1578 int false_block = chunk_->LookupDestination(instr->false_block_id()); |
1579 int true_block = chunk_->LookupDestination(instr->true_block_id()); | 1579 int true_block = chunk_->LookupDestination(instr->true_block_id()); |
1580 | 1580 |
1581 __ cmpq(left, right); | 1581 __ cmpq(left, right); |
1582 EmitBranch(true_block, false_block, equal); | 1582 EmitBranch(true_block, false_block, equal); |
1583 } | 1583 } |
1584 | 1584 |
1585 | 1585 |
1586 void LCodeGen::DoCmpSymbolEq(LCmpSymbolEq* instr) { | |
1587 Register left = ToRegister(instr->InputAt(0)); | |
1588 Register right = ToRegister(instr->InputAt(1)); | |
1589 Register result = ToRegister(instr->result()); | |
1590 | |
1591 Label done; | |
1592 __ cmpq(left, right); | |
1593 __ LoadRoot(result, Heap::kFalseValueRootIndex); | |
1594 __ j(not_equal, &done, Label::kNear); | |
1595 __ LoadRoot(result, Heap::kTrueValueRootIndex); | |
1596 __ bind(&done); | |
1597 } | |
1598 | |
1599 | |
1600 void LCodeGen::DoCmpSymbolEqAndBranch(LCmpSymbolEqAndBranch* instr) { | |
1601 Register left = ToRegister(instr->InputAt(0)); | |
1602 Register right = ToRegister(instr->InputAt(1)); | |
1603 int false_block = chunk_->LookupDestination(instr->false_block_id()); | |
1604 int true_block = chunk_->LookupDestination(instr->true_block_id()); | |
1605 | |
1606 __ cmpq(left, right); | |
1607 EmitBranch(true_block, false_block, equal); | |
1608 } | |
1609 | |
1610 | |
1611 void LCodeGen::DoCmpConstantEq(LCmpConstantEq* instr) { | 1586 void LCodeGen::DoCmpConstantEq(LCmpConstantEq* instr) { |
1612 Register left = ToRegister(instr->InputAt(0)); | 1587 Register left = ToRegister(instr->InputAt(0)); |
1613 Register result = ToRegister(instr->result()); | 1588 Register result = ToRegister(instr->result()); |
1614 | 1589 |
1615 Label done; | 1590 Label done; |
1616 __ cmpq(left, Immediate(instr->hydrogen()->right())); | 1591 __ cmpq(left, Immediate(instr->hydrogen()->right())); |
1617 __ LoadRoot(result, Heap::kTrueValueRootIndex); | 1592 __ LoadRoot(result, Heap::kTrueValueRootIndex); |
1618 __ j(equal, &done, Label::kNear); | 1593 __ j(equal, &done, Label::kNear); |
1619 __ LoadRoot(result, Heap::kFalseValueRootIndex); | 1594 __ LoadRoot(result, Heap::kFalseValueRootIndex); |
1620 __ bind(&done); | 1595 __ bind(&done); |
(...skipping 2695 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4316 RegisterEnvironmentForDeoptimization(environment); | 4291 RegisterEnvironmentForDeoptimization(environment); |
4317 ASSERT(osr_pc_offset_ == -1); | 4292 ASSERT(osr_pc_offset_ == -1); |
4318 osr_pc_offset_ = masm()->pc_offset(); | 4293 osr_pc_offset_ = masm()->pc_offset(); |
4319 } | 4294 } |
4320 | 4295 |
4321 #undef __ | 4296 #undef __ |
4322 | 4297 |
4323 } } // namespace v8::internal | 4298 } } // namespace v8::internal |
4324 | 4299 |
4325 #endif // V8_TARGET_ARCH_X64 | 4300 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |