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 13590 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
13601 | 13601 |
13602 | 13602 |
13603 MaybeHandle<SharedFunctionInfo> Script::FindSharedFunctionInfo( | 13603 MaybeHandle<SharedFunctionInfo> Script::FindSharedFunctionInfo( |
13604 FunctionLiteral* fun) { | 13604 FunctionLiteral* fun) { |
13605 WeakFixedArray::Iterator iterator(shared_function_infos()); | 13605 WeakFixedArray::Iterator iterator(shared_function_infos()); |
13606 SharedFunctionInfo* shared; | 13606 SharedFunctionInfo* shared; |
13607 while ((shared = iterator.Next<SharedFunctionInfo>())) { | 13607 while ((shared = iterator.Next<SharedFunctionInfo>())) { |
13608 if (fun->function_token_position() == shared->function_token_position() && | 13608 if (fun->function_token_position() == shared->function_token_position() && |
13609 fun->start_position() == shared->start_position() && | 13609 fun->start_position() == shared->start_position() && |
13610 fun->end_position() == shared->end_position()) { | 13610 fun->end_position() == shared->end_position()) { |
| 13611 DCHECK_EQ(fun->function_literal_id(), shared->function_literal_id()); |
13611 return Handle<SharedFunctionInfo>(shared); | 13612 return Handle<SharedFunctionInfo>(shared); |
13612 } | 13613 } |
| 13614 DCHECK_NE(fun->function_literal_id(), shared->function_literal_id()); |
13613 } | 13615 } |
13614 return MaybeHandle<SharedFunctionInfo>(); | 13616 return MaybeHandle<SharedFunctionInfo>(); |
13615 } | 13617 } |
13616 | 13618 |
13617 | 13619 |
13618 Script::Iterator::Iterator(Isolate* isolate) | 13620 Script::Iterator::Iterator(Isolate* isolate) |
13619 : iterator_(isolate->heap()->script_list()) {} | 13621 : iterator_(isolate->heap()->script_list()) {} |
13620 | 13622 |
13621 | 13623 |
13622 Script* Script::Iterator::Next() { return iterator_.Next<Script>(); } | 13624 Script* Script::Iterator::Next() { return iterator_.Next<Script>(); } |
(...skipping 331 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
13954 shared_info->set_kind(lit->kind()); | 13956 shared_info->set_kind(lit->kind()); |
13955 if (!IsConstructable(lit->kind(), lit->language_mode())) { | 13957 if (!IsConstructable(lit->kind(), lit->language_mode())) { |
13956 shared_info->SetConstructStub( | 13958 shared_info->SetConstructStub( |
13957 *shared_info->GetIsolate()->builtins()->ConstructedNonConstructable()); | 13959 *shared_info->GetIsolate()->builtins()->ConstructedNonConstructable()); |
13958 } | 13960 } |
13959 shared_info->set_needs_home_object(lit->scope()->NeedsHomeObject()); | 13961 shared_info->set_needs_home_object(lit->scope()->NeedsHomeObject()); |
13960 shared_info->set_asm_function(lit->scope()->asm_function()); | 13962 shared_info->set_asm_function(lit->scope()->asm_function()); |
13961 shared_info->set_requires_class_field_init(lit->requires_class_field_init()); | 13963 shared_info->set_requires_class_field_init(lit->requires_class_field_init()); |
13962 shared_info->set_is_class_field_initializer( | 13964 shared_info->set_is_class_field_initializer( |
13963 lit->is_class_field_initializer()); | 13965 lit->is_class_field_initializer()); |
| 13966 shared_info->set_function_literal_id(lit->function_literal_id()); |
13964 SetExpectedNofPropertiesFromEstimate(shared_info, lit); | 13967 SetExpectedNofPropertiesFromEstimate(shared_info, lit); |
13965 } | 13968 } |
13966 | 13969 |
13967 | 13970 |
13968 bool SharedFunctionInfo::VerifyBailoutId(BailoutId id) { | 13971 bool SharedFunctionInfo::VerifyBailoutId(BailoutId id) { |
13969 DCHECK(!id.IsNone()); | 13972 DCHECK(!id.IsNone()); |
13970 Code* unoptimized = code(); | 13973 Code* unoptimized = code(); |
13971 DeoptimizationOutputData* data = | 13974 DeoptimizationOutputData* data = |
13972 DeoptimizationOutputData::cast(unoptimized->deoptimization_data()); | 13975 DeoptimizationOutputData::cast(unoptimized->deoptimization_data()); |
13973 unsigned ignore = Deoptimizer::GetOutputInfo(data, id, this); | 13976 unsigned ignore = Deoptimizer::GetOutputInfo(data, id, this); |
(...skipping 6445 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
20419 // depend on this. | 20422 // depend on this. |
20420 return DICTIONARY_ELEMENTS; | 20423 return DICTIONARY_ELEMENTS; |
20421 } | 20424 } |
20422 DCHECK_LE(kind, LAST_ELEMENTS_KIND); | 20425 DCHECK_LE(kind, LAST_ELEMENTS_KIND); |
20423 return kind; | 20426 return kind; |
20424 } | 20427 } |
20425 } | 20428 } |
20426 | 20429 |
20427 } // namespace internal | 20430 } // namespace internal |
20428 } // namespace v8 | 20431 } // namespace v8 |
OLD | NEW |