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

Side by Side Diff: src/compiler.cc

Issue 645533003: Use hash map to look for objects in the root array when serializing. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: make use of the hash map more often. 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 | « no previous file | src/heap/heap.cc » ('j') | src/serialize.h » ('J')
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/compiler.h" 7 #include "src/compiler.h"
8 8
9 #include "src/bootstrapper.h" 9 #include "src/bootstrapper.h"
10 #include "src/codegen.h" 10 #include "src/codegen.h"
(...skipping 1218 matching lines...) Expand 10 before | Expand all | Expand 10 after
1229 compilation_cache->PutScript(source, context, result); 1229 compilation_cache->PutScript(source, context, result);
1230 // TODO(yangguo): Issue 3628 1230 // TODO(yangguo): Issue 3628
1231 // With block scoping, top-level variables may resolve to a global, 1231 // With block scoping, top-level variables may resolve to a global,
1232 // context, which makes the code context-dependent. 1232 // context, which makes the code context-dependent.
1233 if (FLAG_serialize_toplevel && !FLAG_harmony_scoping && 1233 if (FLAG_serialize_toplevel && !FLAG_harmony_scoping &&
1234 compile_options == ScriptCompiler::kProduceCodeCache) { 1234 compile_options == ScriptCompiler::kProduceCodeCache) {
1235 HistogramTimerScope histogram_timer( 1235 HistogramTimerScope histogram_timer(
1236 isolate->counters()->compile_serialize()); 1236 isolate->counters()->compile_serialize());
1237 *cached_data = CodeSerializer::Serialize(isolate, result, source); 1237 *cached_data = CodeSerializer::Serialize(isolate, result, source);
1238 if (FLAG_profile_deserialization) { 1238 if (FLAG_profile_deserialization) {
1239 PrintF("[Compiling and serializing %d bytes took %0.3f ms]\n", 1239 PrintF("[Compiling and serializing took %0.3f ms]\n",
1240 (*cached_data)->length(), timer.Elapsed().InMillisecondsF()); 1240 timer.Elapsed().InMillisecondsF());
1241 } 1241 }
1242 } 1242 }
1243 } 1243 }
1244 1244
1245 if (result.is_null()) isolate->ReportPendingMessages(); 1245 if (result.is_null()) isolate->ReportPendingMessages();
1246 } else if (result->ic_age() != isolate->heap()->global_ic_age()) { 1246 } else if (result->ic_age() != isolate->heap()->global_ic_age()) {
1247 result->ResetForNewContext(isolate->heap()->global_ic_age()); 1247 result->ResetForNewContext(isolate->heap()->global_ic_age());
1248 } 1248 }
1249 return result; 1249 return result;
1250 } 1250 }
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after
1455 AllowHandleDereference allow_deref; 1455 AllowHandleDereference allow_deref;
1456 bool tracing_on = info()->IsStub() 1456 bool tracing_on = info()->IsStub()
1457 ? FLAG_trace_hydrogen_stubs 1457 ? FLAG_trace_hydrogen_stubs
1458 : (FLAG_trace_hydrogen && 1458 : (FLAG_trace_hydrogen &&
1459 info()->closure()->PassesFilter(FLAG_trace_hydrogen_filter)); 1459 info()->closure()->PassesFilter(FLAG_trace_hydrogen_filter));
1460 return (tracing_on && 1460 return (tracing_on &&
1461 base::OS::StrChr(const_cast<char*>(FLAG_trace_phase), name_[0]) != NULL); 1461 base::OS::StrChr(const_cast<char*>(FLAG_trace_phase), name_[0]) != NULL);
1462 } 1462 }
1463 1463
1464 } } // namespace v8::internal 1464 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | src/heap/heap.cc » ('j') | src/serialize.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698