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

Side by Side Diff: src/compiler.cc

Issue 1255383004: [compiler] Verify that type feedback vector structure is the same on recompile. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: REBASE and comment change. Created 5 years, 4 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 193 matching lines...) Expand 10 before | Expand all | Expand 10 after
204 bool CompilationInfo::ShouldSelfOptimize() { 204 bool CompilationInfo::ShouldSelfOptimize() {
205 return FLAG_crankshaft && 205 return FLAG_crankshaft &&
206 !(function()->flags() & AstProperties::kDontSelfOptimize) && 206 !(function()->flags() & AstProperties::kDontSelfOptimize) &&
207 !function()->dont_optimize() && 207 !function()->dont_optimize() &&
208 function()->scope()->AllowsLazyCompilation() && 208 function()->scope()->AllowsLazyCompilation() &&
209 (!has_shared_info() || !shared_info()->optimization_disabled()); 209 (!has_shared_info() || !shared_info()->optimization_disabled());
210 } 210 }
211 211
212 212
213 void CompilationInfo::EnsureFeedbackVector() { 213 void CompilationInfo::EnsureFeedbackVector() {
214 if (feedback_vector_.is_null() || 214 if (feedback_vector_.is_null()) {
215 feedback_vector_->SpecDiffersFrom(function()->feedback_vector_spec())) {
216 feedback_vector_ = isolate()->factory()->NewTypeFeedbackVector( 215 feedback_vector_ = isolate()->factory()->NewTypeFeedbackVector(
217 function()->feedback_vector_spec()); 216 function()->feedback_vector_spec());
218 } 217 }
218
219 // It's very important that recompiles do not alter the structure of the
220 // type feedback vector.
221 CHECK(!feedback_vector_->SpecDiffersFrom(function()->feedback_vector_spec()));
219 } 222 }
220 223
221 224
222 bool CompilationInfo::is_simple_parameter_list() { 225 bool CompilationInfo::is_simple_parameter_list() {
223 return scope()->is_simple_parameter_list(); 226 return scope()->is_simple_parameter_list();
224 } 227 }
225 228
226 229
227 bool CompilationInfo::MayUseThis() const { 230 bool CompilationInfo::MayUseThis() const {
228 return scope()->has_this_declaration() && scope()->receiver()->is_used(); 231 return scope()->has_this_declaration() && scope()->receiver()->is_used();
(...skipping 1441 matching lines...) Expand 10 before | Expand all | Expand 10 after
1670 1673
1671 1674
1672 #if DEBUG 1675 #if DEBUG
1673 void CompilationInfo::PrintAstForTesting() { 1676 void CompilationInfo::PrintAstForTesting() {
1674 PrintF("--- Source from AST ---\n%s\n", 1677 PrintF("--- Source from AST ---\n%s\n",
1675 PrettyPrinter(isolate(), zone()).PrintProgram(function())); 1678 PrettyPrinter(isolate(), zone()).PrintProgram(function()));
1676 } 1679 }
1677 #endif 1680 #endif
1678 } // namespace internal 1681 } // namespace internal
1679 } // namespace v8 1682 } // 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