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

Unified Diff: runtime/vm/raw_object_snapshot.cc

Issue 1430993003: Add test precompiling dart2js. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: status file Created 5 years, 1 month 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 | runtime/vm/snapshot.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/raw_object_snapshot.cc
diff --git a/runtime/vm/raw_object_snapshot.cc b/runtime/vm/raw_object_snapshot.cc
index 3a0d4ba3908afc5f4e59fd5186d5f29552d1c475..ab1eb9728053a117f71d95fd2a6b09538cb387f2 100644
--- a/runtime/vm/raw_object_snapshot.cc
+++ b/runtime/vm/raw_object_snapshot.cc
@@ -3340,11 +3340,9 @@ RawJSRegExp* JSRegExp::ReadFrom(SnapshotReader* reader,
Snapshot::Kind kind,
bool as_reference) {
ASSERT(reader != NULL);
- ASSERT(kind == Snapshot::kMessage);
// Allocate JSRegExp object.
- JSRegExp& regex = JSRegExp::ZoneHandle(
- reader->zone(), JSRegExp::New(HEAP_SPACE(kind)));
+ JSRegExp& regex = JSRegExp::ZoneHandle(reader->zone(), NEW_OBJECT(JSRegExp));
reader->AddBackRef(object_id, &regex, kIsDeserialized);
// Read and Set all the other fields.
@@ -3358,6 +3356,16 @@ RawJSRegExp* JSRegExp::ReadFrom(SnapshotReader* reader,
reader->Read<int8_t>());
// TODO(18854): Need to implement a way of recreating the irrexp functions.
+ const Function& no_function = Function::Handle(reader->zone());
+ regex.set_function(kOneByteStringCid, no_function);
+ regex.set_function(kTwoByteStringCid, no_function);
+ regex.set_function(kExternalOneByteStringCid, no_function);
+ regex.set_function(kExternalTwoByteStringCid, no_function);
+
+ const TypedData& no_bytecode = TypedData::Handle(reader->zone());
+ regex.set_bytecode(true, no_bytecode);
+ regex.set_bytecode(false, no_bytecode);
+
return regex.raw();
}
@@ -3367,7 +3375,6 @@ void RawJSRegExp::WriteTo(SnapshotWriter* writer,
Snapshot::Kind kind,
bool as_reference) {
ASSERT(writer != NULL);
- ASSERT(kind == Snapshot::kMessage);
// Write out the serialization header value for this object.
writer->WriteInlinedObjectHeader(object_id);
« no previous file with comments | « no previous file | runtime/vm/snapshot.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698