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