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 326 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
337 MODULE_NODE_LIST(DEF_VISIT) | 337 MODULE_NODE_LIST(DEF_VISIT) |
338 DECLARATION_NODE_LIST(DEF_VISIT) | 338 DECLARATION_NODE_LIST(DEF_VISIT) |
339 #undef DEF_VISIT | 339 #undef DEF_VISIT |
340 }; | 340 }; |
341 | 341 |
342 | 342 |
343 OptimizedCompileJob::Status OptimizedCompileJob::CreateGraph() { | 343 OptimizedCompileJob::Status OptimizedCompileJob::CreateGraph() { |
344 DCHECK(info()->IsOptimizing()); | 344 DCHECK(info()->IsOptimizing()); |
345 DCHECK(!info()->IsCompilingForDebugging()); | 345 DCHECK(!info()->IsCompilingForDebugging()); |
346 | 346 |
347 // We should never arrive here if optimization has been disabled on the | 347 // Optimization could have been disabled by the parser. |
348 // shared function info. | 348 if (info()->shared_info()->optimization_disabled()) { |
349 DCHECK(!info()->shared_info()->optimization_disabled()); | 349 return AbortOptimization( |
| 350 info()->shared_info()->disable_optimization_reason()); |
| 351 } |
350 | 352 |
351 // Do not use crankshaft if we need to be able to set break points. | 353 // Do not use crankshaft if we need to be able to set break points. |
352 if (isolate()->DebuggerHasBreakPoints()) { | 354 if (isolate()->DebuggerHasBreakPoints()) { |
353 return RetryOptimization(kDebuggerHasBreakPoints); | 355 return RetryOptimization(kDebuggerHasBreakPoints); |
354 } | 356 } |
355 | 357 |
356 // Limit the number of times we re-compile a functions with | 358 // Limit the number of times we re-compile a functions with |
357 // the optimizing compiler. | 359 // the optimizing compiler. |
358 const int kMaxOptCount = | 360 const int kMaxOptCount = |
359 FLAG_deopt_every_n_times == 0 ? FLAG_max_opt_count : 1000; | 361 FLAG_deopt_every_n_times == 0 ? FLAG_max_opt_count : 1000; |
(...skipping 1139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1499 AllowHandleDereference allow_deref; | 1501 AllowHandleDereference allow_deref; |
1500 bool tracing_on = info()->IsStub() | 1502 bool tracing_on = info()->IsStub() |
1501 ? FLAG_trace_hydrogen_stubs | 1503 ? FLAG_trace_hydrogen_stubs |
1502 : (FLAG_trace_hydrogen && | 1504 : (FLAG_trace_hydrogen && |
1503 info()->closure()->PassesFilter(FLAG_trace_hydrogen_filter)); | 1505 info()->closure()->PassesFilter(FLAG_trace_hydrogen_filter)); |
1504 return (tracing_on && | 1506 return (tracing_on && |
1505 base::OS::StrChr(const_cast<char*>(FLAG_trace_phase), name_[0]) != NULL); | 1507 base::OS::StrChr(const_cast<char*>(FLAG_trace_phase), name_[0]) != NULL); |
1506 } | 1508 } |
1507 | 1509 |
1508 } } // namespace v8::internal | 1510 } } // namespace v8::internal |
OLD | NEW |