OLD | NEW |
1 // Copyright (c) 2011, 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/assembler.h" | 5 #include "vm/assembler.h" |
| 6 |
| 7 #include "platform/utils.h" |
6 #include "vm/cpu.h" | 8 #include "vm/cpu.h" |
7 #include "vm/heap.h" | 9 #include "vm/heap.h" |
8 #include "vm/memory_region.h" | 10 #include "vm/memory_region.h" |
9 #include "vm/os.h" | 11 #include "vm/os.h" |
10 #include "vm/utils.h" | |
11 #include "vm/zone.h" | 12 #include "vm/zone.h" |
12 | 13 |
13 namespace dart { | 14 namespace dart { |
14 | 15 |
15 static uword NewContents(int capacity) { | 16 static uword NewContents(int capacity) { |
16 Zone* zone = Isolate::Current()->current_zone(); | 17 Zone* zone = Isolate::Current()->current_zone(); |
17 uword result = zone->Allocate(capacity); | 18 uword result = zone->Allocate(capacity); |
18 #if defined(DEBUG) | 19 #if defined(DEBUG) |
19 // Initialize the buffer with kBreakPointInstruction to force a break | 20 // Initialize the buffer with kBreakPointInstruction to force a break |
20 // point if we ever execute an uninitialized part of the code buffer. | 21 // point if we ever execute an uninitialized part of the code buffer. |
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
173 | 174 |
174 void Assembler::Unreachable(const char* message) { | 175 void Assembler::Unreachable(const char* message) { |
175 const char* format = "Unreachable: %s"; | 176 const char* format = "Unreachable: %s"; |
176 const intptr_t len = OS::SNPrint(NULL, 0, format, message); | 177 const intptr_t len = OS::SNPrint(NULL, 0, format, message); |
177 char* buffer = reinterpret_cast<char*>(malloc(len + 1)); | 178 char* buffer = reinterpret_cast<char*>(malloc(len + 1)); |
178 OS::SNPrint(buffer, len + 1, format, message); | 179 OS::SNPrint(buffer, len + 1, format, message); |
179 Stop(buffer); | 180 Stop(buffer); |
180 } | 181 } |
181 | 182 |
182 } // namespace dart | 183 } // namespace dart |
OLD | NEW |