| 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" |
| (...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 144 | 144 |
| 145 private: | 145 private: |
| 146 ZoneGrowableArray<int>* pointer_offsets_; | 146 ZoneGrowableArray<int>* pointer_offsets_; |
| 147 const Object& object_; | 147 const Object& object_; |
| 148 }; | 148 }; |
| 149 | 149 |
| 150 | 150 |
| 151 void AssemblerBuffer::EmitObject(const Object& object) { | 151 void AssemblerBuffer::EmitObject(const Object& object) { |
| 152 // Since we are going to store the handle as part of the fixup information | 152 // Since we are going to store the handle as part of the fixup information |
| 153 // the handle needs to be a zone handle. | 153 // the handle needs to be a zone handle. |
| 154 ASSERT(object.IsZoneHandle()); | 154 ASSERT(object.IsNotTemporaryScopedHandle()); |
| 155 ASSERT(object.IsOld()); | 155 ASSERT(object.IsOld()); |
| 156 EmitFixup(new PatchCodeWithHandle(pointer_offsets_, object)); | 156 EmitFixup(new PatchCodeWithHandle(pointer_offsets_, object)); |
| 157 cursor_ += kWordSize; // Reserve space for pointer. | 157 cursor_ += kWordSize; // Reserve space for pointer. |
| 158 } | 158 } |
| 159 | 159 |
| 160 | 160 |
| 161 // Shared macros are implemented here. | 161 // Shared macros are implemented here. |
| 162 void Assembler::Unimplemented(const char* message) { | 162 void Assembler::Unimplemented(const char* message) { |
| 163 const char* format = "Unimplemented: %s"; | 163 const char* format = "Unimplemented: %s"; |
| 164 const intptr_t len = OS::SNPrint(NULL, 0, format, message); | 164 const intptr_t len = OS::SNPrint(NULL, 0, format, message); |
| (...skipping 14 matching lines...) Expand all 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 |