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