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

Side by Side Diff: runtime/vm/stub_code_ia32.cc

Issue 14935005: Implement a variation of scalar replacement for non-escaping allocations. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: address comments Created 7 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 | Annotate | Revision Log
« no previous file with comments | « runtime/vm/stub_code_arm.cc ('k') | runtime/vm/stub_code_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 (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "vm/globals.h" 5 #include "vm/globals.h"
6 #if defined(TARGET_ARCH_IA32) 6 #if defined(TARGET_ARCH_IA32)
7 7
8 #include "vm/assembler.h" 8 #include "vm/assembler.h"
9 #include "vm/compiler.h" 9 #include "vm/compiler.h"
10 #include "vm/dart_entry.h" 10 #include "vm/dart_entry.h"
(...skipping 376 matching lines...) Expand 10 before | Expand all | Expand 10 after
387 __ LeaveFrame(); 387 __ LeaveFrame();
388 __ movl(EBP, EAX); 388 __ movl(EBP, EAX);
389 389
390 // Frame is fully rewritten at this point and it is safe to perform a GC. 390 // Frame is fully rewritten at this point and it is safe to perform a GC.
391 // Materialize any objects that were deferred by FillFrame because they 391 // Materialize any objects that were deferred by FillFrame because they
392 // require allocation. 392 // require allocation.
393 __ EnterStubFrame(); 393 __ EnterStubFrame();
394 if (preserve_eax) { 394 if (preserve_eax) {
395 __ pushl(EBX); // Preserve result, it will be GC-d here. 395 __ pushl(EBX); // Preserve result, it will be GC-d here.
396 } 396 }
397 __ CallRuntime(kDeoptimizeMaterializeDoublesRuntimeEntry); 397 __ pushl(Immediate(Smi::RawValue(0))); // Space for the result.
398 __ CallRuntime(kDeoptimizeMaterializeRuntimeEntry);
399 // Result tells stub how many bytes to remove from the expression stack
400 // of the bottom-most frame. They were used as materialization arguments.
401 __ popl(EBX);
402 __ SmiUntag(EBX);
398 if (preserve_eax) { 403 if (preserve_eax) {
399 __ popl(EAX); // Restore result. 404 __ popl(EAX); // Restore result.
400 } 405 }
401 __ LeaveFrame(); 406 __ LeaveFrame();
407
408 __ popl(ECX); // Pop return address.
409 __ addl(ESP, EBX); // Remove materialization arguments.
410 __ pushl(ECX); // Push return address.
402 __ ret(); 411 __ ret();
403 } 412 }
404 413
405 414
406 // TOS: return address + call-instruction-size (5 bytes). 415 // TOS: return address + call-instruction-size (5 bytes).
407 // EAX: result, must be preserved 416 // EAX: result, must be preserved
408 void StubCode::GenerateDeoptimizeLazyStub(Assembler* assembler) { 417 void StubCode::GenerateDeoptimizeLazyStub(Assembler* assembler) {
409 // Correct return address to point just after the call that is being 418 // Correct return address to point just after the call that is being
410 // deoptimized. 419 // deoptimized.
411 __ popl(EBX); 420 __ popl(EBX);
(...skipping 1699 matching lines...) Expand 10 before | Expand all | Expand 10 after
2111 __ Bind(&done); 2120 __ Bind(&done);
2112 __ popl(temp); 2121 __ popl(temp);
2113 __ popl(right); 2122 __ popl(right);
2114 __ popl(left); 2123 __ popl(left);
2115 __ ret(); 2124 __ ret();
2116 } 2125 }
2117 2126
2118 } // namespace dart 2127 } // namespace dart
2119 2128
2120 #endif // defined TARGET_ARCH_IA32 2129 #endif // defined TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « runtime/vm/stub_code_arm.cc ('k') | runtime/vm/stub_code_mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698