| 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/v8.h" | 5 #include "src/v8.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 1973 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1984 return; | 1984 return; |
| 1985 // TODO(yangguo): add special handling to canonicalize ICs. | 1985 // TODO(yangguo): add special handling to canonicalize ICs. |
| 1986 case Code::FUNCTION: | 1986 case Code::FUNCTION: |
| 1987 // Only serialize the code for the toplevel function. Replace code | 1987 // Only serialize the code for the toplevel function. Replace code |
| 1988 // of included function literals by the lazy compile builtin. | 1988 // of included function literals by the lazy compile builtin. |
| 1989 // This is safe, as checked in Compiler::BuildFunctionInfo. | 1989 // This is safe, as checked in Compiler::BuildFunctionInfo. |
| 1990 if (code_object != main_code_) { | 1990 if (code_object != main_code_) { |
| 1991 Code* lazy = *isolate()->builtins()->CompileLazy(); | 1991 Code* lazy = *isolate()->builtins()->CompileLazy(); |
| 1992 SerializeBuiltin(lazy, how_to_code, where_to_point); | 1992 SerializeBuiltin(lazy, how_to_code, where_to_point); |
| 1993 } else { | 1993 } else { |
| 1994 code_object->MakeYoung(); |
| 1994 SerializeHeapObject(code_object, how_to_code, where_to_point); | 1995 SerializeHeapObject(code_object, how_to_code, where_to_point); |
| 1995 } | 1996 } |
| 1996 return; | 1997 return; |
| 1997 } | 1998 } |
| 1998 } | 1999 } |
| 1999 | 2000 |
| 2000 if (heap_object == source_) { | 2001 if (heap_object == source_) { |
| 2001 SerializeSourceObject(how_to_code, where_to_point); | 2002 SerializeSourceObject(how_to_code, where_to_point); |
| 2002 return; | 2003 return; |
| 2003 } | 2004 } |
| (...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2186 | 2187 |
| 2187 int SerializedCodeData::CheckSum(String* string) { | 2188 int SerializedCodeData::CheckSum(String* string) { |
| 2188 int checksum = Version::Hash(); | 2189 int checksum = Version::Hash(); |
| 2189 #ifdef DEBUG | 2190 #ifdef DEBUG |
| 2190 uint32_t seed = static_cast<uint32_t>(checksum); | 2191 uint32_t seed = static_cast<uint32_t>(checksum); |
| 2191 checksum = static_cast<int>(IteratingStringHasher::Hash(string, seed)); | 2192 checksum = static_cast<int>(IteratingStringHasher::Hash(string, seed)); |
| 2192 #endif // DEBUG | 2193 #endif // DEBUG |
| 2193 return checksum; | 2194 return checksum; |
| 2194 } | 2195 } |
| 2195 } } // namespace v8::internal | 2196 } } // namespace v8::internal |
| OLD | NEW |