OLD | NEW |
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 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
242 return FLAG_crankshaft && | 242 return FLAG_crankshaft && |
243 !(literal()->flags() & AstProperties::kDontSelfOptimize) && | 243 !(literal()->flags() & AstProperties::kDontSelfOptimize) && |
244 !literal()->dont_optimize() && | 244 !literal()->dont_optimize() && |
245 literal()->scope()->AllowsLazyCompilation() && | 245 literal()->scope()->AllowsLazyCompilation() && |
246 (!has_shared_info() || !shared_info()->optimization_disabled()); | 246 (!has_shared_info() || !shared_info()->optimization_disabled()); |
247 } | 247 } |
248 | 248 |
249 | 249 |
250 void CompilationInfo::EnsureFeedbackVector() { | 250 void CompilationInfo::EnsureFeedbackVector() { |
251 if (feedback_vector_.is_null()) { | 251 if (feedback_vector_.is_null()) { |
252 feedback_vector_ = isolate()->factory()->NewTypeFeedbackVector( | 252 feedback_vector_ = |
253 literal()->feedback_vector_spec()); | 253 TypeFeedbackVector::New(isolate(), literal()->feedback_vector_spec()); |
254 } | 254 } |
255 | 255 |
256 // It's very important that recompiles do not alter the structure of the | 256 // It's very important that recompiles do not alter the structure of the |
257 // type feedback vector. | 257 // type feedback vector. |
258 CHECK(!feedback_vector_->SpecDiffersFrom(literal()->feedback_vector_spec())); | 258 CHECK(!feedback_vector_->SpecDiffersFrom(literal()->feedback_vector_spec())); |
259 } | 259 } |
260 | 260 |
261 | 261 |
262 bool CompilationInfo::has_simple_parameters() { | 262 bool CompilationInfo::has_simple_parameters() { |
263 return scope()->has_simple_parameters(); | 263 return scope()->has_simple_parameters(); |
(...skipping 1497 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1761 } | 1761 } |
1762 | 1762 |
1763 #if DEBUG | 1763 #if DEBUG |
1764 void CompilationInfo::PrintAstForTesting() { | 1764 void CompilationInfo::PrintAstForTesting() { |
1765 PrintF("--- Source from AST ---\n%s\n", | 1765 PrintF("--- Source from AST ---\n%s\n", |
1766 PrettyPrinter(isolate(), zone()).PrintProgram(literal())); | 1766 PrettyPrinter(isolate(), zone()).PrintProgram(literal())); |
1767 } | 1767 } |
1768 #endif | 1768 #endif |
1769 } // namespace internal | 1769 } // namespace internal |
1770 } // namespace v8 | 1770 } // namespace v8 |
OLD | NEW |