| 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 2460 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2471 DCHECK(code_object->has_reloc_info_for_serialization()); | 2471 DCHECK(code_object->has_reloc_info_for_serialization()); |
| 2472 // Only serialize the code for the toplevel function unless specified | 2472 // Only serialize the code for the toplevel function unless specified |
| 2473 // by flag. Replace code of inner functions by the lazy compile builtin. | 2473 // by flag. Replace code of inner functions by the lazy compile builtin. |
| 2474 // This is safe, as checked in Compiler::GetSharedFunctionInfo. | 2474 // This is safe, as checked in Compiler::GetSharedFunctionInfo. |
| 2475 if (code_object != main_code_ && !FLAG_serialize_inner) { | 2475 if (code_object != main_code_ && !FLAG_serialize_inner) { |
| 2476 SerializeBuiltin(Builtins::kCompileLazy, how_to_code, where_to_point); | 2476 SerializeBuiltin(Builtins::kCompileLazy, how_to_code, where_to_point); |
| 2477 } else { | 2477 } else { |
| 2478 SerializeGeneric(code_object, how_to_code, where_to_point); | 2478 SerializeGeneric(code_object, how_to_code, where_to_point); |
| 2479 } | 2479 } |
| 2480 return; | 2480 return; |
| 2481 case Code::PLACEHOLDER: |
| 2482 UNREACHABLE(); |
| 2481 } | 2483 } |
| 2482 UNREACHABLE(); | 2484 UNREACHABLE(); |
| 2483 } | 2485 } |
| 2484 | 2486 |
| 2485 // Past this point we should not see any (context-specific) maps anymore. | 2487 // Past this point we should not see any (context-specific) maps anymore. |
| 2486 CHECK(!obj->IsMap()); | 2488 CHECK(!obj->IsMap()); |
| 2487 // There should be no references to the global object embedded. | 2489 // There should be no references to the global object embedded. |
| 2488 CHECK(!obj->IsJSGlobalProxy() && !obj->IsGlobalObject()); | 2490 CHECK(!obj->IsJSGlobalProxy() && !obj->IsGlobalObject()); |
| 2489 // There should be no hash table embedded. They would require rehashing. | 2491 // There should be no hash table embedded. They would require rehashing. |
| 2490 CHECK(!obj->IsHashTable()); | 2492 CHECK(!obj->IsHashTable()); |
| (...skipping 385 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2876 SerializedCodeData* scd = new SerializedCodeData(cached_data); | 2878 SerializedCodeData* scd = new SerializedCodeData(cached_data); |
| 2877 SanityCheckResult r = scd->SanityCheck(isolate, source); | 2879 SanityCheckResult r = scd->SanityCheck(isolate, source); |
| 2878 if (r == CHECK_SUCCESS) return scd; | 2880 if (r == CHECK_SUCCESS) return scd; |
| 2879 cached_data->Reject(); | 2881 cached_data->Reject(); |
| 2880 source->GetIsolate()->counters()->code_cache_reject_reason()->AddSample(r); | 2882 source->GetIsolate()->counters()->code_cache_reject_reason()->AddSample(r); |
| 2881 delete scd; | 2883 delete scd; |
| 2882 return NULL; | 2884 return NULL; |
| 2883 } | 2885 } |
| 2884 } // namespace internal | 2886 } // namespace internal |
| 2885 } // namespace v8 | 2887 } // namespace v8 |
| OLD | NEW |