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 1166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1177 // Find an external reference and write a pointer to it in the current | 1177 // Find an external reference and write a pointer to it in the current |
1178 // code object. | 1178 // code object. |
1179 CASE_STATEMENT(kExternalReference, kFromCode, kStartOfObject, 0) | 1179 CASE_STATEMENT(kExternalReference, kFromCode, kStartOfObject, 0) |
1180 CASE_BODY(kExternalReference, | 1180 CASE_BODY(kExternalReference, |
1181 kFromCode, | 1181 kFromCode, |
1182 kStartOfObject, | 1182 kStartOfObject, |
1183 0) | 1183 0) |
1184 // Find a builtin and write a pointer to it to the current object. | 1184 // Find a builtin and write a pointer to it to the current object. |
1185 CASE_STATEMENT(kBuiltin, kPlain, kStartOfObject, 0) | 1185 CASE_STATEMENT(kBuiltin, kPlain, kStartOfObject, 0) |
1186 CASE_BODY(kBuiltin, kPlain, kStartOfObject, 0) | 1186 CASE_BODY(kBuiltin, kPlain, kStartOfObject, 0) |
1187 #if V8_OOL_CONSTANT_POOL | |
1188 // Find a builtin code entry and write a pointer to it to the current | |
1189 // object. | |
1190 CASE_STATEMENT(kBuiltin, kPlain, kInnerPointer, 0) | 1187 CASE_STATEMENT(kBuiltin, kPlain, kInnerPointer, 0) |
1191 CASE_BODY(kBuiltin, kPlain, kInnerPointer, 0) | 1188 CASE_BODY(kBuiltin, kPlain, kInnerPointer, 0) |
1192 #endif | |
1193 // Find a builtin and write a pointer to it in the current code object. | |
1194 CASE_STATEMENT(kBuiltin, kFromCode, kInnerPointer, 0) | 1189 CASE_STATEMENT(kBuiltin, kFromCode, kInnerPointer, 0) |
1195 CASE_BODY(kBuiltin, kFromCode, kInnerPointer, 0) | 1190 CASE_BODY(kBuiltin, kFromCode, kInnerPointer, 0) |
1196 // Find an object in the attached references and write a pointer to it to | 1191 // Find an object in the attached references and write a pointer to it to |
1197 // the current object. | 1192 // the current object. |
1198 CASE_STATEMENT(kAttachedReference, kPlain, kStartOfObject, 0) | 1193 CASE_STATEMENT(kAttachedReference, kPlain, kStartOfObject, 0) |
1199 CASE_BODY(kAttachedReference, kPlain, kStartOfObject, 0) | 1194 CASE_BODY(kAttachedReference, kPlain, kStartOfObject, 0) |
1200 CASE_STATEMENT(kAttachedReference, kPlain, kInnerPointer, 0) | 1195 CASE_STATEMENT(kAttachedReference, kPlain, kInnerPointer, 0) |
1201 CASE_BODY(kAttachedReference, kPlain, kInnerPointer, 0) | 1196 CASE_BODY(kAttachedReference, kPlain, kInnerPointer, 0) |
1202 CASE_STATEMENT(kAttachedReference, kFromCode, kInnerPointer, 0) | 1197 CASE_STATEMENT(kAttachedReference, kFromCode, kInnerPointer, 0) |
1203 CASE_BODY(kAttachedReference, kFromCode, kInnerPointer, 0) | 1198 CASE_BODY(kAttachedReference, kFromCode, kInnerPointer, 0) |
(...skipping 752 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1956 isolate_->InitializeLoggingAndCounters(); | 1951 isolate_->InitializeLoggingAndCounters(); |
1957 code_address_map_ = new CodeAddressMap(isolate_); | 1952 code_address_map_ = new CodeAddressMap(isolate_); |
1958 } | 1953 } |
1959 | 1954 |
1960 | 1955 |
1961 ScriptData* CodeSerializer::Serialize(Isolate* isolate, | 1956 ScriptData* CodeSerializer::Serialize(Isolate* isolate, |
1962 Handle<SharedFunctionInfo> info, | 1957 Handle<SharedFunctionInfo> info, |
1963 Handle<String> source) { | 1958 Handle<String> source) { |
1964 base::ElapsedTimer timer; | 1959 base::ElapsedTimer timer; |
1965 if (FLAG_profile_deserialization) timer.Start(); | 1960 if (FLAG_profile_deserialization) timer.Start(); |
| 1961 if (FLAG_serializer_trace_level > 0) { |
| 1962 PrintF("[Serializing from"); |
| 1963 Object* script = info->script(); |
| 1964 if (script->IsScript()) Script::cast(script)->name()->ShortPrint(); |
| 1965 PrintF("]\n"); |
| 1966 } |
1966 | 1967 |
1967 // Serialize code object. | 1968 // Serialize code object. |
1968 List<byte> payload; | 1969 List<byte> payload; |
1969 ListSnapshotSink list_sink(&payload); | 1970 ListSnapshotSink list_sink(&payload); |
1970 DebugSnapshotSink debug_sink(&list_sink); | 1971 DebugSnapshotSink debug_sink(&list_sink); |
1971 SnapshotByteSink* sink = FLAG_trace_code_serializer | 1972 SnapshotByteSink* sink = FLAG_serializer_trace_level > 1 |
1972 ? static_cast<SnapshotByteSink*>(&debug_sink) | 1973 ? static_cast<SnapshotByteSink*>(&debug_sink) |
1973 : static_cast<SnapshotByteSink*>(&list_sink); | 1974 : static_cast<SnapshotByteSink*>(&list_sink); |
1974 CodeSerializer cs(isolate, sink, *source, info->code()); | 1975 CodeSerializer cs(isolate, sink, *source, info->code()); |
1975 DisallowHeapAllocation no_gc; | 1976 DisallowHeapAllocation no_gc; |
1976 Object** location = Handle<Object>::cast(info).location(); | 1977 Object** location = Handle<Object>::cast(info).location(); |
1977 cs.VisitPointer(location); | 1978 cs.VisitPointer(location); |
1978 cs.Pad(); | 1979 cs.Pad(); |
1979 cs.FinalizeAllocation(); | 1980 cs.FinalizeAllocation(); |
1980 | 1981 |
1981 SerializedCodeData data(&payload, &cs); | 1982 SerializedCodeData data(&payload, &cs); |
1982 ScriptData* script_data = data.GetScriptData(); | 1983 ScriptData* script_data = data.GetScriptData(); |
1983 | 1984 |
1984 if (FLAG_profile_deserialization) { | 1985 if (FLAG_profile_deserialization) { |
1985 double ms = timer.Elapsed().InMillisecondsF(); | 1986 double ms = timer.Elapsed().InMillisecondsF(); |
1986 int length = script_data->length(); | 1987 int length = script_data->length(); |
1987 PrintF("[Serializing to %d bytes took %0.3f ms]\n", length, ms); | 1988 PrintF("[Serializing to %d bytes took %0.3f ms]\n", length, ms); |
1988 } | 1989 } |
1989 | 1990 |
1990 return script_data; | 1991 return script_data; |
1991 } | 1992 } |
1992 | 1993 |
1993 | 1994 |
1994 void CodeSerializer::SerializeObject(Object* o, HowToCode how_to_code, | 1995 void CodeSerializer::SerializeObject(Object* o, HowToCode how_to_code, |
1995 WhereToPoint where_to_point, int skip) { | 1996 WhereToPoint where_to_point, int skip) { |
1996 HeapObject* heap_object = HeapObject::cast(o); | 1997 HeapObject* heap_object = HeapObject::cast(o); |
1997 | 1998 |
1998 int root_index; | 1999 int root_index; |
1999 if ((root_index = RootIndex(heap_object, how_to_code)) != kInvalidRootIndex) { | 2000 if ((root_index = RootIndex(heap_object, how_to_code)) != kInvalidRootIndex) { |
| 2001 if (FLAG_serializer_trace_level > 0) { |
| 2002 PrintF(" Encoding root: %d\n", root_index); |
| 2003 } |
2000 PutRoot(root_index, heap_object, how_to_code, where_to_point, skip); | 2004 PutRoot(root_index, heap_object, how_to_code, where_to_point, skip); |
2001 return; | 2005 return; |
2002 } | 2006 } |
2003 | 2007 |
2004 if (address_mapper_.IsMapped(heap_object)) { | 2008 if (address_mapper_.IsMapped(heap_object)) { |
2005 if (FLAG_trace_code_serializer) { | 2009 if (FLAG_serializer_trace_level > 0) { |
2006 PrintF("Encoding back reference to: "); | 2010 PrintF(" Encoding back reference to: "); |
2007 heap_object->ShortPrint(); | 2011 heap_object->ShortPrint(); |
2008 PrintF("\n"); | 2012 PrintF("\n"); |
2009 } | 2013 } |
2010 SerializeReferenceToPreviousObject(heap_object, how_to_code, where_to_point, | 2014 SerializeReferenceToPreviousObject(heap_object, how_to_code, where_to_point, |
2011 skip); | 2015 skip); |
2012 return; | 2016 return; |
2013 } | 2017 } |
2014 | 2018 |
2015 if (skip != 0) { | 2019 if (skip != 0) { |
2016 sink_->Put(kSkip, "SkipFromSerializeObject"); | 2020 sink_->Put(kSkip, "SkipFromSerializeObject"); |
2017 sink_->PutInt(skip, "SkipDistanceFromSerializeObject"); | 2021 sink_->PutInt(skip, "SkipDistanceFromSerializeObject"); |
2018 } | 2022 } |
2019 | 2023 |
2020 if (heap_object->IsCode()) { | 2024 if (heap_object->IsCode()) { |
2021 Code* code_object = Code::cast(heap_object); | 2025 Code* code_object = Code::cast(heap_object); |
2022 switch (code_object->kind()) { | 2026 switch (code_object->kind()) { |
2023 case Code::OPTIMIZED_FUNCTION: // No optimized code compiled yet. | 2027 case Code::OPTIMIZED_FUNCTION: // No optimized code compiled yet. |
2024 case Code::HANDLER: // No handlers patched in yet. | 2028 case Code::HANDLER: // No handlers patched in yet. |
2025 case Code::REGEXP: // No regexp literals initialized yet. | 2029 case Code::REGEXP: // No regexp literals initialized yet. |
2026 case Code::NUMBER_OF_KINDS: // Pseudo enum value. | 2030 case Code::NUMBER_OF_KINDS: // Pseudo enum value. |
2027 CHECK(false); | 2031 CHECK(false); |
2028 case Code::BUILTIN: | 2032 case Code::BUILTIN: |
2029 SerializeBuiltin(code_object, how_to_code, where_to_point); | 2033 SerializeBuiltin(code_object->builtin_index(), how_to_code, |
| 2034 where_to_point); |
2030 return; | 2035 return; |
2031 case Code::STUB: | 2036 case Code::STUB: |
2032 SerializeCodeStub(code_object, how_to_code, where_to_point); | 2037 SerializeCodeStub(code_object->stub_key(), how_to_code, where_to_point); |
2033 return; | 2038 return; |
2034 #define IC_KIND_CASE(KIND) case Code::KIND: | 2039 #define IC_KIND_CASE(KIND) case Code::KIND: |
2035 IC_KIND_LIST(IC_KIND_CASE) | 2040 IC_KIND_LIST(IC_KIND_CASE) |
2036 #undef IC_KIND_CASE | 2041 #undef IC_KIND_CASE |
2037 SerializeHeapObject(code_object, how_to_code, where_to_point); | 2042 SerializeIC(code_object, how_to_code, where_to_point); |
2038 return; | 2043 return; |
2039 // TODO(yangguo): add special handling to canonicalize ICs. | |
2040 case Code::FUNCTION: | 2044 case Code::FUNCTION: |
2041 // Only serialize the code for the toplevel function. Replace code | 2045 // Only serialize the code for the toplevel function. Replace code |
2042 // of included function literals by the lazy compile builtin. | 2046 // of included function literals by the lazy compile builtin. |
2043 // This is safe, as checked in Compiler::BuildFunctionInfo. | 2047 // This is safe, as checked in Compiler::BuildFunctionInfo. |
2044 if (code_object != main_code_) { | 2048 if (code_object != main_code_) { |
2045 Code* lazy = *isolate()->builtins()->CompileLazy(); | 2049 SerializeBuiltin(Builtins::kCompileLazy, how_to_code, where_to_point); |
2046 SerializeBuiltin(lazy, how_to_code, where_to_point); | |
2047 } else { | 2050 } else { |
2048 code_object->MakeYoung(); | 2051 code_object->MakeYoung(); |
2049 SerializeHeapObject(code_object, how_to_code, where_to_point); | 2052 SerializeHeapObject(code_object, how_to_code, where_to_point); |
2050 } | 2053 } |
2051 return; | 2054 return; |
2052 } | 2055 } |
| 2056 UNREACHABLE(); |
2053 } | 2057 } |
2054 | 2058 |
2055 if (heap_object == source_) { | 2059 if (heap_object == source_) { |
2056 SerializeSourceObject(how_to_code, where_to_point); | 2060 SerializeSourceObject(how_to_code, where_to_point); |
2057 return; | 2061 return; |
2058 } | 2062 } |
2059 | 2063 |
2060 // Past this point we should not see any (context-specific) maps anymore. | 2064 // Past this point we should not see any (context-specific) maps anymore. |
2061 CHECK(!heap_object->IsMap()); | 2065 CHECK(!heap_object->IsMap()); |
2062 // There should be no references to the global object embedded. | 2066 // There should be no references to the global object embedded. |
2063 CHECK(!heap_object->IsJSGlobalProxy() && !heap_object->IsGlobalObject()); | 2067 CHECK(!heap_object->IsJSGlobalProxy() && !heap_object->IsGlobalObject()); |
2064 // There should be no hash table embedded. They would require rehashing. | 2068 // There should be no hash table embedded. They would require rehashing. |
2065 CHECK(!heap_object->IsHashTable()); | 2069 CHECK(!heap_object->IsHashTable()); |
2066 | 2070 |
2067 SerializeHeapObject(heap_object, how_to_code, where_to_point); | 2071 SerializeHeapObject(heap_object, how_to_code, where_to_point); |
2068 } | 2072 } |
2069 | 2073 |
2070 | 2074 |
2071 void CodeSerializer::SerializeHeapObject(HeapObject* heap_object, | 2075 void CodeSerializer::SerializeHeapObject(HeapObject* heap_object, |
2072 HowToCode how_to_code, | 2076 HowToCode how_to_code, |
2073 WhereToPoint where_to_point) { | 2077 WhereToPoint where_to_point) { |
2074 if (FLAG_trace_code_serializer) { | 2078 if (FLAG_serializer_trace_level > 0) { |
2075 PrintF("Encoding heap object: "); | 2079 PrintF(" Encoding heap object: "); |
2076 heap_object->ShortPrint(); | 2080 heap_object->ShortPrint(); |
2077 PrintF("\n"); | 2081 PrintF("\n"); |
2078 } | 2082 } |
2079 | 2083 |
2080 // Object has not yet been serialized. Serialize it here. | 2084 // Object has not yet been serialized. Serialize it here. |
2081 ObjectSerializer serializer(this, heap_object, sink_, how_to_code, | 2085 ObjectSerializer serializer(this, heap_object, sink_, how_to_code, |
2082 where_to_point); | 2086 where_to_point); |
2083 serializer.Serialize(); | 2087 serializer.Serialize(); |
2084 } | 2088 } |
2085 | 2089 |
2086 | 2090 |
2087 void CodeSerializer::SerializeBuiltin(Code* builtin, HowToCode how_to_code, | 2091 void CodeSerializer::SerializeBuiltin(int builtin_index, HowToCode how_to_code, |
2088 WhereToPoint where_to_point) { | 2092 WhereToPoint where_to_point) { |
2089 DCHECK((how_to_code == kPlain && where_to_point == kStartOfObject) || | 2093 DCHECK((how_to_code == kPlain && where_to_point == kStartOfObject) || |
2090 (how_to_code == kPlain && where_to_point == kInnerPointer) || | 2094 (how_to_code == kPlain && where_to_point == kInnerPointer) || |
2091 (how_to_code == kFromCode && where_to_point == kInnerPointer)); | 2095 (how_to_code == kFromCode && where_to_point == kInnerPointer)); |
2092 int builtin_index = builtin->builtin_index(); | |
2093 DCHECK_LT(builtin_index, Builtins::builtin_count); | 2096 DCHECK_LT(builtin_index, Builtins::builtin_count); |
2094 DCHECK_LE(0, builtin_index); | 2097 DCHECK_LE(0, builtin_index); |
2095 | 2098 |
2096 if (FLAG_trace_code_serializer) { | 2099 if (FLAG_serializer_trace_level > 0) { |
2097 PrintF("Encoding builtin: %s\n", | 2100 PrintF(" Encoding builtin: %s\n", |
2098 isolate()->builtins()->name(builtin_index)); | 2101 isolate()->builtins()->name(builtin_index)); |
2099 } | 2102 } |
2100 | 2103 |
2101 sink_->Put(kBuiltin + how_to_code + where_to_point, "Builtin"); | 2104 sink_->Put(kBuiltin + how_to_code + where_to_point, "Builtin"); |
2102 sink_->PutInt(builtin_index, "builtin_index"); | 2105 sink_->PutInt(builtin_index, "builtin_index"); |
2103 } | 2106 } |
2104 | 2107 |
2105 | 2108 |
2106 void CodeSerializer::SerializeCodeStub(Code* stub, HowToCode how_to_code, | 2109 void CodeSerializer::SerializeCodeStub(uint32_t stub_key, HowToCode how_to_code, |
2107 WhereToPoint where_to_point) { | 2110 WhereToPoint where_to_point) { |
2108 DCHECK((how_to_code == kPlain && where_to_point == kStartOfObject) || | 2111 DCHECK((how_to_code == kPlain && where_to_point == kStartOfObject) || |
2109 (how_to_code == kPlain && where_to_point == kInnerPointer) || | 2112 (how_to_code == kPlain && where_to_point == kInnerPointer) || |
2110 (how_to_code == kFromCode && where_to_point == kInnerPointer)); | 2113 (how_to_code == kFromCode && where_to_point == kInnerPointer)); |
2111 uint32_t stub_key = stub->stub_key(); | |
2112 DCHECK(CodeStub::MajorKeyFromKey(stub_key) != CodeStub::NoCache); | 2114 DCHECK(CodeStub::MajorKeyFromKey(stub_key) != CodeStub::NoCache); |
2113 DCHECK(!CodeStub::GetCode(isolate(), stub_key).is_null()); | 2115 DCHECK(!CodeStub::GetCode(isolate(), stub_key).is_null()); |
2114 | 2116 |
2115 int index = AddCodeStubKey(stub_key) + kCodeStubsBaseIndex; | 2117 int index = AddCodeStubKey(stub_key) + kCodeStubsBaseIndex; |
2116 | 2118 |
2117 if (FLAG_trace_code_serializer) { | 2119 if (FLAG_serializer_trace_level > 0) { |
2118 PrintF("Encoding code stub %s as %d\n", | 2120 PrintF(" Encoding code stub %s as %d\n", |
2119 CodeStub::MajorName(CodeStub::MajorKeyFromKey(stub_key), false), | 2121 CodeStub::MajorName(CodeStub::MajorKeyFromKey(stub_key), false), |
2120 index); | 2122 index); |
2121 } | 2123 } |
2122 | 2124 |
2123 sink_->Put(kAttachedReference + how_to_code + where_to_point, "CodeStub"); | 2125 sink_->Put(kAttachedReference + how_to_code + where_to_point, "CodeStub"); |
2124 sink_->PutInt(index, "CodeStub key"); | 2126 sink_->PutInt(index, "CodeStub key"); |
2125 } | 2127 } |
2126 | 2128 |
2127 | 2129 |
| 2130 void CodeSerializer::SerializeIC(Code* ic, HowToCode how_to_code, |
| 2131 WhereToPoint where_to_point) { |
| 2132 // The IC may be implemented as a stub. |
| 2133 uint32_t stub_key = ic->stub_key(); |
| 2134 if (stub_key != CodeStub::NoCacheKey()) { |
| 2135 if (FLAG_serializer_trace_level > 0) { |
| 2136 PrintF(" %s is a code stub\n", Code::Kind2String(ic->kind())); |
| 2137 } |
| 2138 SerializeCodeStub(stub_key, how_to_code, where_to_point); |
| 2139 return; |
| 2140 } |
| 2141 // The IC may be implemented as builtin. Only real builtins have an |
| 2142 // actual builtin_index value attached (otherwise it's just garbage). |
| 2143 // Compare to make sure we are really dealing with a builtin. |
| 2144 int builtin_index = ic->builtin_index(); |
| 2145 if (builtin_index < Builtins::builtin_count) { |
| 2146 Builtins::Name name = static_cast<Builtins::Name>(builtin_index); |
| 2147 Code* builtin = isolate()->builtins()->builtin(name); |
| 2148 if (builtin == ic) { |
| 2149 if (FLAG_serializer_trace_level > 0) { |
| 2150 PrintF(" %s is a builtin\n", Code::Kind2String(ic->kind())); |
| 2151 } |
| 2152 DCHECK(ic->kind() == Code::KEYED_LOAD_IC || |
| 2153 ic->kind() == Code::KEYED_STORE_IC); |
| 2154 SerializeBuiltin(builtin_index, how_to_code, where_to_point); |
| 2155 return; |
| 2156 } |
| 2157 } |
| 2158 // The IC may also just be a piece of code kept in the non_monomorphic_cache. |
| 2159 // In that case, just serialize as a normal code object. |
| 2160 if (FLAG_serializer_trace_level > 0) { |
| 2161 PrintF(" %s has no special handling\n", Code::Kind2String(ic->kind())); |
| 2162 } |
| 2163 DCHECK(ic->kind() == Code::LOAD_IC || ic->kind() == Code::STORE_IC); |
| 2164 SerializeHeapObject(ic, how_to_code, where_to_point); |
| 2165 } |
| 2166 |
| 2167 |
2128 int CodeSerializer::AddCodeStubKey(uint32_t stub_key) { | 2168 int CodeSerializer::AddCodeStubKey(uint32_t stub_key) { |
2129 // TODO(yangguo) Maybe we need a hash table for a faster lookup than O(n^2). | 2169 // TODO(yangguo) Maybe we need a hash table for a faster lookup than O(n^2). |
2130 int index = 0; | 2170 int index = 0; |
2131 while (index < stub_keys_.length()) { | 2171 while (index < stub_keys_.length()) { |
2132 if (stub_keys_[index] == stub_key) return index; | 2172 if (stub_keys_[index] == stub_key) return index; |
2133 index++; | 2173 index++; |
2134 } | 2174 } |
2135 stub_keys_.Add(stub_key); | 2175 stub_keys_.Add(stub_key); |
2136 return index; | 2176 return index; |
2137 } | 2177 } |
2138 | 2178 |
2139 | 2179 |
2140 void CodeSerializer::SerializeSourceObject(HowToCode how_to_code, | 2180 void CodeSerializer::SerializeSourceObject(HowToCode how_to_code, |
2141 WhereToPoint where_to_point) { | 2181 WhereToPoint where_to_point) { |
2142 if (FLAG_trace_code_serializer) PrintF("Encoding source object\n"); | 2182 if (FLAG_serializer_trace_level > 0) PrintF(" Encoding source object\n"); |
2143 | 2183 |
2144 DCHECK(how_to_code == kPlain && where_to_point == kStartOfObject); | 2184 DCHECK(how_to_code == kPlain && where_to_point == kStartOfObject); |
2145 sink_->Put(kAttachedReference + how_to_code + where_to_point, "Source"); | 2185 sink_->Put(kAttachedReference + how_to_code + where_to_point, "Source"); |
2146 sink_->PutInt(kSourceObjectIndex, "kSourceObjectIndex"); | 2186 sink_->PutInt(kSourceObjectIndex, "kSourceObjectIndex"); |
2147 } | 2187 } |
2148 | 2188 |
2149 | 2189 |
2150 MaybeHandle<SharedFunctionInfo> CodeSerializer::Deserialize( | 2190 MaybeHandle<SharedFunctionInfo> CodeSerializer::Deserialize( |
2151 Isolate* isolate, ScriptData* data, Handle<String> source) { | 2191 Isolate* isolate, ScriptData* data, Handle<String> source) { |
2152 base::ElapsedTimer timer; | 2192 base::ElapsedTimer timer; |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2263 | 2303 |
2264 int SerializedCodeData::CheckSum(String* string) { | 2304 int SerializedCodeData::CheckSum(String* string) { |
2265 int checksum = Version::Hash(); | 2305 int checksum = Version::Hash(); |
2266 #ifdef DEBUG | 2306 #ifdef DEBUG |
2267 uint32_t seed = static_cast<uint32_t>(checksum); | 2307 uint32_t seed = static_cast<uint32_t>(checksum); |
2268 checksum = static_cast<int>(IteratingStringHasher::Hash(string, seed)); | 2308 checksum = static_cast<int>(IteratingStringHasher::Hash(string, seed)); |
2269 #endif // DEBUG | 2309 #endif // DEBUG |
2270 return checksum; | 2310 return checksum; |
2271 } | 2311 } |
2272 } } // namespace v8::internal | 2312 } } // namespace v8::internal |
OLD | NEW |