Chromium Code Reviews

Side by Side Diff: src/full-codegen.cc

Issue 373713006: Introduce code serializer/deserializer. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | | Annotate | Revision Log
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/codegen.h" 7 #include "src/codegen.h"
8 #include "src/compiler.h" 8 #include "src/compiler.h"
9 #include "src/debug.h" 9 #include "src/debug.h"
10 #include "src/full-codegen.h" 10 #include "src/full-codegen.h"
(...skipping 283 matching lines...)
294 isolate, Logger::TimerEventScope::v8_compile_full_code); 294 isolate, Logger::TimerEventScope::v8_compile_full_code);
295 295
296 Handle<Script> script = info->script(); 296 Handle<Script> script = info->script();
297 if (!script->IsUndefined() && !script->source()->IsUndefined()) { 297 if (!script->IsUndefined() && !script->source()->IsUndefined()) {
298 int len = String::cast(script->source())->length(); 298 int len = String::cast(script->source())->length();
299 isolate->counters()->total_full_codegen_source_size()->Increment(len); 299 isolate->counters()->total_full_codegen_source_size()->Increment(len);
300 } 300 }
301 CodeGenerator::MakeCodePrologue(info, "full"); 301 CodeGenerator::MakeCodePrologue(info, "full");
302 const int kInitialBufferSize = 4 * KB; 302 const int kInitialBufferSize = 4 * KB;
303 MacroAssembler masm(info->isolate(), NULL, kInitialBufferSize); 303 MacroAssembler masm(info->isolate(), NULL, kInitialBufferSize);
304 if (FLAG_serialize_toplevel &&
305 info->cached_data_mode() == PRODUCE_CACHED_DATA && info->is_global()) {
306 masm.enable_serializer();
307 }
308
304 #ifdef ENABLE_GDB_JIT_INTERFACE 309 #ifdef ENABLE_GDB_JIT_INTERFACE
305 masm.positions_recorder()->StartGDBJITLineInfoRecording(); 310 masm.positions_recorder()->StartGDBJITLineInfoRecording();
306 #endif 311 #endif
307 LOG_CODE_EVENT(isolate, 312 LOG_CODE_EVENT(isolate,
308 CodeStartLinePosInfoRecordEvent(masm.positions_recorder())); 313 CodeStartLinePosInfoRecordEvent(masm.positions_recorder()));
309 314
310 FullCodeGenerator cgen(&masm, info); 315 FullCodeGenerator cgen(&masm, info);
311 cgen.Generate(); 316 cgen.Generate();
312 if (cgen.HasStackOverflow()) { 317 if (cgen.HasStackOverflow()) {
313 ASSERT(!isolate->has_pending_exception()); 318 ASSERT(!isolate->has_pending_exception());
(...skipping 1376 matching lines...)
1690 } 1695 }
1691 return true; 1696 return true;
1692 } 1697 }
1693 #endif // DEBUG 1698 #endif // DEBUG
1694 1699
1695 1700
1696 #undef __ 1701 #undef __
1697 1702
1698 1703
1699 } } // namespace v8::internal 1704 } } // namespace v8::internal
OLDNEW

Powered by Google App Engine