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

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

Issue 6594045: ARM: Fix the use of the ToBooleanStub when VFP3 is not available (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 9 years, 9 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 | Annotate | Revision Log
« no previous file with comments | « src/arm/code-stubs-arm.cc ('k') | no next file » | 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 556 matching lines...) Expand 10 before | Expand all | Expand 10 after
567 if (true_label_ != fall_through_) __ b(true_label_); 567 if (true_label_ != fall_through_) __ b(true_label_);
568 } else { 568 } else {
569 if (false_label_ != fall_through_) __ b(false_label_); 569 if (false_label_ != fall_through_) __ b(false_label_);
570 } 570 }
571 } 571 }
572 572
573 573
574 void FullCodeGenerator::DoTest(Label* if_true, 574 void FullCodeGenerator::DoTest(Label* if_true,
575 Label* if_false, 575 Label* if_false,
576 Label* fall_through) { 576 Label* fall_through) {
577 // Emit the inlined tests assumed by the stub. 577 if (CpuFeatures::IsSupported(VFP3)) {
578 __ LoadRoot(ip, Heap::kUndefinedValueRootIndex); 578 CpuFeatures::Scope scope(VFP3);
579 __ cmp(result_register(), ip); 579 // Emit the inlined tests assumed by the stub.
580 __ b(eq, if_false); 580 __ LoadRoot(ip, Heap::kUndefinedValueRootIndex);
581 __ LoadRoot(ip, Heap::kTrueValueRootIndex); 581 __ cmp(result_register(), ip);
582 __ cmp(result_register(), ip); 582 __ b(eq, if_false);
583 __ b(eq, if_true); 583 __ LoadRoot(ip, Heap::kTrueValueRootIndex);
584 __ LoadRoot(ip, Heap::kFalseValueRootIndex); 584 __ cmp(result_register(), ip);
585 __ cmp(result_register(), ip); 585 __ b(eq, if_true);
586 __ b(eq, if_false); 586 __ LoadRoot(ip, Heap::kFalseValueRootIndex);
587 STATIC_ASSERT(kSmiTag == 0); 587 __ cmp(result_register(), ip);
588 __ tst(result_register(), result_register()); 588 __ b(eq, if_false);
589 __ b(eq, if_false); 589 STATIC_ASSERT(kSmiTag == 0);
590 __ JumpIfSmi(result_register(), if_true); 590 __ tst(result_register(), result_register());
591 __ b(eq, if_false);
592 __ JumpIfSmi(result_register(), if_true);
591 593
592 // Call the ToBoolean stub for all other cases. 594 // Call the ToBoolean stub for all other cases.
593 ToBooleanStub stub(result_register()); 595 ToBooleanStub stub(result_register());
594 __ CallStub(&stub); 596 __ CallStub(&stub);
595 __ tst(result_register(), result_register()); 597 __ tst(result_register(), result_register());
598 } else {
599 // Call the runtime to find the boolean value of the source and then
600 // translate it into control flow to the pair of labels.
601 __ push(result_register());
602 __ CallRuntime(Runtime::kToBool, 1);
603 __ LoadRoot(ip, Heap::kFalseValueRootIndex);
604 __ cmp(r0, ip);
605 }
596 606
597 // The stub returns nonzero for true. 607 // The stub returns nonzero for true.
598 Split(ne, if_true, if_false, fall_through); 608 Split(ne, if_true, if_false, fall_through);
599 } 609 }
600 610
601 611
602 void FullCodeGenerator::Split(Condition cond, 612 void FullCodeGenerator::Split(Condition cond,
603 Label* if_true, 613 Label* if_true,
604 Label* if_false, 614 Label* if_false,
605 Label* fall_through) { 615 Label* fall_through) {
(...skipping 3563 matching lines...) Expand 10 before | Expand all | Expand 10 after
4169 __ mov(r1, Operand(r1, ASR, 1)); // Un-smi-tag value. 4179 __ mov(r1, Operand(r1, ASR, 1)); // Un-smi-tag value.
4170 __ add(pc, r1, Operand(masm_->CodeObject())); 4180 __ add(pc, r1, Operand(masm_->CodeObject()));
4171 } 4181 }
4172 4182
4173 4183
4174 #undef __ 4184 #undef __
4175 4185
4176 } } // namespace v8::internal 4186 } } // namespace v8::internal
4177 4187
4178 #endif // V8_TARGET_ARCH_ARM 4188 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « src/arm/code-stubs-arm.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698