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

Unified Diff: runtime/vm/object.cc

Issue 1391433002: When a snapshot is generated on a 64 bit architecture and then read into a 32 bit architecture, val… (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 2 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: runtime/vm/object.cc
diff --git a/runtime/vm/object.cc b/runtime/vm/object.cc
index ff4d497e028904dd7478c0b7ddcf670d2f81de9c..1e47f62cc3bfeb10cd823a988415d4ce3cd2f63a 100644
--- a/runtime/vm/object.cc
+++ b/runtime/vm/object.cc
@@ -14455,9 +14455,12 @@ RawInstance* Instance::CheckAndCanonicalize(const char** error_str) const {
if (!CheckAndCanonicalizeFields(error_str)) {
return Instance::null();
}
- Instance& result = Instance::Handle();
- const Class& cls = Class::Handle(this->clazz());
- Array& constants = Array::Handle(cls.constants());
+ Thread* thread = Thread::Current();
+ Zone* zone = thread->zone();
+ Isolate* isolate = thread->isolate();
+ Instance& result = Instance::Handle(zone);
+ const Class& cls = Class::Handle(zone, this->clazz());
+ Array& constants = Array::Handle(zone, cls.constants());
const intptr_t constants_len = constants.Length();
// Linear search to see whether this value is already present in the
// list of canonicalized constants.
@@ -14476,7 +14479,8 @@ RawInstance* Instance::CheckAndCanonicalize(const char** error_str) const {
// The value needs to be added to the list. Grow the list if
// it is full.
result ^= this->raw();
- if (result.IsNew()) {
+ if (result.IsNew() ||
+ (result.InVMHeap() && (isolate != Dart::vm_isolate()))) {
// Create a canonical object in old space.
srdjan 2015/10/05 18:06:36 Maybe comment here briefly why this is necessary.
siva 2015/10/05 21:51:05 Done.
result ^= Object::Clone(result, Heap::kOld);
}
« 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