| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "src/snapshot/serialize.h" | 5 #include "src/snapshot/serialize.h" |
| 6 | 6 |
| 7 #include "src/accessors.h" | 7 #include "src/accessors.h" |
| 8 #include "src/api.h" | 8 #include "src/api.h" |
| 9 #include "src/base/platform/platform.h" | 9 #include "src/base/platform/platform.h" |
| 10 #include "src/bootstrapper.h" | 10 #include "src/bootstrapper.h" |
| (...skipping 1459 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1470 back_reference_map()->AddGlobalProxy(context->global_proxy()); | 1470 back_reference_map()->AddGlobalProxy(context->global_proxy()); |
| 1471 // The bootstrap snapshot has a code-stub context. When serializing the | 1471 // The bootstrap snapshot has a code-stub context. When serializing the |
| 1472 // partial snapshot, it is chained into the weak context list on the isolate | 1472 // partial snapshot, it is chained into the weak context list on the isolate |
| 1473 // and it's next context pointer may point to the code-stub context. Clear | 1473 // and it's next context pointer may point to the code-stub context. Clear |
| 1474 // it before serializing, it will get re-added to the context list | 1474 // it before serializing, it will get re-added to the context list |
| 1475 // explicitly when it's loaded. | 1475 // explicitly when it's loaded. |
| 1476 if (context->IsNativeContext()) { | 1476 if (context->IsNativeContext()) { |
| 1477 context->set(Context::NEXT_CONTEXT_LINK, | 1477 context->set(Context::NEXT_CONTEXT_LINK, |
| 1478 isolate_->heap()->undefined_value()); | 1478 isolate_->heap()->undefined_value()); |
| 1479 DCHECK(!context->global_object()->IsUndefined()); | 1479 DCHECK(!context->global_object()->IsUndefined()); |
| 1480 DCHECK(!context->builtins()->IsUndefined()); | |
| 1481 } | 1480 } |
| 1482 } | 1481 } |
| 1483 VisitPointer(o); | 1482 VisitPointer(o); |
| 1484 SerializeDeferredObjects(); | 1483 SerializeDeferredObjects(); |
| 1485 SerializeOutdatedContextsAsFixedArray(); | 1484 SerializeOutdatedContextsAsFixedArray(); |
| 1486 Pad(); | 1485 Pad(); |
| 1487 } | 1486 } |
| 1488 | 1487 |
| 1489 | 1488 |
| 1490 void PartialSerializer::SerializeOutdatedContextsAsFixedArray() { | 1489 void PartialSerializer::SerializeOutdatedContextsAsFixedArray() { |
| (...skipping 1362 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2853 SerializedCodeData* scd = new SerializedCodeData(cached_data); | 2852 SerializedCodeData* scd = new SerializedCodeData(cached_data); |
| 2854 SanityCheckResult r = scd->SanityCheck(isolate, source); | 2853 SanityCheckResult r = scd->SanityCheck(isolate, source); |
| 2855 if (r == CHECK_SUCCESS) return scd; | 2854 if (r == CHECK_SUCCESS) return scd; |
| 2856 cached_data->Reject(); | 2855 cached_data->Reject(); |
| 2857 source->GetIsolate()->counters()->code_cache_reject_reason()->AddSample(r); | 2856 source->GetIsolate()->counters()->code_cache_reject_reason()->AddSample(r); |
| 2858 delete scd; | 2857 delete scd; |
| 2859 return NULL; | 2858 return NULL; |
| 2860 } | 2859 } |
| 2861 } // namespace internal | 2860 } // namespace internal |
| 2862 } // namespace v8 | 2861 } // namespace v8 |
| OLD | NEW |