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

Side by Side Diff: src/arm64/lithium-codegen-arm64.cc

Issue 410153002: Make --always-opt also optimize toplevel code. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressed comments by Jacob Bramley. Created 6 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « src/arm/lithium-codegen-arm.cc ('k') | src/factory.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 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 #include "src/v8.h" 5 #include "src/v8.h"
6 6
7 #include "src/arm64/lithium-codegen-arm64.h" 7 #include "src/arm64/lithium-codegen-arm64.h"
8 #include "src/arm64/lithium-gap-resolver-arm64.h" 8 #include "src/arm64/lithium-gap-resolver-arm64.h"
9 #include "src/code-stubs.h" 9 #include "src/code-stubs.h"
10 #include "src/hydrogen-osr.h" 10 #include "src/hydrogen-osr.h"
(...skipping 671 matching lines...) Expand 10 before | Expand all | Expand 10 after
682 if (info()->saves_caller_doubles()) { 682 if (info()->saves_caller_doubles()) {
683 SaveCallerDoubles(); 683 SaveCallerDoubles();
684 } 684 }
685 685
686 // Allocate a local context if needed. 686 // Allocate a local context if needed.
687 int heap_slots = info()->num_heap_slots() - Context::MIN_CONTEXT_SLOTS; 687 int heap_slots = info()->num_heap_slots() - Context::MIN_CONTEXT_SLOTS;
688 if (heap_slots > 0) { 688 if (heap_slots > 0) {
689 Comment(";;; Allocate local context"); 689 Comment(";;; Allocate local context");
690 bool need_write_barrier = true; 690 bool need_write_barrier = true;
691 // Argument to NewContext is the function, which is in x1. 691 // Argument to NewContext is the function, which is in x1.
692 if (heap_slots <= FastNewContextStub::kMaximumSlots) { 692 if (FLAG_harmony_scoping && info()->scope()->is_global_scope()) {
693 UseScratchRegisterScope temps(masm());
694 Register scope_info = temps.AcquireX();
695 __ Mov(scope_info, Operand(info()->scope()->GetScopeInfo()));
696 __ Push(x1, scope_info);
697 __ CallRuntime(Runtime::kNewGlobalContext, 2);
698 } else if (heap_slots <= FastNewContextStub::kMaximumSlots) {
693 FastNewContextStub stub(isolate(), heap_slots); 699 FastNewContextStub stub(isolate(), heap_slots);
694 __ CallStub(&stub); 700 __ CallStub(&stub);
695 // Result of FastNewContextStub is always in new space. 701 // Result of FastNewContextStub is always in new space.
696 need_write_barrier = false; 702 need_write_barrier = false;
697 } else { 703 } else {
698 __ Push(x1); 704 __ Push(x1);
699 __ CallRuntime(Runtime::kNewFunctionContext, 1); 705 __ CallRuntime(Runtime::kNewFunctionContext, 1);
700 } 706 }
701 RecordSafepoint(Safepoint::kNoLazyDeopt); 707 RecordSafepoint(Safepoint::kNoLazyDeopt);
702 // Context is returned in x0. It replaces the context passed to us. It's 708 // Context is returned in x0. It replaces the context passed to us. It's
(...skipping 4324 matching lines...) Expand 10 before | Expand all | Expand 10 after
5027 void LCodeGen::DoDebugBreak(LDebugBreak* instr) { 5033 void LCodeGen::DoDebugBreak(LDebugBreak* instr) {
5028 __ Debug("LDebugBreak", 0, BREAK); 5034 __ Debug("LDebugBreak", 0, BREAK);
5029 } 5035 }
5030 5036
5031 5037
5032 void LCodeGen::DoDeclareGlobals(LDeclareGlobals* instr) { 5038 void LCodeGen::DoDeclareGlobals(LDeclareGlobals* instr) {
5033 ASSERT(ToRegister(instr->context()).is(cp)); 5039 ASSERT(ToRegister(instr->context()).is(cp));
5034 Register scratch1 = x5; 5040 Register scratch1 = x5;
5035 Register scratch2 = x6; 5041 Register scratch2 = x6;
5036 ASSERT(instr->IsMarkedAsCall()); 5042 ASSERT(instr->IsMarkedAsCall());
5037
5038 ASM_UNIMPLEMENTED_BREAK("DoDeclareGlobals");
5039 // TODO(all): if Mov could handle object in new space then it could be used 5043 // TODO(all): if Mov could handle object in new space then it could be used
5040 // here. 5044 // here.
5041 __ LoadHeapObject(scratch1, instr->hydrogen()->pairs()); 5045 __ LoadHeapObject(scratch1, instr->hydrogen()->pairs());
5042 __ Mov(scratch2, Smi::FromInt(instr->hydrogen()->flags())); 5046 __ Mov(scratch2, Smi::FromInt(instr->hydrogen()->flags()));
5043 __ Push(cp, scratch1, scratch2); // The context is the first argument. 5047 __ Push(cp, scratch1, scratch2); // The context is the first argument.
5044 CallRuntime(Runtime::kDeclareGlobals, 3, instr); 5048 CallRuntime(Runtime::kDeclareGlobals, 3, instr);
5045 } 5049 }
5046 5050
5047 5051
5048 void LCodeGen::DoDeferredStackCheck(LStackCheck* instr) { 5052 void LCodeGen::DoDeferredStackCheck(LStackCheck* instr) {
(...skipping 1005 matching lines...) Expand 10 before | Expand all | Expand 10 after
6054 Handle<ScopeInfo> scope_info = instr->scope_info(); 6058 Handle<ScopeInfo> scope_info = instr->scope_info();
6055 __ Push(scope_info); 6059 __ Push(scope_info);
6056 __ Push(ToRegister(instr->function())); 6060 __ Push(ToRegister(instr->function()));
6057 CallRuntime(Runtime::kPushBlockContext, 2, instr); 6061 CallRuntime(Runtime::kPushBlockContext, 2, instr);
6058 RecordSafepoint(Safepoint::kNoLazyDeopt); 6062 RecordSafepoint(Safepoint::kNoLazyDeopt);
6059 } 6063 }
6060 6064
6061 6065
6062 6066
6063 } } // namespace v8::internal 6067 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/arm/lithium-codegen-arm.cc ('k') | src/factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698