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

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

Issue 19990006: Make sure that all objects store in the Code object live in old space. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 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 | « runtime/vm/object.h ('k') | no next file » | 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/object.h" 5 #include "vm/object.h"
6 6
7 #include "include/dart_api.h" 7 #include "include/dart_api.h"
8 #include "platform/assert.h" 8 #include "platform/assert.h"
9 #include "vm/assembler.h" 9 #include "vm/assembler.h"
10 #include "vm/cpu.h" 10 #include "vm/cpu.h"
(...skipping 8289 matching lines...) Expand 10 before | Expand all | Expand 10 after
8300 comments_.SetAt(idx * kNumberOfEntries + kCommentEntry, comment); 8300 comments_.SetAt(idx * kNumberOfEntries + kCommentEntry, comment);
8301 } 8301 }
8302 8302
8303 8303
8304 Code::Comments::Comments(const Array& comments) 8304 Code::Comments::Comments(const Array& comments)
8305 : comments_(comments) { 8305 : comments_(comments) {
8306 } 8306 }
8307 8307
8308 8308
8309 void Code::set_stackmaps(const Array& maps) const { 8309 void Code::set_stackmaps(const Array& maps) const {
8310 ASSERT(maps.IsOld());
8310 StorePointer(&raw_ptr()->stackmaps_, maps.raw()); 8311 StorePointer(&raw_ptr()->stackmaps_, maps.raw());
8311 } 8312 }
8312 8313
8313 8314
8314 void Code::set_deopt_info_array(const Array& array) const { 8315 void Code::set_deopt_info_array(const Array& array) const {
8316 ASSERT(array.IsOld());
8315 StorePointer(&raw_ptr()->deopt_info_array_, array.raw()); 8317 StorePointer(&raw_ptr()->deopt_info_array_, array.raw());
8316 } 8318 }
8317 8319
8318 8320
8319 void Code::set_object_table(const Array& array) const { 8321 void Code::set_object_table(const Array& array) const {
8322 ASSERT(array.IsOld());
8320 StorePointer(&raw_ptr()->object_table_, array.raw()); 8323 StorePointer(&raw_ptr()->object_table_, array.raw());
8321 } 8324 }
8322 8325
8323 8326
8324 void Code::set_static_calls_target_table(const Array& value) const { 8327 void Code::set_static_calls_target_table(const Array& value) const {
8325 StorePointer(&raw_ptr()->static_calls_target_table_, value.raw()); 8328 StorePointer(&raw_ptr()->static_calls_target_table_, value.raw());
8326 #if defined(DEBUG) 8329 #if defined(DEBUG)
8327 // Check that the table is sorted by pc offsets. 8330 // Check that the table is sorted by pc offsets.
8328 // FlowGraphCompiler::AddStaticCallTarget adds pc-offsets to the table while 8331 // FlowGraphCompiler::AddStaticCallTarget adds pc-offsets to the table while
8329 // emitting assembly. This guarantees that every succeeding pc-offset is 8332 // emitting assembly. This guarantees that every succeeding pc-offset is
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
8414 } 8417 }
8415 8418
8416 8419
8417 const Code::Comments& Code::comments() const { 8420 const Code::Comments& Code::comments() const {
8418 Comments* comments = new Code::Comments(Array::Handle(raw_ptr()->comments_)); 8421 Comments* comments = new Code::Comments(Array::Handle(raw_ptr()->comments_));
8419 return *comments; 8422 return *comments;
8420 } 8423 }
8421 8424
8422 8425
8423 void Code::set_comments(const Code::Comments& comments) const { 8426 void Code::set_comments(const Code::Comments& comments) const {
8427 ASSERT(comments.comments_.IsOld());
8424 StorePointer(&raw_ptr()->comments_, comments.comments_.raw()); 8428 StorePointer(&raw_ptr()->comments_, comments.comments_.raw());
8425 } 8429 }
8426 8430
8427 8431
8428 RawCode* Code::New(intptr_t pointer_offsets_length) { 8432 RawCode* Code::New(intptr_t pointer_offsets_length) {
8429 if (pointer_offsets_length < 0 || pointer_offsets_length > kMaxElements) { 8433 if (pointer_offsets_length < 0 || pointer_offsets_length > kMaxElements) {
8430 // This should be caught before we reach here. 8434 // This should be caught before we reach here.
8431 FATAL1("Fatal error in Code::New: invalid pointer_offsets_length %"Pd"\n", 8435 FATAL1("Fatal error in Code::New: invalid pointer_offsets_length %"Pd"\n",
8432 pointer_offsets_length); 8436 pointer_offsets_length);
8433 } 8437 }
(...skipping 5922 matching lines...) Expand 10 before | Expand all | Expand 10 after
14356 } 14360 }
14357 14361
14358 14362
14359 void MirrorReference::PrintToJSONStream(JSONStream* stream, bool ref) const { 14363 void MirrorReference::PrintToJSONStream(JSONStream* stream, bool ref) const {
14360 stream->OpenObject(); 14364 stream->OpenObject();
14361 stream->CloseObject(); 14365 stream->CloseObject();
14362 } 14366 }
14363 14367
14364 14368
14365 } // namespace dart 14369 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/object.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698