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 492 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
503 if ((FLAG_turbo_asm && info()->shared_info()->asm_function()) || | 503 if ((FLAG_turbo_asm && info()->shared_info()->asm_function()) || |
504 info()->closure()->PassesFilter(FLAG_turbo_filter)) { | 504 info()->closure()->PassesFilter(FLAG_turbo_filter)) { |
505 if (FLAG_trace_opt) { | 505 if (FLAG_trace_opt) { |
506 OFStream os(stdout); | 506 OFStream os(stdout); |
507 os << "[compiling method " << Brief(*info()->closure()) | 507 os << "[compiling method " << Brief(*info()->closure()) |
508 << " using TurboFan"; | 508 << " using TurboFan"; |
509 if (info()->is_osr()) os << " OSR"; | 509 if (info()->is_osr()) os << " OSR"; |
510 os << "]" << std::endl; | 510 os << "]" << std::endl; |
511 } | 511 } |
512 | 512 |
513 if (info()->shared_info()->asm_function()) { | 513 // Do not enable context specialization if the code is intended to be |
514 // included in a start-up snapshot. | |
515 if (info()->shared_info()->asm_function() && | |
516 !isolate()->serializer_enabled()) { | |
Michael Starzinger
2015/03/04 13:43:50
As discussed offline: Instead of narrowing the int
| |
514 info()->MarkAsContextSpecializing(); | 517 info()->MarkAsContextSpecializing(); |
515 } | 518 } |
516 | 519 |
517 Timer t(this, &time_taken_to_create_graph_); | 520 Timer t(this, &time_taken_to_create_graph_); |
518 compiler::Pipeline pipeline(info()); | 521 compiler::Pipeline pipeline(info()); |
519 pipeline.GenerateCode(); | 522 pipeline.GenerateCode(); |
520 if (!info()->code().is_null()) { | 523 if (!info()->code().is_null()) { |
521 return SetLastStatus(SUCCEEDED); | 524 return SetLastStatus(SUCCEEDED); |
522 } | 525 } |
523 } | 526 } |
(...skipping 416 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
940 // deopt from turbofan code. | 943 // deopt from turbofan code. |
941 if (FLAG_turbo_asm && function->shared()->asm_function() && | 944 if (FLAG_turbo_asm && function->shared()->asm_function() && |
942 (FLAG_turbo_deoptimization || !isolate->debug()->is_active()) && | 945 (FLAG_turbo_deoptimization || !isolate->debug()->is_active()) && |
943 !FLAG_turbo_osr) { | 946 !FLAG_turbo_osr) { |
944 CompilationInfoWithZone info(function); | 947 CompilationInfoWithZone info(function); |
945 | 948 |
946 VMState<COMPILER> state(isolate); | 949 VMState<COMPILER> state(isolate); |
947 PostponeInterruptsScope postpone(isolate); | 950 PostponeInterruptsScope postpone(isolate); |
948 | 951 |
949 info.SetOptimizing(BailoutId::None(), handle(function->shared()->code())); | 952 info.SetOptimizing(BailoutId::None(), handle(function->shared()->code())); |
950 info.MarkAsContextSpecializing(); | 953 |
954 // Do not enable context specialization if the code is intended to be | |
955 // included in a start-up snapshot. | |
956 if (!isolate->serializer_enabled()) info.MarkAsContextSpecializing(); | |
951 | 957 |
952 if (GetOptimizedCodeNow(&info)) { | 958 if (GetOptimizedCodeNow(&info)) { |
953 DCHECK(function->shared()->is_compiled()); | 959 DCHECK(function->shared()->is_compiled()); |
954 return info.code(); | 960 return info.code(); |
955 } | 961 } |
956 // We have failed compilation. If there was an exception clear it so that | 962 // We have failed compilation. If there was an exception clear it so that |
957 // we can compile unoptimized code. | 963 // we can compile unoptimized code. |
958 if (isolate->has_pending_exception()) isolate->clear_pending_exception(); | 964 if (isolate->has_pending_exception()) isolate->clear_pending_exception(); |
959 } | 965 } |
960 | 966 |
(...skipping 648 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1609 } | 1615 } |
1610 | 1616 |
1611 | 1617 |
1612 #if DEBUG | 1618 #if DEBUG |
1613 void CompilationInfo::PrintAstForTesting() { | 1619 void CompilationInfo::PrintAstForTesting() { |
1614 PrintF("--- Source from AST ---\n%s\n", | 1620 PrintF("--- Source from AST ---\n%s\n", |
1615 PrettyPrinter(isolate(), zone()).PrintProgram(function())); | 1621 PrettyPrinter(isolate(), zone()).PrintProgram(function())); |
1616 } | 1622 } |
1617 #endif | 1623 #endif |
1618 } } // namespace v8::internal | 1624 } } // namespace v8::internal |
OLD | NEW |