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

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

Issue 1114563003: Optimize the typeof operator. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix mips/mips64 errors. Created 5 years, 7 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
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 #include "src/v8.h" 5 #include "src/v8.h"
6 6
7 #if V8_TARGET_ARCH_X64 7 #if V8_TARGET_ARCH_X64
8 8
9 #include "src/code-factory.h" 9 #include "src/code-factory.h"
10 #include "src/code-stubs.h" 10 #include "src/code-stubs.h"
(...skipping 4758 matching lines...) Expand 10 before | Expand all | Expand 10 after
4769 } else { 4769 } else {
4770 __ PushRoot(Heap::kFalseValueRootIndex); 4770 __ PushRoot(Heap::kFalseValueRootIndex);
4771 } 4771 }
4772 __ bind(&done); 4772 __ bind(&done);
4773 } 4773 }
4774 break; 4774 break;
4775 } 4775 }
4776 4776
4777 case Token::TYPEOF: { 4777 case Token::TYPEOF: {
4778 Comment cmnt(masm_, "[ UnaryOperation (TYPEOF)"); 4778 Comment cmnt(masm_, "[ UnaryOperation (TYPEOF)");
4779 { StackValueContext context(this); 4779 {
4780 AccumulatorValueContext context(this);
4780 VisitForTypeofValue(expr->expression()); 4781 VisitForTypeofValue(expr->expression());
4781 } 4782 }
4782 __ CallRuntime(Runtime::kTypeof, 1); 4783 __ movp(rbx, rax);
4784 TypeofStub typeof_stub(isolate());
4785 __ CallStub(&typeof_stub);
4783 context()->Plug(rax); 4786 context()->Plug(rax);
4784 break; 4787 break;
4785 } 4788 }
4786 4789
4787 default: 4790 default:
4788 UNREACHABLE(); 4791 UNREACHABLE();
4789 } 4792 }
4790 } 4793 }
4791 4794
4792 4795
(...skipping 626 matching lines...) Expand 10 before | Expand all | Expand 10 after
5419 DCHECK_EQ(isolate->builtins()->OsrAfterStackCheck()->entry(), 5422 DCHECK_EQ(isolate->builtins()->OsrAfterStackCheck()->entry(),
5420 Assembler::target_address_at(call_target_address, 5423 Assembler::target_address_at(call_target_address,
5421 unoptimized_code)); 5424 unoptimized_code));
5422 return OSR_AFTER_STACK_CHECK; 5425 return OSR_AFTER_STACK_CHECK;
5423 } 5426 }
5424 5427
5425 5428
5426 } } // namespace v8::internal 5429 } } // namespace v8::internal
5427 5430
5428 #endif // V8_TARGET_ARCH_X64 5431 #endif // V8_TARGET_ARCH_X64
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698