Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(19)

Side by Side Diff: src/serialize.cc

Issue 663453005: Log code event for deserialized code. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/serialize.h ('k') | test/cctest/test-serialize.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 2226 matching lines...) Expand 10 before | Expand all | Expand 10 after
2237 deserializer.FlushICacheForNewCodeObjects(); 2237 deserializer.FlushICacheForNewCodeObjects();
2238 } 2238 }
2239 2239
2240 if (FLAG_profile_deserialization) { 2240 if (FLAG_profile_deserialization) {
2241 double ms = timer.Elapsed().InMillisecondsF(); 2241 double ms = timer.Elapsed().InMillisecondsF();
2242 int length = data->length(); 2242 int length = data->length();
2243 PrintF("[Deserializing from %d bytes took %0.3f ms]\n", length, ms); 2243 PrintF("[Deserializing from %d bytes took %0.3f ms]\n", length, ms);
2244 } 2244 }
2245 Handle<SharedFunctionInfo> result(SharedFunctionInfo::cast(root), isolate); 2245 Handle<SharedFunctionInfo> result(SharedFunctionInfo::cast(root), isolate);
2246 result->set_deserialized(true); 2246 result->set_deserialized(true);
2247
2248 if (isolate->logger()->is_logging_code_events() ||
2249 isolate->cpu_profiler()->is_profiling()) {
2250 String* name = isolate->heap()->empty_string();
2251 if (result->script()->IsScript()) {
2252 Script* script = Script::cast(result->script());
2253 if (script->name()->IsString()) name = String::cast(script->name());
2254 }
2255 isolate->logger()->CodeCreateEvent(Logger::SCRIPT_TAG, result->code(),
2256 *result, NULL, name);
2257 }
2258
2247 return result; 2259 return result;
2248 } 2260 }
2249 2261
2250 2262
2251 SerializedCodeData::SerializedCodeData(List<byte>* payload, CodeSerializer* cs) 2263 SerializedCodeData::SerializedCodeData(List<byte>* payload, CodeSerializer* cs)
2252 : script_data_(NULL), owns_script_data_(true) { 2264 : script_data_(NULL), owns_script_data_(true) {
2253 DisallowHeapAllocation no_gc; 2265 DisallowHeapAllocation no_gc;
2254 List<uint32_t>* stub_keys = cs->stub_keys(); 2266 List<uint32_t>* stub_keys = cs->stub_keys();
2255 2267
2256 // Gather reservation chunk sizes. 2268 // Gather reservation chunk sizes.
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
2310 2322
2311 int SerializedCodeData::CheckSum(String* string) { 2323 int SerializedCodeData::CheckSum(String* string) {
2312 int checksum = Version::Hash(); 2324 int checksum = Version::Hash();
2313 #ifdef DEBUG 2325 #ifdef DEBUG
2314 uint32_t seed = static_cast<uint32_t>(checksum); 2326 uint32_t seed = static_cast<uint32_t>(checksum);
2315 checksum = static_cast<int>(IteratingStringHasher::Hash(string, seed)); 2327 checksum = static_cast<int>(IteratingStringHasher::Hash(string, seed));
2316 #endif // DEBUG 2328 #endif // DEBUG
2317 return checksum; 2329 return checksum;
2318 } 2330 }
2319 } } // namespace v8::internal 2331 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/serialize.h ('k') | test/cctest/test-serialize.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698