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

Side by Side Diff: src/hydrogen.cc

Issue 1063373003: Prevent overzealous bailout due to script context. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Adapt tests. Created 5 years, 8 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 | test/cctest/cctest.status » ('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 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 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/hydrogen.h" 5 #include "src/hydrogen.h"
6 6
7 #include <sstream> 7 #include <sstream>
8 8
9 #include "src/v8.h" 9 #include "src/v8.h"
10 10
(...skipping 4202 matching lines...) Expand 10 before | Expand all | Expand 10 after
4213 } 4213 }
4214 } 4214 }
4215 4215
4216 4216
4217 bool HOptimizedGraphBuilder::BuildGraph() { 4217 bool HOptimizedGraphBuilder::BuildGraph() {
4218 if (IsSubclassConstructor(current_info()->function()->kind())) { 4218 if (IsSubclassConstructor(current_info()->function()->kind())) {
4219 Bailout(kSuperReference); 4219 Bailout(kSuperReference);
4220 return false; 4220 return false;
4221 } 4221 }
4222 4222
4223 if (current_info()->scope()->is_script_scope()) { 4223 int slots = current_info()->num_heap_slots() - Context::MIN_CONTEXT_SLOTS;
4224 if (current_info()->scope()->is_script_scope() && slots > 0) {
4224 Bailout(kScriptContext); 4225 Bailout(kScriptContext);
4225 return false; 4226 return false;
4226 } 4227 }
4227 4228
4228 Scope* scope = current_info()->scope(); 4229 Scope* scope = current_info()->scope();
4229 SetUpScope(scope); 4230 SetUpScope(scope);
4230 4231
4231 // Add an edge to the body entry. This is warty: the graph's start 4232 // Add an edge to the body entry. This is warty: the graph's start
4232 // environment will be used by the Lithium translation as the initial 4233 // environment will be used by the Lithium translation as the initial
4233 // environment on graph entry, but it has now been mutated by the 4234 // environment on graph entry, but it has now been mutated by the
(...skipping 8685 matching lines...) Expand 10 before | Expand all | Expand 10 after
12919 if (ShouldProduceTraceOutput()) { 12920 if (ShouldProduceTraceOutput()) {
12920 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); 12921 isolate()->GetHTracer()->TraceHydrogen(name(), graph_);
12921 } 12922 }
12922 12923
12923 #ifdef DEBUG 12924 #ifdef DEBUG
12924 graph_->Verify(false); // No full verify. 12925 graph_->Verify(false); // No full verify.
12925 #endif 12926 #endif
12926 } 12927 }
12927 12928
12928 } } // namespace v8::internal 12929 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | test/cctest/cctest.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698