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

Side by Side Diff: src/compiler.cc

Issue 1258583002: Debugger: correctly redirect eval code. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: always include debug slots for eval Created 5 years, 5 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
« no previous file with comments | « no previous file | no next file » | 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/compiler.h" 5 #include "src/compiler.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "src/ast-numbering.h" 9 #include "src/ast-numbering.h"
10 #include "src/bootstrapper.h" 10 #include "src/bootstrapper.h"
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 : CompilationInfo(parse_info, nullptr, BASE, parse_info->isolate(), 105 : CompilationInfo(parse_info, nullptr, BASE, parse_info->isolate(),
106 parse_info->zone()) { 106 parse_info->zone()) {
107 // Compiling for the snapshot typically results in different code than 107 // Compiling for the snapshot typically results in different code than
108 // compiling later on. This means that code recompiled with deoptimization 108 // compiling later on. This means that code recompiled with deoptimization
109 // support won't be "equivalent" (as defined by SharedFunctionInfo:: 109 // support won't be "equivalent" (as defined by SharedFunctionInfo::
110 // EnableDeoptimizationSupport), so it will replace the old code and all 110 // EnableDeoptimizationSupport), so it will replace the old code and all
111 // its type feedback. To avoid this, always compile functions in the snapshot 111 // its type feedback. To avoid this, always compile functions in the snapshot
112 // with deoptimization support. 112 // with deoptimization support.
113 if (isolate_->serializer_enabled()) EnableDeoptimizationSupport(); 113 if (isolate_->serializer_enabled()) EnableDeoptimizationSupport();
114 114
115 if (isolate_->debug()->is_active()) MarkAsDebug();
116 if (FLAG_context_specialization) MarkAsContextSpecializing(); 115 if (FLAG_context_specialization) MarkAsContextSpecializing();
117 if (FLAG_turbo_inlining) MarkAsInliningEnabled(); 116 if (FLAG_turbo_inlining) MarkAsInliningEnabled();
118 if (FLAG_turbo_source_positions) MarkAsSourcePositionsEnabled(); 117 if (FLAG_turbo_source_positions) MarkAsSourcePositionsEnabled();
119 if (FLAG_turbo_splitting) MarkAsSplittingEnabled(); 118 if (FLAG_turbo_splitting) MarkAsSplittingEnabled();
120 if (FLAG_turbo_types) MarkAsTypingEnabled(); 119 if (FLAG_turbo_types) MarkAsTypingEnabled();
121 120
122 if (has_shared_info()) { 121 if (has_shared_info()) {
123 if (shared_info()->is_compiled()) { 122 if (shared_info()->is_compiled()) {
124 // We should initialize the CompilationInfo feedback vector from the 123 // We should initialize the CompilationInfo feedback vector from the
125 // passed in shared info, rather than creating a new one. 124 // passed in shared info, rather than creating a new one.
(...skipping 1033 matching lines...) Expand 10 before | Expand all | Expand 10 after
1159 script->set_origin_options(options); 1158 script->set_origin_options(options);
1160 Zone zone; 1159 Zone zone;
1161 ParseInfo parse_info(&zone, script); 1160 ParseInfo parse_info(&zone, script);
1162 CompilationInfo info(&parse_info); 1161 CompilationInfo info(&parse_info);
1163 parse_info.set_eval(); 1162 parse_info.set_eval();
1164 if (context->IsNativeContext()) parse_info.set_global(); 1163 if (context->IsNativeContext()) parse_info.set_global();
1165 parse_info.set_language_mode(language_mode); 1164 parse_info.set_language_mode(language_mode);
1166 parse_info.set_parse_restriction(restriction); 1165 parse_info.set_parse_restriction(restriction);
1167 parse_info.set_context(context); 1166 parse_info.set_context(context);
1168 1167
1169 // If we eval from debug code, compile for debugging as well. 1168 info.MarkAsDebug();
1170 if (outer_info->HasDebugCode()) info.MarkAsDebug();
1171 Debug::RecordEvalCaller(script); 1169 Debug::RecordEvalCaller(script);
1172 1170
1173 shared_info = CompileToplevel(&info); 1171 shared_info = CompileToplevel(&info);
1174 1172
1175 if (shared_info.is_null()) { 1173 if (shared_info.is_null()) {
1176 return MaybeHandle<JSFunction>(); 1174 return MaybeHandle<JSFunction>();
1177 } else { 1175 } else {
1178 // Explicitly disable optimization for eval code. We're not yet prepared 1176 // Explicitly disable optimization for eval code. We're not yet prepared
1179 // to handle eval-code in the optimizing compiler. 1177 // to handle eval-code in the optimizing compiler.
1180 if (restriction != ONLY_SINGLE_FUNCTION_LITERAL) { 1178 if (restriction != ONLY_SINGLE_FUNCTION_LITERAL) {
(...skipping 444 matching lines...) Expand 10 before | Expand all | Expand 10 after
1625 1623
1626 1624
1627 #if DEBUG 1625 #if DEBUG
1628 void CompilationInfo::PrintAstForTesting() { 1626 void CompilationInfo::PrintAstForTesting() {
1629 PrintF("--- Source from AST ---\n%s\n", 1627 PrintF("--- Source from AST ---\n%s\n",
1630 PrettyPrinter(isolate(), zone()).PrintProgram(function())); 1628 PrettyPrinter(isolate(), zone()).PrintProgram(function()));
1631 } 1629 }
1632 #endif 1630 #endif
1633 } // namespace internal 1631 } // namespace internal
1634 } // namespace v8 1632 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698