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

Side by Side Diff: vm/os_macos.cc

Issue 10664004: Fix issue 1968, replace usage of inline 'asm' constructs in 'stack alignment', 'jump to exception h… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/runtime/
Patch Set: Created 8 years, 6 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 | « vm/os_linux.cc ('k') | vm/os_win.cc » ('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) 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/os.h" 5 #include "vm/os.h"
6 6
7 #include <errno.h> 7 #include <errno.h>
8 #include <limits.h> 8 #include <limits.h>
9 #include <mach/mach.h> 9 #include <mach/mach.h>
10 #include <mach/clock.h> 10 #include <mach/clock.h>
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 return sysconf(_SC_NPROCESSORS_ONLN); 97 return sysconf(_SC_NPROCESSORS_ONLN);
98 } 98 }
99 99
100 100
101 void OS::Sleep(int64_t millis) { 101 void OS::Sleep(int64_t millis) {
102 // TODO(5411554): For now just use usleep we may have to revisit this. 102 // TODO(5411554): For now just use usleep we may have to revisit this.
103 usleep(millis * 1000); 103 usleep(millis * 1000);
104 } 104 }
105 105
106 106
107 void OS::DebugBreak() {
108 #if defined(HOST_ARCH_X64) || defined(HOST_ARCH_IA32)
109 asm("int $3");
110 #else
111 #error Unsupported architecture.
112 #endif
113 }
114
115
116 void OS::Print(const char* format, ...) { 107 void OS::Print(const char* format, ...) {
117 va_list args; 108 va_list args;
118 va_start(args, format); 109 va_start(args, format);
119 VFPrint(stdout, format, args); 110 VFPrint(stdout, format, args);
120 va_end(args); 111 va_end(args);
121 } 112 }
122 113
123 114
124 void OS::VFPrint(FILE* stream, const char* format, va_list args) { 115 void OS::VFPrint(FILE* stream, const char* format, va_list args) {
125 vfprintf(stream, format, args); 116 vfprintf(stream, format, args);
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
166 void OS::Abort() { 157 void OS::Abort() {
167 abort(); 158 abort();
168 } 159 }
169 160
170 161
171 void OS::Exit(int code) { 162 void OS::Exit(int code) {
172 exit(code); 163 exit(code);
173 } 164 }
174 165
175 } // namespace dart 166 } // namespace dart
OLDNEW
« no previous file with comments | « vm/os_linux.cc ('k') | vm/os_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698