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

Side by Side Diff: src/full-codegen/arm/full-codegen-arm.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/compiler/js-generic-lowering.cc ('k') | src/full-codegen/arm64/full-codegen-arm64.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_ARM 5 #if V8_TARGET_ARCH_ARM
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 5070 matching lines...) Expand 10 before | Expand all | Expand 10 after
5081 context()->PrepareTest(&materialize_true, &materialize_false, 5081 context()->PrepareTest(&materialize_true, &materialize_false,
5082 &if_true, &if_false, &fall_through); 5082 &if_true, &if_false, &fall_through);
5083 5083
5084 Token::Value op = expr->op(); 5084 Token::Value op = expr->op();
5085 VisitForStackValue(expr->left()); 5085 VisitForStackValue(expr->left());
5086 switch (op) { 5086 switch (op) {
5087 case Token::IN: 5087 case Token::IN:
5088 VisitForStackValue(expr->right()); 5088 VisitForStackValue(expr->right());
5089 __ InvokeBuiltin(Builtins::IN, CALL_FUNCTION); 5089 __ InvokeBuiltin(Builtins::IN, CALL_FUNCTION);
5090 PrepareForBailoutBeforeSplit(expr, false, NULL, NULL); 5090 PrepareForBailoutBeforeSplit(expr, false, NULL, NULL);
5091 __ LoadRoot(ip, Heap::kTrueValueRootIndex); 5091 __ CompareRoot(r0, Heap::kTrueValueRootIndex);
5092 __ cmp(r0, ip);
5093 Split(eq, if_true, if_false, fall_through); 5092 Split(eq, if_true, if_false, fall_through);
5094 break; 5093 break;
5095 5094
5096 case Token::INSTANCEOF: { 5095 case Token::INSTANCEOF: {
5097 VisitForStackValue(expr->right()); 5096 VisitForAccumulatorValue(expr->right());
5098 InstanceofStub stub(isolate(), InstanceofStub::kNoFlags); 5097 __ pop(r1);
5098 InstanceOfStub stub(isolate());
5099 __ CallStub(&stub); 5099 __ CallStub(&stub);
5100 PrepareForBailoutBeforeSplit(expr, true, if_true, if_false); 5100 PrepareForBailoutBeforeSplit(expr, false, NULL, NULL);
5101 // The stub returns 0 for true. 5101 __ CompareRoot(r0, Heap::kTrueValueRootIndex);
5102 __ tst(r0, r0);
5103 Split(eq, if_true, if_false, fall_through); 5102 Split(eq, if_true, if_false, fall_through);
5104 break; 5103 break;
5105 } 5104 }
5106 5105
5107 default: { 5106 default: {
5108 VisitForAccumulatorValue(expr->right()); 5107 VisitForAccumulatorValue(expr->right());
5109 Condition cond = CompareIC::ComputeCondition(op); 5108 Condition cond = CompareIC::ComputeCondition(op);
5110 __ pop(r1); 5109 __ pop(r1);
5111 5110
5112 bool inline_smi_code = ShouldInlineSmiCase(op); 5111 bool inline_smi_code = ShouldInlineSmiCase(op);
(...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after
5414 DCHECK(interrupt_address == 5413 DCHECK(interrupt_address ==
5415 isolate->builtins()->OsrAfterStackCheck()->entry()); 5414 isolate->builtins()->OsrAfterStackCheck()->entry());
5416 return OSR_AFTER_STACK_CHECK; 5415 return OSR_AFTER_STACK_CHECK;
5417 } 5416 }
5418 5417
5419 5418
5420 } // namespace internal 5419 } // namespace internal
5421 } // namespace v8 5420 } // namespace v8
5422 5421
5423 #endif // V8_TARGET_ARCH_ARM 5422 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « src/compiler/js-generic-lowering.cc ('k') | src/full-codegen/arm64/full-codegen-arm64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698