| 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 561 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 572 | 572 |
| 573 shared->set_feedback_vector(*info->feedback_vector()); | 573 shared->set_feedback_vector(*info->feedback_vector()); |
| 574 | 574 |
| 575 // Set the expected number of properties for instances. | 575 // Set the expected number of properties for instances. |
| 576 FunctionLiteral* lit = info->function(); | 576 FunctionLiteral* lit = info->function(); |
| 577 int expected = lit->expected_property_count(); | 577 int expected = lit->expected_property_count(); |
| 578 SetExpectedNofPropertiesFromEstimate(shared, expected); | 578 SetExpectedNofPropertiesFromEstimate(shared, expected); |
| 579 | 579 |
| 580 // Check the function has compiled code. | 580 // Check the function has compiled code. |
| 581 ASSERT(shared->is_compiled()); | 581 ASSERT(shared->is_compiled()); |
| 582 shared->set_dont_optimize_reason(lit->dont_optimize_reason()); | 582 shared->set_bailout_reason(lit->dont_optimize_reason()); |
| 583 shared->set_dont_inline(lit->flags()->Contains(kDontInline)); | |
| 584 shared->set_ast_node_count(lit->ast_node_count()); | 583 shared->set_ast_node_count(lit->ast_node_count()); |
| 585 shared->set_strict_mode(lit->strict_mode()); | 584 shared->set_strict_mode(lit->strict_mode()); |
| 586 } | 585 } |
| 587 | 586 |
| 588 | 587 |
| 589 // Sets the function info on a function. | 588 // Sets the function info on a function. |
| 590 // The start_position points to the first '(' character after the function name | 589 // The start_position points to the first '(' character after the function name |
| 591 // in the full script source. When counting characters in the script source the | 590 // in the full script source. When counting characters in the script source the |
| 592 // the first character is number 0 (not 1). | 591 // the first character is number 0 (not 1). |
| 593 static void SetFunctionInfo(Handle<SharedFunctionInfo> function_info, | 592 static void SetFunctionInfo(Handle<SharedFunctionInfo> function_info, |
| (...skipping 11 matching lines...) Expand all Loading... |
| 605 function_info->set_is_toplevel(is_toplevel); | 604 function_info->set_is_toplevel(is_toplevel); |
| 606 function_info->set_inferred_name(*lit->inferred_name()); | 605 function_info->set_inferred_name(*lit->inferred_name()); |
| 607 function_info->set_allows_lazy_compilation(lit->AllowsLazyCompilation()); | 606 function_info->set_allows_lazy_compilation(lit->AllowsLazyCompilation()); |
| 608 function_info->set_allows_lazy_compilation_without_context( | 607 function_info->set_allows_lazy_compilation_without_context( |
| 609 lit->AllowsLazyCompilationWithoutContext()); | 608 lit->AllowsLazyCompilationWithoutContext()); |
| 610 function_info->set_strict_mode(lit->strict_mode()); | 609 function_info->set_strict_mode(lit->strict_mode()); |
| 611 function_info->set_uses_arguments(lit->scope()->arguments() != NULL); | 610 function_info->set_uses_arguments(lit->scope()->arguments() != NULL); |
| 612 function_info->set_has_duplicate_parameters(lit->has_duplicate_parameters()); | 611 function_info->set_has_duplicate_parameters(lit->has_duplicate_parameters()); |
| 613 function_info->set_ast_node_count(lit->ast_node_count()); | 612 function_info->set_ast_node_count(lit->ast_node_count()); |
| 614 function_info->set_is_function(lit->is_function()); | 613 function_info->set_is_function(lit->is_function()); |
| 615 function_info->set_dont_optimize_reason(lit->dont_optimize_reason()); | 614 function_info->set_bailout_reason(lit->dont_optimize_reason()); |
| 616 function_info->set_dont_inline(lit->flags()->Contains(kDontInline)); | |
| 617 function_info->set_dont_cache(lit->flags()->Contains(kDontCache)); | 615 function_info->set_dont_cache(lit->flags()->Contains(kDontCache)); |
| 618 function_info->set_is_generator(lit->is_generator()); | 616 function_info->set_is_generator(lit->is_generator()); |
| 619 } | 617 } |
| 620 | 618 |
| 621 | 619 |
| 622 static bool CompileUnoptimizedCode(CompilationInfo* info) { | 620 static bool CompileUnoptimizedCode(CompilationInfo* info) { |
| 623 ASSERT(info->function() != NULL); | 621 ASSERT(info->function() != NULL); |
| 624 if (!Rewriter::Rewrite(info)) return false; | 622 if (!Rewriter::Rewrite(info)) return false; |
| 625 if (!Scope::Analyze(info)) return false; | 623 if (!Scope::Analyze(info)) return false; |
| 626 ASSERT(info->scope() != NULL); | 624 ASSERT(info->scope() != NULL); |
| (...skipping 684 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1311 AllowHandleDereference allow_deref; | 1309 AllowHandleDereference allow_deref; |
| 1312 bool tracing_on = info()->IsStub() | 1310 bool tracing_on = info()->IsStub() |
| 1313 ? FLAG_trace_hydrogen_stubs | 1311 ? FLAG_trace_hydrogen_stubs |
| 1314 : (FLAG_trace_hydrogen && | 1312 : (FLAG_trace_hydrogen && |
| 1315 info()->closure()->PassesFilter(FLAG_trace_hydrogen_filter)); | 1313 info()->closure()->PassesFilter(FLAG_trace_hydrogen_filter)); |
| 1316 return (tracing_on && | 1314 return (tracing_on && |
| 1317 OS::StrChr(const_cast<char*>(FLAG_trace_phase), name_[0]) != NULL); | 1315 OS::StrChr(const_cast<char*>(FLAG_trace_phase), name_[0]) != NULL); |
| 1318 } | 1316 } |
| 1319 | 1317 |
| 1320 } } // namespace v8::internal | 1318 } } // namespace v8::internal |
| OLD | NEW |