| OLD | NEW |
| 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/assembler.h" | 5 #include "vm/assembler.h" |
| 6 | 6 |
| 7 #include "platform/utils.h" | 7 #include "platform/utils.h" |
| 8 #include "vm/cpu.h" | 8 #include "vm/cpu.h" |
| 9 #include "vm/heap.h" | 9 #include "vm/heap.h" |
| 10 #include "vm/memory_region.h" | 10 #include "vm/memory_region.h" |
| 11 #include "vm/os.h" | 11 #include "vm/os.h" |
| 12 #include "vm/zone.h" | 12 #include "vm/zone.h" |
| 13 | 13 |
| 14 namespace dart { | 14 namespace dart { |
| 15 | 15 |
| 16 static uword NewContents(intptr_t capacity) { | 16 static uword NewContents(intptr_t capacity) { |
| 17 StackZone* zone = Isolate::Current()->current_zone(); | 17 Zone* zone = Isolate::Current()->current_zone(); |
| 18 uword result = zone->AllocUnsafe(capacity); | 18 uword result = zone->AllocUnsafe(capacity); |
| 19 #if defined(DEBUG) | 19 #if defined(DEBUG) |
| 20 // Initialize the buffer with kBreakPointInstruction to force a break | 20 // Initialize the buffer with kBreakPointInstruction to force a break |
| 21 // 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. |
| 22 Assembler::InitializeMemoryWithBreakpoints(result, capacity); | 22 Assembler::InitializeMemoryWithBreakpoints(result, capacity); |
| 23 #endif | 23 #endif |
| 24 return result; | 24 return result; |
| 25 } | 25 } |
| 26 | 26 |
| 27 | 27 |
| (...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 179 | 179 |
| 180 void Assembler::Unreachable(const char* message) { | 180 void Assembler::Unreachable(const char* message) { |
| 181 const char* format = "Unreachable: %s"; | 181 const char* format = "Unreachable: %s"; |
| 182 const intptr_t len = OS::SNPrint(NULL, 0, format, message); | 182 const intptr_t len = OS::SNPrint(NULL, 0, format, message); |
| 183 char* buffer = reinterpret_cast<char*>(malloc(len + 1)); | 183 char* buffer = reinterpret_cast<char*>(malloc(len + 1)); |
| 184 OS::SNPrint(buffer, len + 1, format, message); | 184 OS::SNPrint(buffer, len + 1, format, message); |
| 185 Stop(buffer); | 185 Stop(buffer); |
| 186 } | 186 } |
| 187 | 187 |
| 188 } // namespace dart | 188 } // namespace dart |
| OLD | NEW |