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

Side by Side Diff: src/x64/code-stubs-x64.cc

Issue 1355113002: [ic] Also collect known map for relational comparison. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Address Jakob's comment. Created 5 years, 3 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/v8natives.js ('k') | test/mjsunit/compare-known-objects.js » ('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 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 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/bootstrapper.h" 7 #include "src/bootstrapper.h"
8 #include "src/code-stubs.h" 8 #include "src/code-stubs.h"
9 #include "src/codegen.h" 9 #include "src/codegen.h"
10 #include "src/ic/handler-compiler.h" 10 #include "src/ic/handler-compiler.h"
(...skipping 3665 matching lines...) Expand 10 before | Expand all | Expand 10 after
3676 } 3676 }
3677 3677
3678 3678
3679 void CompareICStub::GenerateKnownObjects(MacroAssembler* masm) { 3679 void CompareICStub::GenerateKnownObjects(MacroAssembler* masm) {
3680 Label miss; 3680 Label miss;
3681 Handle<WeakCell> cell = Map::WeakCellForMap(known_map_); 3681 Handle<WeakCell> cell = Map::WeakCellForMap(known_map_);
3682 Condition either_smi = masm->CheckEitherSmi(rdx, rax); 3682 Condition either_smi = masm->CheckEitherSmi(rdx, rax);
3683 __ j(either_smi, &miss, Label::kNear); 3683 __ j(either_smi, &miss, Label::kNear);
3684 3684
3685 __ GetWeakValue(rdi, cell); 3685 __ GetWeakValue(rdi, cell);
3686 __ movp(rcx, FieldOperand(rax, HeapObject::kMapOffset)); 3686 __ cmpp(FieldOperand(rdx, HeapObject::kMapOffset), rdi);
3687 __ movp(rbx, FieldOperand(rdx, HeapObject::kMapOffset));
3688 __ cmpp(rcx, rdi);
3689 __ j(not_equal, &miss, Label::kNear); 3687 __ j(not_equal, &miss, Label::kNear);
3690 __ cmpp(rbx, rdi); 3688 __ cmpp(FieldOperand(rax, HeapObject::kMapOffset), rdi);
3691 __ j(not_equal, &miss, Label::kNear); 3689 __ j(not_equal, &miss, Label::kNear);
3692 3690
3693 __ subp(rax, rdx); 3691 if (Token::IsEqualityOp(op())) {
3694 __ ret(0); 3692 __ subp(rax, rdx);
3693 __ ret(0);
3694 } else if (is_strong(strength())) {
3695 __ TailCallRuntime(Runtime::kThrowStrongModeImplicitConversion, 0, 1);
3696 } else {
3697 __ PopReturnAddressTo(rcx);
3698 __ Push(rdx);
3699 __ Push(rax);
3700 __ Push(Smi::FromInt(NegativeComparisonResult(GetCondition())));
3701 __ PushReturnAddressFrom(rcx);
3702 __ TailCallRuntime(Runtime::kCompare, 3, 1);
3703 }
3695 3704
3696 __ bind(&miss); 3705 __ bind(&miss);
3697 GenerateMiss(masm); 3706 GenerateMiss(masm);
3698 } 3707 }
3699 3708
3700 3709
3701 void CompareICStub::GenerateMiss(MacroAssembler* masm) { 3710 void CompareICStub::GenerateMiss(MacroAssembler* masm) {
3702 { 3711 {
3703 // Call the runtime system in a fresh internal frame. 3712 // Call the runtime system in a fresh internal frame.
3704 FrameScope scope(masm, StackFrame::INTERNAL); 3713 FrameScope scope(masm, StackFrame::INTERNAL);
(...skipping 1853 matching lines...) Expand 10 before | Expand all | Expand 10 after
5558 kStackSpace, nullptr, return_value_operand, NULL); 5567 kStackSpace, nullptr, return_value_operand, NULL);
5559 } 5568 }
5560 5569
5561 5570
5562 #undef __ 5571 #undef __
5563 5572
5564 } // namespace internal 5573 } // namespace internal
5565 } // namespace v8 5574 } // namespace v8
5566 5575
5567 #endif // V8_TARGET_ARCH_X64 5576 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/v8natives.js ('k') | test/mjsunit/compare-known-objects.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698