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 #include <memory> | 8 #include <memory> |
9 | 9 |
10 #include "src/asmjs/asm-js.h" | 10 #include "src/asmjs/asm-js.h" |
(...skipping 460 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
471 } | 471 } |
472 if (literal->flags() & AstProperties::kMustUseIgnitionTurbo) { | 472 if (literal->flags() & AstProperties::kMustUseIgnitionTurbo) { |
473 shared_info->set_must_use_ignition_turbo(true); | 473 shared_info->set_must_use_ignition_turbo(true); |
474 } | 474 } |
475 } | 475 } |
476 | 476 |
477 bool Renumber(ParseInfo* parse_info, | 477 bool Renumber(ParseInfo* parse_info, |
478 Compiler::EagerInnerFunctionLiterals* eager_literals) { | 478 Compiler::EagerInnerFunctionLiterals* eager_literals) { |
479 RuntimeCallTimerScope runtimeTimer(parse_info->isolate(), | 479 RuntimeCallTimerScope runtimeTimer(parse_info->isolate(), |
480 &RuntimeCallStats::CompileRenumber); | 480 &RuntimeCallStats::CompileRenumber); |
| 481 |
| 482 // CollectTypeProfile uses its own feedback slots. If we have existing |
| 483 // FeedbackMetadata, we can only collect type profile, if the feedback vector |
| 484 // has the appropriate slots. |
| 485 bool collect_type_profile; |
| 486 if (parse_info->shared_info().is_null() || |
| 487 parse_info->shared_info()->feedback_metadata()->length() == 0) { |
| 488 collect_type_profile = FLAG_type_profile; |
| 489 } else { |
| 490 collect_type_profile = |
| 491 parse_info->shared_info()->feedback_metadata()->HasTypeProfileSlot(); |
| 492 } |
| 493 |
481 if (!AstNumbering::Renumber( | 494 if (!AstNumbering::Renumber( |
482 parse_info->isolate()->stack_guard()->real_climit(), | 495 parse_info->isolate()->stack_guard()->real_climit(), |
483 parse_info->zone(), parse_info->literal(), eager_literals)) { | 496 parse_info->zone(), parse_info->literal(), eager_literals, |
| 497 collect_type_profile)) { |
484 return false; | 498 return false; |
485 } | 499 } |
486 if (!parse_info->shared_info().is_null()) { | 500 if (!parse_info->shared_info().is_null()) { |
487 SetSharedFunctionFlagsFromLiteral(parse_info->literal(), | 501 SetSharedFunctionFlagsFromLiteral(parse_info->literal(), |
488 parse_info->shared_info()); | 502 parse_info->shared_info()); |
489 } | 503 } |
490 return true; | 504 return true; |
491 } | 505 } |
492 | 506 |
493 bool GenerateUnoptimizedCode(CompilationInfo* info) { | 507 bool GenerateUnoptimizedCode(CompilationInfo* info) { |
(...skipping 1444 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1938 } | 1952 } |
1939 | 1953 |
1940 if (shared->is_compiled()) { | 1954 if (shared->is_compiled()) { |
1941 // TODO(mvstanton): pass pretenure flag to EnsureLiterals. | 1955 // TODO(mvstanton): pass pretenure flag to EnsureLiterals. |
1942 JSFunction::EnsureLiterals(function); | 1956 JSFunction::EnsureLiterals(function); |
1943 } | 1957 } |
1944 } | 1958 } |
1945 | 1959 |
1946 } // namespace internal | 1960 } // namespace internal |
1947 } // namespace v8 | 1961 } // namespace v8 |
OLD | NEW |