Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4)

Side by Side Diff: src/objects.cc

Issue 2481163002: Assign unique IDs to FunctionLiterals (Closed)
Patch Set: updates Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 13620 matching lines...) Expand 10 before | Expand all | Expand 10 after
13631 13631
13632 13632
13633 MaybeHandle<SharedFunctionInfo> Script::FindSharedFunctionInfo( 13633 MaybeHandle<SharedFunctionInfo> Script::FindSharedFunctionInfo(
13634 FunctionLiteral* fun) { 13634 FunctionLiteral* fun) {
13635 WeakFixedArray::Iterator iterator(shared_function_infos()); 13635 WeakFixedArray::Iterator iterator(shared_function_infos());
13636 SharedFunctionInfo* shared; 13636 SharedFunctionInfo* shared;
13637 while ((shared = iterator.Next<SharedFunctionInfo>())) { 13637 while ((shared = iterator.Next<SharedFunctionInfo>())) {
13638 if (fun->function_token_position() == shared->function_token_position() && 13638 if (fun->function_token_position() == shared->function_token_position() &&
13639 fun->start_position() == shared->start_position() && 13639 fun->start_position() == shared->start_position() &&
13640 fun->end_position() == shared->end_position()) { 13640 fun->end_position() == shared->end_position()) {
13641 DCHECK_EQ(fun->function_literal_id(), shared->function_literal_id());
13641 return Handle<SharedFunctionInfo>(shared); 13642 return Handle<SharedFunctionInfo>(shared);
13642 } 13643 }
13644 DCHECK_NE(fun->function_literal_id(), shared->function_literal_id());
13643 } 13645 }
13644 return MaybeHandle<SharedFunctionInfo>(); 13646 return MaybeHandle<SharedFunctionInfo>();
13645 } 13647 }
13646 13648
13647 13649
13648 Script::Iterator::Iterator(Isolate* isolate) 13650 Script::Iterator::Iterator(Isolate* isolate)
13649 : iterator_(isolate->heap()->script_list()) {} 13651 : iterator_(isolate->heap()->script_list()) {}
13650 13652
13651 13653
13652 Script* Script::Iterator::Next() { return iterator_.Next<Script>(); } 13654 Script* Script::Iterator::Next() { return iterator_.Next<Script>(); }
(...skipping 331 matching lines...) Expand 10 before | Expand all | Expand 10 after
13984 shared_info->set_kind(lit->kind()); 13986 shared_info->set_kind(lit->kind());
13985 if (!IsConstructable(lit->kind(), lit->language_mode())) { 13987 if (!IsConstructable(lit->kind(), lit->language_mode())) {
13986 shared_info->SetConstructStub( 13988 shared_info->SetConstructStub(
13987 *shared_info->GetIsolate()->builtins()->ConstructedNonConstructable()); 13989 *shared_info->GetIsolate()->builtins()->ConstructedNonConstructable());
13988 } 13990 }
13989 shared_info->set_needs_home_object(lit->scope()->NeedsHomeObject()); 13991 shared_info->set_needs_home_object(lit->scope()->NeedsHomeObject());
13990 shared_info->set_asm_function(lit->scope()->asm_function()); 13992 shared_info->set_asm_function(lit->scope()->asm_function());
13991 shared_info->set_requires_class_field_init(lit->requires_class_field_init()); 13993 shared_info->set_requires_class_field_init(lit->requires_class_field_init());
13992 shared_info->set_is_class_field_initializer( 13994 shared_info->set_is_class_field_initializer(
13993 lit->is_class_field_initializer()); 13995 lit->is_class_field_initializer());
13996 shared_info->set_function_literal_id(lit->function_literal_id());
13994 SetExpectedNofPropertiesFromEstimate(shared_info, lit); 13997 SetExpectedNofPropertiesFromEstimate(shared_info, lit);
13995 } 13998 }
13996 13999
13997 14000
13998 bool SharedFunctionInfo::VerifyBailoutId(BailoutId id) { 14001 bool SharedFunctionInfo::VerifyBailoutId(BailoutId id) {
13999 DCHECK(!id.IsNone()); 14002 DCHECK(!id.IsNone());
14000 Code* unoptimized = code(); 14003 Code* unoptimized = code();
14001 DeoptimizationOutputData* data = 14004 DeoptimizationOutputData* data =
14002 DeoptimizationOutputData::cast(unoptimized->deoptimization_data()); 14005 DeoptimizationOutputData::cast(unoptimized->deoptimization_data());
14003 unsigned ignore = Deoptimizer::GetOutputInfo(data, id, this); 14006 unsigned ignore = Deoptimizer::GetOutputInfo(data, id, this);
(...skipping 6435 matching lines...) Expand 10 before | Expand all | Expand 10 after
20439 // depend on this. 20442 // depend on this.
20440 return DICTIONARY_ELEMENTS; 20443 return DICTIONARY_ELEMENTS;
20441 } 20444 }
20442 DCHECK_LE(kind, LAST_ELEMENTS_KIND); 20445 DCHECK_LE(kind, LAST_ELEMENTS_KIND);
20443 return kind; 20446 return kind;
20444 } 20447 }
20445 } 20448 }
20446 20449
20447 } // namespace internal 20450 } // namespace internal
20448 } // namespace v8 20451 } // namespace v8
OLDNEW
« no previous file with comments | « src/objects.h ('k') | src/objects-inl.h » ('j') | src/parsing/parser-base.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698