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

Side by Side Diff: runtime/vm/assembler_macros_ia32.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_IA32) 6 #if defined(TARGET_ARCH_IA32)
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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 // before a frame is created. 56 // before a frame is created.
57 if (offset != 0) { 57 if (offset != 0) {
58 __ addl(Address(ESP, 0), Immediate(-offset)); 58 __ addl(Address(ESP, 0), Immediate(-offset));
59 } 59 }
60 if (frame_size != 0) { 60 if (frame_size != 0) {
61 __ subl(ESP, Immediate(frame_size)); 61 __ subl(ESP, Immediate(frame_size));
62 } 62 }
63 } 63 }
64 64
65 65
66 void AssemblerMacros::EnterDartLeafFrame(Assembler* assembler,
67 intptr_t frame_size) {
68 __ EnterFrame(0);
69 Label dart_entry;
70 // Leave room for the saved PC, it will be filled in lazily, leave
71 // uninitialized.
72 __ subl(ESP, Immediate(frame_size + kWordSize));
73 #if defined(DEBUG)
74 // Store an invalid object in saved PC slot.
75 __ movl(Address(EBP, -kWordSize), Immediate(kHeapObjectTag));
76 #endif
77 }
78
79
66 void AssemblerMacros::EnterStubFrame(Assembler* assembler) { 80 void AssemblerMacros::EnterStubFrame(Assembler* assembler) {
67 __ EnterFrame(0); 81 __ EnterFrame(0);
68 __ pushl(Immediate(0)); // Push 0 in the saved PC area for stub frames. 82 __ pushl(Immediate(0)); // Push 0 in the saved PC area for stub frames.
69 } 83 }
70 84
71 #undef __ 85 #undef __
72 86
73 } // namespace dart 87 } // namespace dart
74 88
75 #endif // defined TARGET_ARCH_IA32 89 #endif // defined TARGET_ARCH_IA32
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698