| OLD | NEW |
| 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, 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 #include "vm/cpu.h" | 6 #include "vm/cpu.h" |
| 7 #include "vm/heap.h" | 7 #include "vm/heap.h" |
| 8 #include "vm/memory_region.h" | 8 #include "vm/memory_region.h" |
| 9 #include "vm/utils.h" | 9 #include "vm/utils.h" |
| 10 #include "vm/zone.h" | 10 #include "vm/zone.h" |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 146 // Since we are going to store the handle as part of the fixup information | 146 // Since we are going to store the handle as part of the fixup information |
| 147 // the handle needs to be a zone handle. | 147 // the handle needs to be a zone handle. |
| 148 ASSERT(object.IsZoneHandle()); | 148 ASSERT(object.IsZoneHandle()); |
| 149 EmitFixup(new PatchCodeWithHandle(pointer_offsets_, object)); | 149 EmitFixup(new PatchCodeWithHandle(pointer_offsets_, object)); |
| 150 cursor_ += kWordSize; // Reserve space for pointer. | 150 cursor_ += kWordSize; // Reserve space for pointer. |
| 151 } | 151 } |
| 152 | 152 |
| 153 | 153 |
| 154 // Shared macros are implemented here. | 154 // Shared macros are implemented here. |
| 155 void Assembler::Unimplemented(const char* message) { | 155 void Assembler::Unimplemented(const char* message) { |
| 156 Stop("unimplemented"); | 156 const char* format = "Unimplemented: %s"; |
| 157 const intptr_t len = snprintf(NULL, 0, format, message); |
| 158 char* buffer = reinterpret_cast<char*>(malloc(len + 1)); |
| 159 snprintf(buffer, len + 1, format, message); |
| 160 Stop(buffer); |
| 157 } | 161 } |
| 158 | 162 |
| 159 | 163 |
| 160 void Assembler::Untested(const char* message) { | 164 void Assembler::Untested(const char* message) { |
| 161 Stop("untested"); | 165 const char* format = "Untested: %s"; |
| 166 const intptr_t len = snprintf(NULL, 0, format, message); |
| 167 char* buffer = reinterpret_cast<char*>(malloc(len + 1)); |
| 168 snprintf(buffer, len + 1, format, message); |
| 169 Stop(buffer); |
| 162 } | 170 } |
| 163 | 171 |
| 164 | 172 |
| 165 void Assembler::Unreachable(const char* message) { | 173 void Assembler::Unreachable(const char* message) { |
| 166 Stop("unreachable"); | 174 const char* format = "Unreachable: %s"; |
| 175 const intptr_t len = snprintf(NULL, 0, format, message); |
| 176 char* buffer = reinterpret_cast<char*>(malloc(len + 1)); |
| 177 snprintf(buffer, len + 1, format, message); |
| 178 Stop(buffer); |
| 167 } | 179 } |
| 168 | 180 |
| 169 } // namespace dart | 181 } // namespace dart |
| OLD | NEW |