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

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

Issue 12629004: Implement native call stub on ARM and native call redirection in ARM simulator. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 9 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) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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_OS_MACOS) 6 #if defined(TARGET_OS_MACOS)
7 7
8 #include "vm/os.h" 8 #include "vm/os.h"
9 9
10 #include <dlfcn.h> // NOLINT
10 #include <errno.h> // NOLINT 11 #include <errno.h> // NOLINT
11 #include <limits.h> // NOLINT 12 #include <limits.h> // NOLINT
12 #include <mach/mach.h> // NOLINT 13 #include <mach/mach.h> // NOLINT
13 #include <mach/clock.h> // NOLINT 14 #include <mach/clock.h> // NOLINT
14 #include <mach/mach_time.h> // NOLINT 15 #include <mach/mach_time.h> // NOLINT
15 #include <sys/time.h> // NOLINT 16 #include <sys/time.h> // NOLINT
16 #include <sys/resource.h> // NOLINT 17 #include <sys/resource.h> // NOLINT
17 #include <unistd.h> // NOLINT 18 #include <unistd.h> // NOLINT
18 19
19 #include "platform/utils.h" 20 #include "platform/utils.h"
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after
183 errno = 0; 184 errno = 0;
184 *value = strtoll(str, &endptr, base); 185 *value = strtoll(str, &endptr, base);
185 return ((errno == 0) && (endptr != str) && (*endptr == 0)); 186 return ((errno == 0) && (endptr != str) && (*endptr == 0));
186 } 187 }
187 188
188 189
189 void OS::RegisterCodeObservers() { 190 void OS::RegisterCodeObservers() {
190 } 191 }
191 192
192 193
194 const char* OS::ReverseLookupSymbol(uword address) {
195 // TODO(regis): This does not work for symbols of the main program.
196 // Passing -export-dynamic to the linker does not help.
197 Dl_info info;
198 if (dladdr(reinterpret_cast<void*>(address), &info)) {
199 return info.dli_sname;
200 } else {
201 return NULL;
202 }
203 }
204
205
193 void OS::PrintErr(const char* format, ...) { 206 void OS::PrintErr(const char* format, ...) {
194 va_list args; 207 va_list args;
195 va_start(args, format); 208 va_start(args, format);
196 VFPrint(stderr, format, args); 209 VFPrint(stderr, format, args);
197 va_end(args); 210 va_end(args);
198 } 211 }
199 212
200 213
201 void OS::InitOnce() { 214 void OS::InitOnce() {
202 // TODO(5411554): For now we check that initonce is called only once, 215 // TODO(5411554): For now we check that initonce is called only once,
(...skipping 14 matching lines...) Expand all
217 } 230 }
218 231
219 232
220 void OS::Exit(int code) { 233 void OS::Exit(int code) {
221 exit(code); 234 exit(code);
222 } 235 }
223 236
224 } // namespace dart 237 } // namespace dart
225 238
226 #endif // defined(TARGET_OS_MACOS) 239 #endif // defined(TARGET_OS_MACOS)
OLDNEW
« runtime/vm/os_linux.cc ('K') | « runtime/vm/os_linux.cc ('k') | runtime/vm/os_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698