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 1561 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1572 InstanceType to = instr->to(); | 1572 InstanceType to = instr->to(); |
1573 if (from == to) return equal; | 1573 if (from == to) return equal; |
1574 if (to == LAST_TYPE) return above_equal; | 1574 if (to == LAST_TYPE) return above_equal; |
1575 if (from == FIRST_TYPE) return below_equal; | 1575 if (from == FIRST_TYPE) return below_equal; |
1576 UNREACHABLE(); | 1576 UNREACHABLE(); |
1577 return equal; | 1577 return equal; |
1578 } | 1578 } |
1579 | 1579 |
1580 | 1580 |
1581 void LCodeGen::DoHasInstanceType(LHasInstanceType* instr) { | 1581 void LCodeGen::DoHasInstanceType(LHasInstanceType* instr) { |
1582 Abort("Unimplemented: %s", "DoHasInstanceType"); | 1582 Register input = ToRegister(instr->InputAt(0)); |
1583 Register result = ToRegister(instr->result()); | |
1584 | |
1585 ASSERT(instr->hydrogen()->value()->representation().IsTagged()); | |
1586 __ testl(input, Immediate(kSmiTagMask)); | |
1587 NearLabel done, is_false; | |
1588 __ j(zero, &is_false); | |
1589 __ CmpObjectType(input, TestType(instr->hydrogen()), result); | |
1590 __ j(NegateCondition(BranchCondition(instr->hydrogen())), &is_false); | |
1591 __ Move(result, Factory::true_value()); | |
William Hesse
2011/02/24 17:05:30
Use LoadRoot(result, Heap::kTrueValueRootIndex);
| |
1592 __ jmp(&done); | |
1593 __ bind(&is_false); | |
1594 __ Move(result, Factory::false_value()); | |
1595 __ bind(&done); | |
1583 } | 1596 } |
1584 | 1597 |
1585 | 1598 |
1586 void LCodeGen::DoHasInstanceTypeAndBranch(LHasInstanceTypeAndBranch* instr) { | 1599 void LCodeGen::DoHasInstanceTypeAndBranch(LHasInstanceTypeAndBranch* instr) { |
1587 Register input = ToRegister(instr->InputAt(0)); | 1600 Register input = ToRegister(instr->InputAt(0)); |
1588 | 1601 |
1589 int true_block = chunk_->LookupDestination(instr->true_block_id()); | 1602 int true_block = chunk_->LookupDestination(instr->true_block_id()); |
1590 int false_block = chunk_->LookupDestination(instr->false_block_id()); | 1603 int false_block = chunk_->LookupDestination(instr->false_block_id()); |
1591 | 1604 |
1592 Label* false_label = chunk_->GetAssemblyLabel(false_block); | 1605 Label* false_label = chunk_->GetAssemblyLabel(false_block); |
(...skipping 1842 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3435 RegisterEnvironmentForDeoptimization(environment); | 3448 RegisterEnvironmentForDeoptimization(environment); |
3436 ASSERT(osr_pc_offset_ == -1); | 3449 ASSERT(osr_pc_offset_ == -1); |
3437 osr_pc_offset_ = masm()->pc_offset(); | 3450 osr_pc_offset_ = masm()->pc_offset(); |
3438 } | 3451 } |
3439 | 3452 |
3440 #undef __ | 3453 #undef __ |
3441 | 3454 |
3442 } } // namespace v8::internal | 3455 } } // namespace v8::internal |
3443 | 3456 |
3444 #endif // V8_TARGET_ARCH_X64 | 3457 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |