Mercurial > projects > ldc
comparison runtime/internal/memory.d @ 1151:3cf0066e6faf
- Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
- Eliminated the DLRValue DValue.
- Implemented proactive handling of l-value CastExpS.
- Minor tweak in runtime memory.d .
author | Tomas Lindquist Olsen <tomas.l.olsen gmail.com> |
---|---|
date | Sat, 28 Mar 2009 05:00:43 +0100 |
parents | bd000a7fab18 |
children | 4a5eea0334e5 |
comparison
equal
deleted
inserted
replaced
1150:2a687353c84d | 1151:3cf0066e6faf |
---|---|
66 else | 66 else |
67 { | 67 { |
68 import tango.stdc.posix.dlfcn; | 68 import tango.stdc.posix.dlfcn; |
69 } | 69 } |
70 } | 70 } |
71 version(LDC) | 71 pragma(intrinsic, "llvm.frameaddress") |
72 { | 72 { |
73 pragma(intrinsic, "llvm.frameaddress") | 73 void* llvm_frameaddress(uint level=0); |
74 { | |
75 void* llvm_frameaddress(uint level=0); | |
76 } | |
77 } | 74 } |
78 } | 75 } |
79 | 76 |
80 | 77 |
81 /** | 78 /** |
145 /** | 142 /** |
146 * | 143 * |
147 */ | 144 */ |
148 extern (C) void* rt_stackTop() | 145 extern (C) void* rt_stackTop() |
149 { | 146 { |
150 version(LDC) | 147 version( D_InlineAsm_X86 ) |
151 { | |
152 return llvm_frameaddress(); | |
153 } | |
154 else version( D_InlineAsm_X86 ) | |
155 { | 148 { |
156 asm | 149 asm |
157 { | 150 { |
158 naked; | 151 naked; |
159 mov EAX, ESP; | 152 mov EAX, ESP; |
160 ret; | 153 ret; |
161 } | 154 } |
162 } | 155 } |
163 else | 156 else |
164 { | 157 { |
165 static assert( false, "Architecture not supported." ); | 158 return llvm_frameaddress(); |
166 } | 159 } |
167 } | 160 } |
168 | 161 |
169 | 162 |
170 private | 163 private |