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

Side by Side Diff: runtime/vm/stub_code_x64.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_mips.cc ('k') | tests/language/allocation_sinking_vm_test.dart » ('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_X64) 6 #if defined(TARGET_ARCH_X64)
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 369 matching lines...) Expand 10 before | Expand all | Expand 10 after
380 __ LeaveFrame(); 380 __ LeaveFrame();
381 __ movq(RBP, RAX); 381 __ movq(RBP, RAX);
382 382
383 // Frame is fully rewritten at this point and it is safe to perform a GC. 383 // Frame is fully rewritten at this point and it is safe to perform a GC.
384 // Materialize any objects that were deferred by FillFrame because they 384 // Materialize any objects that were deferred by FillFrame because they
385 // require allocation. 385 // require allocation.
386 __ EnterStubFrame(); 386 __ EnterStubFrame();
387 if (preserve_rax) { 387 if (preserve_rax) {
388 __ pushq(RBX); // Preserve result, it will be GC-d here. 388 __ pushq(RBX); // Preserve result, it will be GC-d here.
389 } 389 }
390 __ CallRuntime(kDeoptimizeMaterializeDoublesRuntimeEntry); 390 __ pushq(Immediate(Smi::RawValue(0))); // Space for the result.
391 __ CallRuntime(kDeoptimizeMaterializeRuntimeEntry);
392 // Result tells stub how many bytes to remove from the expression stack
393 // of the bottom-most frame. They were used as materialization arguments.
394 __ popq(RBX);
395 __ SmiUntag(RBX);
391 if (preserve_rax) { 396 if (preserve_rax) {
392 __ popq(RAX); // Restore result. 397 __ popq(RAX); // Restore result.
393 } 398 }
394 __ LeaveFrame(); 399 __ LeaveFrame();
395 400
401 __ popq(RCX); // Pop return address.
402 __ addq(RSP, RBX); // Remove materialization arguments.
403 __ pushq(RCX); // Push return address.
396 __ ret(); 404 __ ret();
397 } 405 }
398 406
399 407
400 // TOS: return address + call-instruction-size (5 bytes). 408 // TOS: return address + call-instruction-size (5 bytes).
401 // RAX: result, must be preserved 409 // RAX: result, must be preserved
402 void StubCode::GenerateDeoptimizeLazyStub(Assembler* assembler) { 410 void StubCode::GenerateDeoptimizeLazyStub(Assembler* assembler) {
403 // Correct return address to point just after the call that is being 411 // Correct return address to point just after the call that is being
404 // deoptimized. 412 // deoptimized.
405 __ popq(RBX); 413 __ popq(RBX);
(...skipping 1660 matching lines...) Expand 10 before | Expand all | Expand 10 after
2066 __ cmpq(left, right); 2074 __ cmpq(left, right);
2067 __ Bind(&done); 2075 __ Bind(&done);
2068 __ popq(right); 2076 __ popq(right);
2069 __ popq(left); 2077 __ popq(left);
2070 __ ret(); 2078 __ ret();
2071 } 2079 }
2072 2080
2073 } // namespace dart 2081 } // namespace dart
2074 2082
2075 #endif // defined TARGET_ARCH_X64 2083 #endif // defined TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « runtime/vm/stub_code_mips.cc ('k') | tests/language/allocation_sinking_vm_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698