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

Side by Side Diff: src/ia32/lithium-codegen-ia32.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/hydrogen.cc ('k') | src/mips/lithium-codegen-mips.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 #include "src/v8.h" 5 #include "src/v8.h"
6 6
7 #if V8_TARGET_ARCH_IA32 7 #if V8_TARGET_ARCH_IA32
8 8
9 #include "src/code-stubs.h" 9 #include "src/code-stubs.h"
10 #include "src/codegen.h" 10 #include "src/codegen.h"
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after
249 249
250 if (info()->saves_caller_doubles()) SaveCallerDoubles(); 250 if (info()->saves_caller_doubles()) SaveCallerDoubles();
251 } 251 }
252 252
253 // Possibly allocate a local context. 253 // Possibly allocate a local context.
254 int heap_slots = info_->num_heap_slots() - Context::MIN_CONTEXT_SLOTS; 254 int heap_slots = info_->num_heap_slots() - Context::MIN_CONTEXT_SLOTS;
255 if (heap_slots > 0) { 255 if (heap_slots > 0) {
256 Comment(";;; Allocate local context"); 256 Comment(";;; Allocate local context");
257 bool need_write_barrier = true; 257 bool need_write_barrier = true;
258 // Argument to NewContext is the function, which is still in edi. 258 // Argument to NewContext is the function, which is still in edi.
259 if (heap_slots <= FastNewContextStub::kMaximumSlots) { 259 if (FLAG_harmony_scoping && info()->scope()->is_global_scope()) {
260 __ push(edi);
261 __ Push(info()->scope()->GetScopeInfo());
262 __ CallRuntime(Runtime::kNewGlobalContext, 2);
263 } else if (heap_slots <= FastNewContextStub::kMaximumSlots) {
260 FastNewContextStub stub(isolate(), heap_slots); 264 FastNewContextStub stub(isolate(), heap_slots);
261 __ CallStub(&stub); 265 __ CallStub(&stub);
262 // Result of FastNewContextStub is always in new space. 266 // Result of FastNewContextStub is always in new space.
263 need_write_barrier = false; 267 need_write_barrier = false;
264 } else { 268 } else {
265 __ push(edi); 269 __ push(edi);
266 __ CallRuntime(Runtime::kNewFunctionContext, 1); 270 __ CallRuntime(Runtime::kNewFunctionContext, 1);
267 } 271 }
268 RecordSafepoint(Safepoint::kNoLazyDeopt); 272 RecordSafepoint(Safepoint::kNoLazyDeopt);
269 // Context is returned in eax. It replaces the context passed to us. 273 // Context is returned in eax. It replaces the context passed to us.
(...skipping 5413 matching lines...) Expand 10 before | Expand all | Expand 10 after
5683 CallRuntime(Runtime::kPushBlockContext, 2, instr); 5687 CallRuntime(Runtime::kPushBlockContext, 2, instr);
5684 RecordSafepoint(Safepoint::kNoLazyDeopt); 5688 RecordSafepoint(Safepoint::kNoLazyDeopt);
5685 } 5689 }
5686 5690
5687 5691
5688 #undef __ 5692 #undef __
5689 5693
5690 } } // namespace v8::internal 5694 } } // namespace v8::internal
5691 5695
5692 #endif // V8_TARGET_ARCH_IA32 5696 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/hydrogen.cc ('k') | src/mips/lithium-codegen-mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698