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/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #include "src/compiler.h" | 7 #include "src/compiler.h" |
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 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
269 return Code::ComputeFlags(code_stub()->GetCodeKind(), | 269 return Code::ComputeFlags(code_stub()->GetCodeKind(), |
270 code_stub()->GetICState(), | 270 code_stub()->GetICState(), |
271 code_stub()->GetExtraICState(), | 271 code_stub()->GetExtraICState(), |
272 code_stub()->GetStubType()); | 272 code_stub()->GetStubType()); |
273 } else { | 273 } else { |
274 return Code::ComputeFlags(Code::OPTIMIZED_FUNCTION); | 274 return Code::ComputeFlags(Code::OPTIMIZED_FUNCTION); |
275 } | 275 } |
276 } | 276 } |
277 | 277 |
278 | 278 |
| 279 // Primitive functions are unlikely to be picked up by the stack-walking |
| 280 // profiler, so they trigger their own optimization when they're called |
| 281 // for the SharedFunctionInfo::kCallsUntilPrimitiveOptimization-th time. |
| 282 bool CompilationInfo::ShouldSelfOptimize() { |
| 283 return FLAG_crankshaft && |
| 284 !function()->flags()->Contains(kDontSelfOptimize) && |
| 285 !function()->dont_optimize() && |
| 286 function()->scope()->AllowsLazyCompilation() && |
| 287 (shared_info().is_null() || !shared_info()->optimization_disabled()); |
| 288 } |
| 289 |
| 290 |
279 void CompilationInfo::PrepareForCompilation(Scope* scope) { | 291 void CompilationInfo::PrepareForCompilation(Scope* scope) { |
280 DCHECK(scope_ == NULL); | 292 DCHECK(scope_ == NULL); |
281 scope_ = scope; | 293 scope_ = scope; |
282 } | 294 } |
283 | 295 |
284 | 296 |
285 void CompilationInfo::EnsureFeedbackVector() { | 297 void CompilationInfo::EnsureFeedbackVector() { |
286 if (feedback_vector_.is_null()) { | 298 if (feedback_vector_.is_null()) { |
287 feedback_vector_ = isolate()->factory()->NewTypeFeedbackVector( | 299 feedback_vector_ = isolate()->factory()->NewTypeFeedbackVector( |
288 function()->slot_count(), function()->ic_slot_count()); | 300 function()->slot_count(), function()->ic_slot_count()); |
(...skipping 1198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1487 AllowHandleDereference allow_deref; | 1499 AllowHandleDereference allow_deref; |
1488 bool tracing_on = info()->IsStub() | 1500 bool tracing_on = info()->IsStub() |
1489 ? FLAG_trace_hydrogen_stubs | 1501 ? FLAG_trace_hydrogen_stubs |
1490 : (FLAG_trace_hydrogen && | 1502 : (FLAG_trace_hydrogen && |
1491 info()->closure()->PassesFilter(FLAG_trace_hydrogen_filter)); | 1503 info()->closure()->PassesFilter(FLAG_trace_hydrogen_filter)); |
1492 return (tracing_on && | 1504 return (tracing_on && |
1493 base::OS::StrChr(const_cast<char*>(FLAG_trace_phase), name_[0]) != NULL); | 1505 base::OS::StrChr(const_cast<char*>(FLAG_trace_phase), name_[0]) != NULL); |
1494 } | 1506 } |
1495 | 1507 |
1496 } } // namespace v8::internal | 1508 } } // namespace v8::internal |
OLD | NEW |