Index: src/full-codegen.cc |
=================================================================== |
--- src/full-codegen.cc (revision 12237) |
+++ src/full-codegen.cc (working copy) |
@@ -36,6 +36,7 @@ |
#include "prettyprinter.h" |
#include "scopes.h" |
#include "scopeinfo.h" |
+#include "snapshot.h" |
#include "stub-cache.h" |
namespace v8 { |
@@ -382,6 +383,20 @@ |
} |
+void FullCodeGenerator::Initialize() { |
+ // The generation of debug code must match between the snapshot code and the |
+ // code that is generated later. This is assumed by the debugger when it is |
+ // calculating PC offsets after generating a debug version of code. Therefore |
+ // we disable the production of debug code in the full compiler if we are |
+ // either generating a snapshot or we booted from a snapshot. |
+ generate_debug_code_ = FLAG_debug_code && |
+ !Serializer::enabled() && |
+ !Snapshot::HaveASnapshotToStartFrom(); |
+ masm_->set_emit_debug_code(generate_debug_code_); |
+ masm_->set_predictable_code_size(true); |
+} |
+ |
+ |
void FullCodeGenerator::PopulateTypeFeedbackCells(Handle<Code> code) { |
if (type_feedback_cells_.is_empty()) return; |
int length = type_feedback_cells_.length(); |