Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(24)

Side by Side Diff: src/arm/lithium-codegen-arm.cc

Issue 6995046: Support %_IsUndetectableObject in crankshaft. (Closed)
Patch Set: Review fixes Created 9 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/arm/lithium-arm.cc ('k') | src/hydrogen.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 1756 matching lines...) Expand 10 before | Expand all | Expand 10 after
1767 void LCodeGen::DoIsSmiAndBranch(LIsSmiAndBranch* instr) { 1767 void LCodeGen::DoIsSmiAndBranch(LIsSmiAndBranch* instr) {
1768 int true_block = chunk_->LookupDestination(instr->true_block_id()); 1768 int true_block = chunk_->LookupDestination(instr->true_block_id());
1769 int false_block = chunk_->LookupDestination(instr->false_block_id()); 1769 int false_block = chunk_->LookupDestination(instr->false_block_id());
1770 1770
1771 Register input_reg = EmitLoadRegister(instr->InputAt(0), ip); 1771 Register input_reg = EmitLoadRegister(instr->InputAt(0), ip);
1772 __ tst(input_reg, Operand(kSmiTagMask)); 1772 __ tst(input_reg, Operand(kSmiTagMask));
1773 EmitBranch(true_block, false_block, eq); 1773 EmitBranch(true_block, false_block, eq);
1774 } 1774 }
1775 1775
1776 1776
1777 void LCodeGen::DoIsUndetectable(LIsUndetectable* instr) {
1778 Register input = ToRegister(instr->InputAt(0));
1779 Register result = ToRegister(instr->result());
1780
1781 ASSERT(instr->hydrogen()->value()->representation().IsTagged());
1782 Label false_label, done;
1783 __ JumpIfSmi(input, &false_label);
1784 __ ldr(result, FieldMemOperand(input, HeapObject::kMapOffset));
1785 __ ldrb(result, FieldMemOperand(result, Map::kBitFieldOffset));
1786 __ tst(result, Operand(1 << Map::kIsUndetectable));
1787 __ b(eq, &false_label);
1788 __ LoadRoot(result, Heap::kTrueValueRootIndex);
1789 __ jmp(&done);
1790 __ bind(&false_label);
1791 __ LoadRoot(result, Heap::kFalseValueRootIndex);
1792 __ bind(&done);
1793 }
1794
1795
1796 void LCodeGen::DoIsUndetectableAndBranch(LIsUndetectableAndBranch* instr) {
1797 Register input = ToRegister(instr->InputAt(0));
1798 Register temp = ToRegister(instr->TempAt(0));
1799
1800 int true_block = chunk_->LookupDestination(instr->true_block_id());
1801 int false_block = chunk_->LookupDestination(instr->false_block_id());
1802
1803 __ JumpIfSmi(input, chunk_->GetAssemblyLabel(false_block));
1804 __ ldr(temp, FieldMemOperand(input, HeapObject::kMapOffset));
1805 __ ldrb(temp, FieldMemOperand(temp, Map::kBitFieldOffset));
1806 __ tst(temp, Operand(1 << Map::kIsUndetectable));
1807 EmitBranch(true_block, false_block, ne);
1808 }
1809
1810
1777 static InstanceType TestType(HHasInstanceType* instr) { 1811 static InstanceType TestType(HHasInstanceType* instr) {
1778 InstanceType from = instr->from(); 1812 InstanceType from = instr->from();
1779 InstanceType to = instr->to(); 1813 InstanceType to = instr->to();
1780 if (from == FIRST_TYPE) return to; 1814 if (from == FIRST_TYPE) return to;
1781 ASSERT(from == to || to == LAST_TYPE); 1815 ASSERT(from == to || to == LAST_TYPE);
1782 return from; 1816 return from;
1783 } 1817 }
1784 1818
1785 1819
1786 static Condition BranchCondition(HHasInstanceType* instr) { 1820 static Condition BranchCondition(HHasInstanceType* instr) {
(...skipping 2543 matching lines...) Expand 10 before | Expand all | Expand 10 after
4330 ASSERT(osr_pc_offset_ == -1); 4364 ASSERT(osr_pc_offset_ == -1);
4331 osr_pc_offset_ = masm()->pc_offset(); 4365 osr_pc_offset_ = masm()->pc_offset();
4332 } 4366 }
4333 4367
4334 4368
4335 4369
4336 4370
4337 #undef __ 4371 #undef __
4338 4372
4339 } } // namespace v8::internal 4373 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/arm/lithium-arm.cc ('k') | src/hydrogen.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698