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

Unified Diff: src/vm/heap.cc

Issue 2067483002: More compact snapshots. (Closed) Base URL: git@github.com:dartino/sdk.git@master
Patch Set: Feedback Created 4 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/vm/heap.h ('k') | src/vm/interpreter_arm.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/vm/heap.cc
diff --git a/src/vm/heap.cc b/src/vm/heap.cc
index 890fb703758a1f7d32fb91ebc3d016d450189bee..2a1e96d5d4f85100995613a8477b2c4f2c0e4eca 100644
--- a/src/vm/heap.cc
+++ b/src/vm/heap.cc
@@ -62,6 +62,17 @@ Object* Heap::Allocate(uword size) {
return HeapObject::FromAddress(result);
}
+Object* Heap::CreateBooleanObject(uword position, Class* the_class,
+ Object* init_value) {
+ HeapObject* raw_result = HeapObject::FromAddress(position);
+ Instance* result = reinterpret_cast<Instance*>(raw_result);
+ result->set_class(the_class);
+ result->set_immutable(true);
+ result->InitializeIdentityHashCode(random());
+ result->Initialize(the_class->instance_format().fixed_size(), init_value);
+ return result;
+}
+
Object* Heap::CreateInstance(Class* the_class, Object* init_value,
bool immutable) {
uword size = the_class->instance_format().fixed_size();
« no previous file with comments | « src/vm/heap.h ('k') | src/vm/interpreter_arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698