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

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

Issue 11773008: - Preallocate non-named ArgumentsDescriptors with a small amount of parameters. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 11 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/dart_entry.cc ('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/bigint_operations.h" 10 #include "vm/bigint_operations.h"
(...skipping 396 matching lines...) Expand 10 before | Expand all | Expand 10 after
407 language_error_class_ = cls.raw(); 407 language_error_class_ = cls.raw();
408 408
409 cls = Class::New<UnhandledException>(); 409 cls = Class::New<UnhandledException>();
410 unhandled_exception_class_ = cls.raw(); 410 unhandled_exception_class_ = cls.raw();
411 411
412 cls = Class::New<UnwindError>(); 412 cls = Class::New<UnwindError>();
413 unwind_error_class_ = cls.raw(); 413 unwind_error_class_ = cls.raw();
414 414
415 ASSERT(class_class() != null_); 415 ASSERT(class_class() != null_);
416 416
417 // Pre-allocate the Array and OneByteString class in the vm isolate so that 417 // Pre-allocate classes in the vm isolate so that we can for example create a
418 // we can create a symbol table and populate it with some frequently used 418 // symbol table and populate it with some frequently used strings as symbols.
419 // strings as symbols.
420 cls = Class::New<Array>(); 419 cls = Class::New<Array>();
421 isolate->object_store()->set_array_class(cls); 420 isolate->object_store()->set_array_class(cls);
421 cls.set_type_arguments_field_offset(Array::type_arguments_offset());
422 cls = Class::New<ImmutableArray>();
423 isolate->object_store()->set_immutable_array_class(cls);
424 cls.set_type_arguments_field_offset(Array::type_arguments_offset());
422 cls = Class::NewStringClass(kOneByteStringCid); 425 cls = Class::NewStringClass(kOneByteStringCid);
423 isolate->object_store()->set_one_byte_string_class(cls); 426 isolate->object_store()->set_one_byte_string_class(cls);
424 cls = Class::NewStringClass(kTwoByteStringCid); 427 cls = Class::NewStringClass(kTwoByteStringCid);
425 isolate->object_store()->set_two_byte_string_class(cls); 428 isolate->object_store()->set_two_byte_string_class(cls);
426 429
427 // Allocate and initialize the empty_array instance. 430 // Allocate and initialize the empty_array instance.
428 { 431 {
429 uword address = heap->Allocate(Array::InstanceSize(0), Heap::kOld); 432 uword address = heap->Allocate(Array::InstanceSize(0), Heap::kOld);
430 *empty_array_ = reinterpret_cast<RawArray*>(address + kHeapObjectTag); 433 *empty_array_ = reinterpret_cast<RawArray*>(address + kHeapObjectTag);
431 InitializeObject(address, kArrayCid, Array::InstanceSize(0)); 434 InitializeObject(address, kArrayCid, Array::InstanceSize(0));
(...skipping 11987 matching lines...) Expand 10 before | Expand all | Expand 10 after
12419 } 12422 }
12420 return result.raw(); 12423 return result.raw();
12421 } 12424 }
12422 12425
12423 12426
12424 const char* WeakProperty::ToCString() const { 12427 const char* WeakProperty::ToCString() const {
12425 return "_WeakProperty"; 12428 return "_WeakProperty";
12426 } 12429 }
12427 12430
12428 } // namespace dart 12431 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/dart_entry.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698