OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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 <sstream> | 5 #include <sstream> |
6 | 6 |
7 #include "src/v8.h" | 7 #include "src/v8.h" |
8 | 8 |
9 #include "src/accessors.h" | 9 #include "src/accessors.h" |
10 #include "src/allocation-site-scopes.h" | 10 #include "src/allocation-site-scopes.h" |
(...skipping 10360 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10371 } | 10371 } |
10372 PROFILE(GetIsolate(), CodeDisableOptEvent(code(), this)); | 10372 PROFILE(GetIsolate(), CodeDisableOptEvent(code(), this)); |
10373 if (FLAG_trace_opt) { | 10373 if (FLAG_trace_opt) { |
10374 PrintF("[disabled optimization for "); | 10374 PrintF("[disabled optimization for "); |
10375 ShortPrint(); | 10375 ShortPrint(); |
10376 PrintF(", reason: %s]\n", GetBailoutReason(reason)); | 10376 PrintF(", reason: %s]\n", GetBailoutReason(reason)); |
10377 } | 10377 } |
10378 } | 10378 } |
10379 | 10379 |
10380 | 10380 |
| 10381 void SharedFunctionInfo::InitFromFunctionLiteral( |
| 10382 Handle<SharedFunctionInfo> shared_info, FunctionLiteral* lit) { |
| 10383 shared_info->set_length(lit->parameter_count()); |
| 10384 if (FLAG_experimental_classes && IsSubclassConstructor(lit->kind())) { |
| 10385 shared_info->set_internal_formal_parameter_count(lit->parameter_count() + |
| 10386 1); |
| 10387 } else { |
| 10388 shared_info->set_internal_formal_parameter_count(lit->parameter_count()); |
| 10389 } |
| 10390 shared_info->set_function_token_position(lit->function_token_position()); |
| 10391 shared_info->set_start_position(lit->start_position()); |
| 10392 shared_info->set_end_position(lit->end_position()); |
| 10393 shared_info->set_is_expression(lit->is_expression()); |
| 10394 shared_info->set_is_anonymous(lit->is_anonymous()); |
| 10395 shared_info->set_inferred_name(*lit->inferred_name()); |
| 10396 shared_info->set_allows_lazy_compilation(lit->AllowsLazyCompilation()); |
| 10397 shared_info->set_allows_lazy_compilation_without_context( |
| 10398 lit->AllowsLazyCompilationWithoutContext()); |
| 10399 shared_info->set_language_mode(lit->language_mode()); |
| 10400 shared_info->set_uses_arguments(lit->scope()->arguments() != NULL); |
| 10401 shared_info->set_has_duplicate_parameters(lit->has_duplicate_parameters()); |
| 10402 shared_info->set_ast_node_count(lit->ast_node_count()); |
| 10403 shared_info->set_is_function(lit->is_function()); |
| 10404 if (lit->dont_optimize_reason() != kNoReason) { |
| 10405 shared_info->DisableOptimization(lit->dont_optimize_reason()); |
| 10406 } |
| 10407 shared_info->set_dont_cache( |
| 10408 lit->flags()->Contains(AstPropertiesFlag::kDontCache)); |
| 10409 shared_info->set_kind(lit->kind()); |
| 10410 shared_info->set_uses_super_property(lit->uses_super_property()); |
| 10411 shared_info->set_uses_super_constructor_call( |
| 10412 lit->uses_super_constructor_call()); |
| 10413 shared_info->set_asm_function(lit->scope()->asm_function()); |
| 10414 } |
| 10415 |
| 10416 |
10381 bool SharedFunctionInfo::VerifyBailoutId(BailoutId id) { | 10417 bool SharedFunctionInfo::VerifyBailoutId(BailoutId id) { |
10382 DCHECK(!id.IsNone()); | 10418 DCHECK(!id.IsNone()); |
10383 Code* unoptimized = code(); | 10419 Code* unoptimized = code(); |
10384 DeoptimizationOutputData* data = | 10420 DeoptimizationOutputData* data = |
10385 DeoptimizationOutputData::cast(unoptimized->deoptimization_data()); | 10421 DeoptimizationOutputData::cast(unoptimized->deoptimization_data()); |
10386 unsigned ignore = Deoptimizer::GetOutputInfo(data, id, this); | 10422 unsigned ignore = Deoptimizer::GetOutputInfo(data, id, this); |
10387 USE(ignore); | 10423 USE(ignore); |
10388 return true; // Return true if there was no DCHECK. | 10424 return true; // Return true if there was no DCHECK. |
10389 } | 10425 } |
10390 | 10426 |
(...skipping 6531 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
16922 Handle<DependentCode> codes = | 16958 Handle<DependentCode> codes = |
16923 DependentCode::Insert(handle(cell->dependent_code(), info->isolate()), | 16959 DependentCode::Insert(handle(cell->dependent_code(), info->isolate()), |
16924 DependentCode::kPropertyCellChangedGroup, | 16960 DependentCode::kPropertyCellChangedGroup, |
16925 info->object_wrapper()); | 16961 info->object_wrapper()); |
16926 if (*codes != cell->dependent_code()) cell->set_dependent_code(*codes); | 16962 if (*codes != cell->dependent_code()) cell->set_dependent_code(*codes); |
16927 info->dependencies(DependentCode::kPropertyCellChangedGroup)->Add( | 16963 info->dependencies(DependentCode::kPropertyCellChangedGroup)->Add( |
16928 cell, info->zone()); | 16964 cell, info->zone()); |
16929 } | 16965 } |
16930 | 16966 |
16931 } } // namespace v8::internal | 16967 } } // namespace v8::internal |
OLD | NEW |