Do not use eternal handles when creating a start-up snapshot.
authoryangguo <yangguo@chromium.org>
Fri, 6 Mar 2015 14:44:43 +0000 (06:44 -0800)
committerCommit bot <commit-bot@chromium.org>
Fri, 6 Mar 2015 14:44:51 +0000 (14:44 +0000)
R=ulan@chromium.org

Review URL: https://codereview.chromium.org/984833003

Cr-Commit-Position: refs/heads/master@{#27045}

src/date.js
src/runtime/runtime-date.cc

index 40ab1d25d6579b5c9d5abaac9bb26ce06d9c2e64..208a5b2b4bec27f45ccc7aef9d4836a10c8bdacc 100644 (file)
@@ -731,6 +731,7 @@ var date_cache_version = NAN;
 function CheckDateCacheCurrent() {
   if (!date_cache_version_holder) {
     date_cache_version_holder = %DateCacheVersion();
+    if (!date_cache_version_holder) return;
   }
   if (date_cache_version_holder[0] == date_cache_version) {
     return;
index f8b88e1398ea4c5c1daa0c7de9f24e28c612342d..844ca25fd5557eff7e7fb074cda10747956ac34c 100644 (file)
@@ -152,6 +152,7 @@ RUNTIME_FUNCTION(Runtime_DateToUTC) {
 RUNTIME_FUNCTION(Runtime_DateCacheVersion) {
   HandleScope hs(isolate);
   DCHECK(args.length() == 0);
+  if (isolate->serializer_enabled()) return isolate->heap()->undefined_value();
   if (!isolate->eternal_handles()->Exists(EternalHandles::DATE_CACHE_VERSION)) {
     Handle<FixedArray> date_cache_version =
         isolate->factory()->NewFixedArray(1, TENURED);