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/bootstrapper.h" | 9 #include "src/bootstrapper.h" |
10 #include "src/codegen.h" | 10 #include "src/codegen.h" |
(...skipping 335 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
346 if (!info()->closure()->PassesFilter(FLAG_hydrogen_filter)) { | 346 if (!info()->closure()->PassesFilter(FLAG_hydrogen_filter)) { |
347 return AbortOptimization(kHydrogenFilter); | 347 return AbortOptimization(kHydrogenFilter); |
348 } | 348 } |
349 | 349 |
350 // Recompile the unoptimized version of the code if the current version | 350 // Recompile the unoptimized version of the code if the current version |
351 // doesn't have deoptimization support. Alternatively, we may decide to | 351 // doesn't have deoptimization support. Alternatively, we may decide to |
352 // run the full code generator to get a baseline for the compile-time | 352 // run the full code generator to get a baseline for the compile-time |
353 // performance of the hydrogen-based compiler. | 353 // performance of the hydrogen-based compiler. |
354 bool should_recompile = !info()->shared_info()->has_deoptimization_support(); | 354 bool should_recompile = !info()->shared_info()->has_deoptimization_support(); |
355 if (should_recompile || FLAG_hydrogen_stats) { | 355 if (should_recompile || FLAG_hydrogen_stats) { |
356 ElapsedTimer timer; | 356 base::ElapsedTimer timer; |
357 if (FLAG_hydrogen_stats) { | 357 if (FLAG_hydrogen_stats) { |
358 timer.Start(); | 358 timer.Start(); |
359 } | 359 } |
360 CompilationInfoWithZone unoptimized(info()->shared_info()); | 360 CompilationInfoWithZone unoptimized(info()->shared_info()); |
361 // Note that we use the same AST that we will use for generating the | 361 // Note that we use the same AST that we will use for generating the |
362 // optimized code. | 362 // optimized code. |
363 unoptimized.SetFunction(info()->function()); | 363 unoptimized.SetFunction(info()->function()); |
364 unoptimized.PrepareForCompilation(info()->scope()); | 364 unoptimized.PrepareForCompilation(info()->scope()); |
365 unoptimized.SetContext(info()->context()); | 365 unoptimized.SetContext(info()->context()); |
366 if (should_recompile) unoptimized.EnableDeoptimizationSupport(); | 366 if (should_recompile) unoptimized.EnableDeoptimizationSupport(); |
(...skipping 939 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1306 | 1306 |
1307 bool CompilationPhase::ShouldProduceTraceOutput() const { | 1307 bool CompilationPhase::ShouldProduceTraceOutput() const { |
1308 // Trace if the appropriate trace flag is set and the phase name's first | 1308 // Trace if the appropriate trace flag is set and the phase name's first |
1309 // character is in the FLAG_trace_phase command line parameter. | 1309 // character is in the FLAG_trace_phase command line parameter. |
1310 AllowHandleDereference allow_deref; | 1310 AllowHandleDereference allow_deref; |
1311 bool tracing_on = info()->IsStub() | 1311 bool tracing_on = info()->IsStub() |
1312 ? FLAG_trace_hydrogen_stubs | 1312 ? FLAG_trace_hydrogen_stubs |
1313 : (FLAG_trace_hydrogen && | 1313 : (FLAG_trace_hydrogen && |
1314 info()->closure()->PassesFilter(FLAG_trace_hydrogen_filter)); | 1314 info()->closure()->PassesFilter(FLAG_trace_hydrogen_filter)); |
1315 return (tracing_on && | 1315 return (tracing_on && |
1316 OS::StrChr(const_cast<char*>(FLAG_trace_phase), name_[0]) != NULL); | 1316 base::OS::StrChr(const_cast<char*>(FLAG_trace_phase), name_[0]) != NULL); |
1317 } | 1317 } |
1318 | 1318 |
1319 } } // namespace v8::internal | 1319 } } // namespace v8::internal |
OLD | NEW |