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 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
141 private: | 141 private: |
142 ZoneGrowableArray<int>* pointer_offsets_; | 142 ZoneGrowableArray<int>* pointer_offsets_; |
143 const Object& object_; | 143 const Object& object_; |
144 }; | 144 }; |
145 | 145 |
146 | 146 |
147 void AssemblerBuffer::EmitObject(const Object& object) { | 147 void AssemblerBuffer::EmitObject(const Object& object) { |
148 // Since we are going to store the handle as part of the fixup information | 148 // Since we are going to store the handle as part of the fixup information |
149 // the handle needs to be a zone handle. | 149 // the handle needs to be a zone handle. |
150 ASSERT(object.IsZoneHandle()); | 150 ASSERT(object.IsZoneHandle()); |
| 151 ASSERT(object.IsOld()); |
151 EmitFixup(new PatchCodeWithHandle(pointer_offsets_, object)); | 152 EmitFixup(new PatchCodeWithHandle(pointer_offsets_, object)); |
152 cursor_ += kWordSize; // Reserve space for pointer. | 153 cursor_ += kWordSize; // Reserve space for pointer. |
153 } | 154 } |
154 | 155 |
155 | 156 |
156 // Shared macros are implemented here. | 157 // Shared macros are implemented here. |
157 void Assembler::Unimplemented(const char* message) { | 158 void Assembler::Unimplemented(const char* message) { |
158 const char* format = "Unimplemented: %s"; | 159 const char* format = "Unimplemented: %s"; |
159 const intptr_t len = OS::SNPrint(NULL, 0, format, message); | 160 const intptr_t len = OS::SNPrint(NULL, 0, format, message); |
160 char* buffer = reinterpret_cast<char*>(malloc(len + 1)); | 161 char* buffer = reinterpret_cast<char*>(malloc(len + 1)); |
(...skipping 13 matching lines...) Expand all Loading... |
174 | 175 |
175 void Assembler::Unreachable(const char* message) { | 176 void Assembler::Unreachable(const char* message) { |
176 const char* format = "Unreachable: %s"; | 177 const char* format = "Unreachable: %s"; |
177 const intptr_t len = OS::SNPrint(NULL, 0, format, message); | 178 const intptr_t len = OS::SNPrint(NULL, 0, format, message); |
178 char* buffer = reinterpret_cast<char*>(malloc(len + 1)); | 179 char* buffer = reinterpret_cast<char*>(malloc(len + 1)); |
179 OS::SNPrint(buffer, len + 1, format, message); | 180 OS::SNPrint(buffer, len + 1, format, message); |
180 Stop(buffer); | 181 Stop(buffer); |
181 } | 182 } |
182 | 183 |
183 } // namespace dart | 184 } // namespace dart |
OLD | NEW |