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

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

Issue 1491223002: [turbofan] Desugar JSUnaryNot(x) to Select(x, false, true). (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix typo in arm64. 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 | « src/full-codegen/mips64/full-codegen-mips64.cc ('k') | src/ic/ic.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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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_X64 5 #if V8_TARGET_ARCH_X64
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 618 matching lines...) Expand 10 before | Expand all | Expand 10 after
629 } 629 }
630 } 630 }
631 631
632 632
633 void FullCodeGenerator::DoTest(Expression* condition, 633 void FullCodeGenerator::DoTest(Expression* condition,
634 Label* if_true, 634 Label* if_true,
635 Label* if_false, 635 Label* if_false,
636 Label* fall_through) { 636 Label* fall_through) {
637 Handle<Code> ic = ToBooleanStub::GetUninitialized(isolate()); 637 Handle<Code> ic = ToBooleanStub::GetUninitialized(isolate());
638 CallIC(ic, condition->test_id()); 638 CallIC(ic, condition->test_id());
639 __ testp(result_register(), result_register()); 639 __ CompareRoot(result_register(), Heap::kTrueValueRootIndex);
640 // The stub returns nonzero for true. 640 Split(equal, if_true, if_false, fall_through);
641 Split(not_zero, if_true, if_false, fall_through);
642 } 641 }
643 642
644 643
645 void FullCodeGenerator::Split(Condition cc, 644 void FullCodeGenerator::Split(Condition cc,
646 Label* if_true, 645 Label* if_true,
647 Label* if_false, 646 Label* if_false,
648 Label* fall_through) { 647 Label* fall_through) {
649 if (if_false == fall_through) { 648 if (if_false == fall_through) {
650 __ j(cc, if_true); 649 __ j(cc, if_true);
651 } else if (if_true == fall_through) { 650 } else if (if_true == fall_through) {
(...skipping 1348 matching lines...) Expand 10 before | Expand all | Expand 10 after
2000 // if (!result.done) goto l_try; 1999 // if (!result.done) goto l_try;
2001 __ bind(&l_loop); 2000 __ bind(&l_loop);
2002 __ Move(load_receiver, rax); 2001 __ Move(load_receiver, rax);
2003 __ Push(load_receiver); // save result 2002 __ Push(load_receiver); // save result
2004 __ LoadRoot(load_name, Heap::kdone_stringRootIndex); // "done" 2003 __ LoadRoot(load_name, Heap::kdone_stringRootIndex); // "done"
2005 __ Move(LoadDescriptor::SlotRegister(), 2004 __ Move(LoadDescriptor::SlotRegister(),
2006 SmiFromSlot(expr->DoneFeedbackSlot())); 2005 SmiFromSlot(expr->DoneFeedbackSlot()));
2007 CallLoadIC(NOT_INSIDE_TYPEOF); // rax=result.done 2006 CallLoadIC(NOT_INSIDE_TYPEOF); // rax=result.done
2008 Handle<Code> bool_ic = ToBooleanStub::GetUninitialized(isolate()); 2007 Handle<Code> bool_ic = ToBooleanStub::GetUninitialized(isolate());
2009 CallIC(bool_ic); 2008 CallIC(bool_ic);
2010 __ testp(result_register(), result_register()); 2009 __ CompareRoot(result_register(), Heap::kTrueValueRootIndex);
2011 __ j(zero, &l_try); 2010 __ j(not_equal, &l_try);
2012 2011
2013 // result.value 2012 // result.value
2014 __ Pop(load_receiver); // result 2013 __ Pop(load_receiver); // result
2015 __ LoadRoot(load_name, Heap::kvalue_stringRootIndex); // "value" 2014 __ LoadRoot(load_name, Heap::kvalue_stringRootIndex); // "value"
2016 __ Move(LoadDescriptor::SlotRegister(), 2015 __ Move(LoadDescriptor::SlotRegister(),
2017 SmiFromSlot(expr->ValueFeedbackSlot())); 2016 SmiFromSlot(expr->ValueFeedbackSlot()));
2018 CallLoadIC(NOT_INSIDE_TYPEOF); // result.value in rax 2017 CallLoadIC(NOT_INSIDE_TYPEOF); // result.value in rax
2019 context()->DropAndPlug(2, rax); // drop iter and g 2018 context()->DropAndPlug(2, rax); // drop iter and g
2020 break; 2019 break;
2021 } 2020 }
(...skipping 2826 matching lines...) Expand 10 before | Expand all | Expand 10 after
4848 Assembler::target_address_at(call_target_address, 4847 Assembler::target_address_at(call_target_address,
4849 unoptimized_code)); 4848 unoptimized_code));
4850 return OSR_AFTER_STACK_CHECK; 4849 return OSR_AFTER_STACK_CHECK;
4851 } 4850 }
4852 4851
4853 4852
4854 } // namespace internal 4853 } // namespace internal
4855 } // namespace v8 4854 } // namespace v8
4856 4855
4857 #endif // V8_TARGET_ARCH_X64 4856 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/full-codegen/mips64/full-codegen-mips64.cc ('k') | src/ic/ic.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698