| 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 1395 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1406 // HeapNumber => false iff +0, -0, or NaN. These three cases set the | 1406 // HeapNumber => false iff +0, -0, or NaN. These three cases set the |
| 1407 // zero flag when compared to zero using ucomisd. | 1407 // zero flag when compared to zero using ucomisd. |
| 1408 __ xorps(xmm0, xmm0); | 1408 __ xorps(xmm0, xmm0); |
| 1409 __ ucomisd(xmm0, FieldOperand(reg, HeapNumber::kValueOffset)); | 1409 __ ucomisd(xmm0, FieldOperand(reg, HeapNumber::kValueOffset)); |
| 1410 __ j(zero, false_label); | 1410 __ j(zero, false_label); |
| 1411 __ jmp(true_label); | 1411 __ jmp(true_label); |
| 1412 | 1412 |
| 1413 // The conversion stub doesn't cause garbage collections so it's | 1413 // The conversion stub doesn't cause garbage collections so it's |
| 1414 // safe to not record a safepoint after the call. | 1414 // safe to not record a safepoint after the call. |
| 1415 __ bind(&call_stub); | 1415 __ bind(&call_stub); |
| 1416 ToBooleanStub stub; | 1416 ToBooleanStub stub(rax); |
| 1417 __ Pushad(); | 1417 __ Pushad(); |
| 1418 __ push(reg); | 1418 __ push(reg); |
| 1419 __ CallStub(&stub); | 1419 __ CallStub(&stub); |
| 1420 __ testq(rax, rax); | 1420 __ testq(rax, rax); |
| 1421 __ Popad(); | 1421 __ Popad(); |
| 1422 EmitBranch(true_block, false_block, not_zero); | 1422 EmitBranch(true_block, false_block, not_zero); |
| 1423 } | 1423 } |
| 1424 } | 1424 } |
| 1425 } | 1425 } |
| 1426 | 1426 |
| (...skipping 122 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()); | |
| 1580 | |
| 1581 __ cmpq(left, right); | |
| 1582 EmitBranch(true_block, false_block, equal); | |
| 1583 } | |
| 1584 | |
| 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()); | 1579 int true_block = chunk_->LookupDestination(instr->true_block_id()); |
| 1605 | 1580 |
| 1606 __ cmpq(left, right); | 1581 __ cmpq(left, right); |
| 1607 EmitBranch(true_block, false_block, equal); | 1582 EmitBranch(true_block, false_block, equal); |
| 1608 } | 1583 } |
| 1609 | 1584 |
| 1610 | 1585 |
| 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()); |
| (...skipping 2702 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 |