OLD | NEW |
1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 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/objects.h" | 5 #include "src/objects.h" |
6 | 6 |
7 #include <cmath> | 7 #include <cmath> |
8 #include <iomanip> | 8 #include <iomanip> |
9 #include <memory> | 9 #include <memory> |
10 #include <sstream> | 10 #include <sstream> |
(...skipping 13593 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
13604 | 13604 |
13605 | 13605 |
13606 MaybeHandle<SharedFunctionInfo> Script::FindSharedFunctionInfo( | 13606 MaybeHandle<SharedFunctionInfo> Script::FindSharedFunctionInfo( |
13607 FunctionLiteral* fun) { | 13607 FunctionLiteral* fun) { |
13608 WeakFixedArray::Iterator iterator(shared_function_infos()); | 13608 WeakFixedArray::Iterator iterator(shared_function_infos()); |
13609 SharedFunctionInfo* shared; | 13609 SharedFunctionInfo* shared; |
13610 while ((shared = iterator.Next<SharedFunctionInfo>())) { | 13610 while ((shared = iterator.Next<SharedFunctionInfo>())) { |
13611 if (fun->function_token_position() == shared->function_token_position() && | 13611 if (fun->function_token_position() == shared->function_token_position() && |
13612 fun->start_position() == shared->start_position() && | 13612 fun->start_position() == shared->start_position() && |
13613 fun->end_position() == shared->end_position()) { | 13613 fun->end_position() == shared->end_position()) { |
| 13614 DCHECK_EQ(fun->function_literal_num(), shared->function_literal_num()); |
13614 return Handle<SharedFunctionInfo>(shared); | 13615 return Handle<SharedFunctionInfo>(shared); |
13615 } | 13616 } |
| 13617 DCHECK_NE(fun->function_literal_num(), shared->function_literal_num()); |
13616 } | 13618 } |
13617 return MaybeHandle<SharedFunctionInfo>(); | 13619 return MaybeHandle<SharedFunctionInfo>(); |
13618 } | 13620 } |
13619 | 13621 |
13620 | 13622 |
13621 Script::Iterator::Iterator(Isolate* isolate) | 13623 Script::Iterator::Iterator(Isolate* isolate) |
13622 : iterator_(isolate->heap()->script_list()) {} | 13624 : iterator_(isolate->heap()->script_list()) {} |
13623 | 13625 |
13624 | 13626 |
13625 Script* Script::Iterator::Next() { return iterator_.Next<Script>(); } | 13627 Script* Script::Iterator::Next() { return iterator_.Next<Script>(); } |
(...skipping 331 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
13957 shared_info->set_kind(lit->kind()); | 13959 shared_info->set_kind(lit->kind()); |
13958 if (!IsConstructable(lit->kind(), lit->language_mode())) { | 13960 if (!IsConstructable(lit->kind(), lit->language_mode())) { |
13959 shared_info->SetConstructStub( | 13961 shared_info->SetConstructStub( |
13960 *shared_info->GetIsolate()->builtins()->ConstructedNonConstructable()); | 13962 *shared_info->GetIsolate()->builtins()->ConstructedNonConstructable()); |
13961 } | 13963 } |
13962 shared_info->set_needs_home_object(lit->scope()->NeedsHomeObject()); | 13964 shared_info->set_needs_home_object(lit->scope()->NeedsHomeObject()); |
13963 shared_info->set_asm_function(lit->scope()->asm_function()); | 13965 shared_info->set_asm_function(lit->scope()->asm_function()); |
13964 shared_info->set_requires_class_field_init(lit->requires_class_field_init()); | 13966 shared_info->set_requires_class_field_init(lit->requires_class_field_init()); |
13965 shared_info->set_is_class_field_initializer( | 13967 shared_info->set_is_class_field_initializer( |
13966 lit->is_class_field_initializer()); | 13968 lit->is_class_field_initializer()); |
| 13969 shared_info->set_function_literal_num(lit->function_literal_num()); |
13967 SetExpectedNofPropertiesFromEstimate(shared_info, lit); | 13970 SetExpectedNofPropertiesFromEstimate(shared_info, lit); |
13968 } | 13971 } |
13969 | 13972 |
13970 | 13973 |
13971 bool SharedFunctionInfo::VerifyBailoutId(BailoutId id) { | 13974 bool SharedFunctionInfo::VerifyBailoutId(BailoutId id) { |
13972 DCHECK(!id.IsNone()); | 13975 DCHECK(!id.IsNone()); |
13973 Code* unoptimized = code(); | 13976 Code* unoptimized = code(); |
13974 DeoptimizationOutputData* data = | 13977 DeoptimizationOutputData* data = |
13975 DeoptimizationOutputData::cast(unoptimized->deoptimization_data()); | 13978 DeoptimizationOutputData::cast(unoptimized->deoptimization_data()); |
13976 unsigned ignore = Deoptimizer::GetOutputInfo(data, id, this); | 13979 unsigned ignore = Deoptimizer::GetOutputInfo(data, id, this); |
(...skipping 6445 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
20422 // depend on this. | 20425 // depend on this. |
20423 return DICTIONARY_ELEMENTS; | 20426 return DICTIONARY_ELEMENTS; |
20424 } | 20427 } |
20425 DCHECK_LE(kind, LAST_ELEMENTS_KIND); | 20428 DCHECK_LE(kind, LAST_ELEMENTS_KIND); |
20426 return kind; | 20429 return kind; |
20427 } | 20430 } |
20428 } | 20431 } |
20429 | 20432 |
20430 } // namespace internal | 20433 } // namespace internal |
20431 } // namespace v8 | 20434 } // namespace v8 |
OLD | NEW |