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

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

Issue 1490363003: PPC: [turbofan] Desugar JSUnaryNot(x) to Select(x, false, true). (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years 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 | « no previous file | 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 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #if V8_TARGET_ARCH_PPC 5 #if V8_TARGET_ARCH_PPC
6 6
7 #include "src/ast/scopes.h" 7 #include "src/ast/scopes.h"
8 #include "src/code-factory.h" 8 #include "src/code-factory.h"
9 #include "src/code-stubs.h" 9 #include "src/code-stubs.h"
10 #include "src/codegen.h" 10 #include "src/codegen.h"
(...skipping 630 matching lines...) Expand 10 before | Expand all | Expand 10 after
641 } else { 641 } else {
642 if (false_label_ != fall_through_) __ b(false_label_); 642 if (false_label_ != fall_through_) __ b(false_label_);
643 } 643 }
644 } 644 }
645 645
646 646
647 void FullCodeGenerator::DoTest(Expression* condition, Label* if_true, 647 void FullCodeGenerator::DoTest(Expression* condition, Label* if_true,
648 Label* if_false, Label* fall_through) { 648 Label* if_false, Label* fall_through) {
649 Handle<Code> ic = ToBooleanStub::GetUninitialized(isolate()); 649 Handle<Code> ic = ToBooleanStub::GetUninitialized(isolate());
650 CallIC(ic, condition->test_id()); 650 CallIC(ic, condition->test_id());
651 __ cmpi(result_register(), Operand::Zero()); 651 __ CompareRoot(result_register(), Heap::kTrueValueRootIndex);
652 Split(ne, if_true, if_false, fall_through); 652 Split(eq, if_true, if_false, fall_through);
653 } 653 }
654 654
655 655
656 void FullCodeGenerator::Split(Condition cond, Label* if_true, Label* if_false, 656 void FullCodeGenerator::Split(Condition cond, Label* if_true, Label* if_false,
657 Label* fall_through, CRegister cr) { 657 Label* fall_through, CRegister cr) {
658 if (if_false == fall_through) { 658 if (if_false == fall_through) {
659 __ b(cond, if_true, cr); 659 __ b(cond, if_true, cr);
660 } else if (if_true == fall_through) { 660 } else if (if_true == fall_through) {
661 __ b(NegateCondition(cond), if_false, cr); 661 __ b(NegateCondition(cond), if_false, cr);
662 } else { 662 } else {
(...skipping 1360 matching lines...) Expand 10 before | Expand all | Expand 10 after
2023 // if (!result.done) goto l_try; 2023 // if (!result.done) goto l_try;
2024 __ Move(load_receiver, r3); 2024 __ Move(load_receiver, r3);
2025 2025
2026 __ push(load_receiver); // save result 2026 __ push(load_receiver); // save result
2027 __ LoadRoot(load_name, Heap::kdone_stringRootIndex); // "done" 2027 __ LoadRoot(load_name, Heap::kdone_stringRootIndex); // "done"
2028 __ mov(LoadDescriptor::SlotRegister(), 2028 __ mov(LoadDescriptor::SlotRegister(),
2029 Operand(SmiFromSlot(expr->DoneFeedbackSlot()))); 2029 Operand(SmiFromSlot(expr->DoneFeedbackSlot())));
2030 CallLoadIC(NOT_INSIDE_TYPEOF); // r0=result.done 2030 CallLoadIC(NOT_INSIDE_TYPEOF); // r0=result.done
2031 Handle<Code> bool_ic = ToBooleanStub::GetUninitialized(isolate()); 2031 Handle<Code> bool_ic = ToBooleanStub::GetUninitialized(isolate());
2032 CallIC(bool_ic); 2032 CallIC(bool_ic);
2033 __ cmpi(r3, Operand::Zero()); 2033 __ CompareRoot(result_register(), Heap::kTrueValueRootIndex);
2034 __ beq(&l_try); 2034 __ bne(&l_try);
2035 2035
2036 // result.value 2036 // result.value
2037 __ pop(load_receiver); // result 2037 __ pop(load_receiver); // result
2038 __ LoadRoot(load_name, Heap::kvalue_stringRootIndex); // "value" 2038 __ LoadRoot(load_name, Heap::kvalue_stringRootIndex); // "value"
2039 __ mov(LoadDescriptor::SlotRegister(), 2039 __ mov(LoadDescriptor::SlotRegister(),
2040 Operand(SmiFromSlot(expr->ValueFeedbackSlot()))); 2040 Operand(SmiFromSlot(expr->ValueFeedbackSlot())));
2041 CallLoadIC(NOT_INSIDE_TYPEOF); // r3=result.value 2041 CallLoadIC(NOT_INSIDE_TYPEOF); // r3=result.value
2042 context()->DropAndPlug(2, r3); // drop iter and g 2042 context()->DropAndPlug(2, r3); // drop iter and g
2043 break; 2043 break;
2044 } 2044 }
(...skipping 2874 matching lines...) Expand 10 before | Expand all | Expand 10 after
4919 return ON_STACK_REPLACEMENT; 4919 return ON_STACK_REPLACEMENT;
4920 } 4920 }
4921 4921
4922 DCHECK(interrupt_address == 4922 DCHECK(interrupt_address ==
4923 isolate->builtins()->OsrAfterStackCheck()->entry()); 4923 isolate->builtins()->OsrAfterStackCheck()->entry());
4924 return OSR_AFTER_STACK_CHECK; 4924 return OSR_AFTER_STACK_CHECK;
4925 } 4925 }
4926 } // namespace internal 4926 } // namespace internal
4927 } // namespace v8 4927 } // namespace v8
4928 #endif // V8_TARGET_ARCH_PPC 4928 #endif // V8_TARGET_ARCH_PPC
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698