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

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

Issue 10668034: Recognize leaf functions: skip stack check and populating the pc slot, store the pc slot lazily in … (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 5 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
OLDNEW
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, 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_macros.h" 8 #include "vm/assembler_macros.h"
9 9
10 #include "vm/assembler.h" 10 #include "vm/assembler.h"
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 // before a frame is created. 59 // before a frame is created.
60 if (offset != 0) { 60 if (offset != 0) {
61 __ addq(Address(RSP, 0), Immediate(-offset)); 61 __ addq(Address(RSP, 0), Immediate(-offset));
62 } 62 }
63 if (frame_size != 0) { 63 if (frame_size != 0) {
64 __ subq(RSP, Immediate(frame_size)); 64 __ subq(RSP, Immediate(frame_size));
65 } 65 }
66 } 66 }
67 67
68 68
69 void AssemblerMacros::EnterDartLeafFrame(Assembler* assembler,
70 intptr_t frame_size) {
71 __ EnterFrame(0);
72 Label dart_entry;
73 // Leave room for the saved PC, it will be filled in lazily, leave
74 // uninitialized.
75 __ subq(RSP, Immediate(frame_size + kWordSize));
76 #if defined(DEBUG)
77 // Store an invalid object in saved PC slot.
78 __ movq(Address(RBP, -kWordSize), Immediate(kHeapObjectTag));
79 #endif
80 }
81
82
69 void AssemblerMacros::EnterStubFrame(Assembler* assembler) { 83 void AssemblerMacros::EnterStubFrame(Assembler* assembler) {
70 __ EnterFrame(0); 84 __ EnterFrame(0);
71 __ pushq(Immediate(0)); // Push 0 in the saved PC area for stub frames. 85 __ pushq(Immediate(0)); // Push 0 in the saved PC area for stub frames.
72 } 86 }
73 87
74 #undef __ 88 #undef __
75 89
76 } // namespace dart 90 } // namespace dart
77 91
78 #endif // defined TARGET_ARCH_X64 92 #endif // defined TARGET_ARCH_X64
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698