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

Side by Side Diff: vm/object.cc

Issue 9027017: - Promote objects from new gen to old space if they survived a scavenge. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/runtime/
Patch Set: '' Created 9 years 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 | « vm/intrinsifier_ia32.cc ('k') | vm/pages.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) 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/object.h" 5 #include "vm/object.h"
6 6
7 #include "vm/assembler.h" 7 #include "vm/assembler.h"
8 #include "vm/assert.h" 8 #include "vm/assert.h"
9 #include "vm/bigint_operations.h" 9 #include "vm/bigint_operations.h"
10 #include "vm/bootstrap.h" 10 #include "vm/bootstrap.h"
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after
215 } 215 }
216 216
217 Heap* heap = Isolate::Current()->heap(); 217 Heap* heap = Isolate::Current()->heap();
218 // Allocate and initialize the null instance, except its class_ field. 218 // Allocate and initialize the null instance, except its class_ field.
219 // 'null_' must be the first object allocated as it is used in allocation to 219 // 'null_' must be the first object allocated as it is used in allocation to
220 // clear the object. 220 // clear the object.
221 { 221 {
222 uword address = heap->Allocate(Instance::InstanceSize(), Heap::kOld); 222 uword address = heap->Allocate(Instance::InstanceSize(), Heap::kOld);
223 null_ = reinterpret_cast<RawInstance*>(address + kHeapObjectTag); 223 null_ = reinterpret_cast<RawInstance*>(address + kHeapObjectTag);
224 InitializeObject(address, Instance::InstanceSize()); // Using 'null_'. 224 InitializeObject(address, Instance::InstanceSize()); // Using 'null_'.
225 null_->ptr()->tags_ = 0;
225 } 226 }
226 227
227 // Initialize object_store empty array to null_ in order to be able to check 228 // Initialize object_store empty array to null_ in order to be able to check
228 // if the empty array was allocated (RAW_NULL is not available). 229 // if the empty array was allocated (RAW_NULL is not available).
229 Isolate::Current()->object_store()->set_empty_array(Array::Handle()); 230 Isolate::Current()->object_store()->set_empty_array(Array::Handle());
230 231
231 Class& cls = Class::Handle(); 232 Class& cls = Class::Handle();
232 233
233 // Allocate and initialize the class class. 234 // Allocate and initialize the class class.
234 // At this point, class_class_ is still RAW_NULL, i.e. different from 'null_', 235 // At this point, class_class_ is still RAW_NULL, i.e. different from 'null_',
(...skipping 7255 matching lines...) Expand 10 before | Expand all | Expand 10 after
7490 const String& str = String::Handle(pattern()); 7491 const String& str = String::Handle(pattern());
7491 const char* format = "JSRegExp: pattern=%s flags=%s"; 7492 const char* format = "JSRegExp: pattern=%s flags=%s";
7492 intptr_t len = OS::SNPrint(NULL, 0, format, str.ToCString(), Flags()); 7493 intptr_t len = OS::SNPrint(NULL, 0, format, str.ToCString(), Flags());
7493 char* chars = reinterpret_cast<char*>( 7494 char* chars = reinterpret_cast<char*>(
7494 Isolate::Current()->current_zone()->Allocate(len + 1)); 7495 Isolate::Current()->current_zone()->Allocate(len + 1));
7495 OS::SNPrint(chars, (len + 1), format, str.ToCString(), Flags()); 7496 OS::SNPrint(chars, (len + 1), format, str.ToCString(), Flags());
7496 return chars; 7497 return chars;
7497 } 7498 }
7498 7499
7499 } // namespace dart 7500 } // namespace dart
OLDNEW
« no previous file with comments | « vm/intrinsifier_ia32.cc ('k') | vm/pages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698