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

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

Issue 1304633002: Correctify instanceof and make it optimizable. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: REBASE. Add MIPS/MIPS64 ports. 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/full-codegen/mips64/full-codegen-mips64.cc ('k') | src/hydrogen.h » ('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/code-factory.h" 7 #include "src/code-factory.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/compiler.h" 10 #include "src/compiler.h"
(...skipping 5023 matching lines...) Expand 10 before | Expand all | Expand 10 after
5034 switch (op) { 5034 switch (op) {
5035 case Token::IN: 5035 case Token::IN:
5036 VisitForStackValue(expr->right()); 5036 VisitForStackValue(expr->right());
5037 __ InvokeBuiltin(Builtins::IN, CALL_FUNCTION); 5037 __ InvokeBuiltin(Builtins::IN, CALL_FUNCTION);
5038 PrepareForBailoutBeforeSplit(expr, false, NULL, NULL); 5038 PrepareForBailoutBeforeSplit(expr, false, NULL, NULL);
5039 __ CompareRoot(rax, Heap::kTrueValueRootIndex); 5039 __ CompareRoot(rax, Heap::kTrueValueRootIndex);
5040 Split(equal, if_true, if_false, fall_through); 5040 Split(equal, if_true, if_false, fall_through);
5041 break; 5041 break;
5042 5042
5043 case Token::INSTANCEOF: { 5043 case Token::INSTANCEOF: {
5044 VisitForStackValue(expr->right()); 5044 VisitForAccumulatorValue(expr->right());
5045 InstanceofStub stub(isolate(), InstanceofStub::kNoFlags); 5045 __ Pop(rdx);
5046 InstanceOfStub stub(isolate());
5046 __ CallStub(&stub); 5047 __ CallStub(&stub);
5047 PrepareForBailoutBeforeSplit(expr, true, if_true, if_false); 5048 PrepareForBailoutBeforeSplit(expr, false, NULL, NULL);
5048 __ testp(rax, rax); 5049 __ CompareRoot(rax, Heap::kTrueValueRootIndex);
5049 // The stub returns 0 for true. 5050 Split(equal, if_true, if_false, fall_through);
5050 Split(zero, if_true, if_false, fall_through);
5051 break; 5051 break;
5052 } 5052 }
5053 5053
5054 default: { 5054 default: {
5055 VisitForAccumulatorValue(expr->right()); 5055 VisitForAccumulatorValue(expr->right());
5056 Condition cc = CompareIC::ComputeCondition(op); 5056 Condition cc = CompareIC::ComputeCondition(op);
5057 __ Pop(rdx); 5057 __ Pop(rdx);
5058 5058
5059 bool inline_smi_code = ShouldInlineSmiCase(op); 5059 bool inline_smi_code = ShouldInlineSmiCase(op);
5060 JumpPatchSite patch_site(masm_); 5060 JumpPatchSite patch_site(masm_);
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after
5301 Assembler::target_address_at(call_target_address, 5301 Assembler::target_address_at(call_target_address,
5302 unoptimized_code)); 5302 unoptimized_code));
5303 return OSR_AFTER_STACK_CHECK; 5303 return OSR_AFTER_STACK_CHECK;
5304 } 5304 }
5305 5305
5306 5306
5307 } // namespace internal 5307 } // namespace internal
5308 } // namespace v8 5308 } // namespace v8
5309 5309
5310 #endif // V8_TARGET_ARCH_X64 5310 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/full-codegen/mips64/full-codegen-mips64.cc ('k') | src/hydrogen.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698