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

Unified Diff: vm/object.cc

Issue 9700079: Fix for issue 2124 - Dart VM crashes on windows (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/runtime/
Patch Set: Created 8 years, 9 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: vm/object.cc
===================================================================
--- vm/object.cc (revision 5548)
+++ vm/object.cc (working copy)
@@ -8326,20 +8326,21 @@
if (leftover_size >= Array::InstanceSize(0)) {
// As we have enough space to use an array object, update the leftover
// space as an Array object.
- new_array.raw_ = reinterpret_cast<RawArray*>(RawObject::FromAddr(addr));
- new_array.raw_ptr()->class_ = isolate->object_store()->array_class();
+ RawArray* raw = reinterpret_cast<RawArray*>(RawObject::FromAddr(addr));
+ raw->ptr()->class_ = isolate->object_store()->array_class();
tags = RawObject::SizeTag::update(leftover_size, tags);
- new_array.raw_ptr()->tags_ = tags;
+ raw->ptr()->tags_ = tags;
intptr_t leftover_len =
((leftover_size - Array::InstanceSize(0)) / kWordSize);
- new_array.SetLength(leftover_len);
+ raw->ptr()->tags_ = tags;
+ raw->ptr()->length_ = Smi::New(leftover_len);
} else {
// Update the leftover space as a basic object.
ASSERT(leftover_size == Object::InstanceSize());
- Object& new_object = Object::Handle(isolate, RawObject::FromAddr(addr));
- new_object.raw()->ptr()->class_ = isolate->object_store()->object_class();
+ RawObject* raw = reinterpret_cast<RawObject*>(RawObject::FromAddr(addr));
+ raw->ptr()->class_ = isolate->object_store()->object_class();
tags = RawObject::SizeTag::update(leftover_size, tags);
- new_object.raw()->ptr()->tags_ = tags;
+ raw->ptr()->tags_ = tags;
}
}
return array.raw();
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698