Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(187)

Side by Side Diff: runtime/vm/assembler.cc

Issue 10786003: Ensure objects emitted in code are allocated in old space. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: address review comments Created 8 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | runtime/vm/ast.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/ast.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698