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

Side by Side Diff: src/objects.cc

Issue 2315733003: Class fields, part 1 (parsing and infrastructure) (Closed)
Patch Set: whitespace Created 4 years, 3 months 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
« no previous file with comments | « src/objects.h ('k') | src/objects-inl.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 13565 matching lines...) Expand 10 before | Expand all | Expand 10 after
13576 13576
13577 shared->set_expected_nof_properties(estimate); 13577 shared->set_expected_nof_properties(estimate);
13578 } 13578 }
13579 13579
13580 } // namespace 13580 } // namespace
13581 13581
13582 void SharedFunctionInfo::InitFromFunctionLiteral( 13582 void SharedFunctionInfo::InitFromFunctionLiteral(
13583 Handle<SharedFunctionInfo> shared_info, FunctionLiteral* lit) { 13583 Handle<SharedFunctionInfo> shared_info, FunctionLiteral* lit) {
13584 // When adding fields here, make sure DeclarationScope::AnalyzePartially is 13584 // When adding fields here, make sure DeclarationScope::AnalyzePartially is
13585 // updated accordingly. 13585 // updated accordingly.
13586 shared_info->set_length(lit->scope()->default_function_length()); 13586 shared_info->set_length(lit->scope()->arity());
13587 shared_info->set_internal_formal_parameter_count(lit->parameter_count()); 13587 shared_info->set_internal_formal_parameter_count(lit->parameter_count());
13588 shared_info->set_function_token_position(lit->function_token_position()); 13588 shared_info->set_function_token_position(lit->function_token_position());
13589 shared_info->set_start_position(lit->start_position()); 13589 shared_info->set_start_position(lit->start_position());
13590 shared_info->set_end_position(lit->end_position()); 13590 shared_info->set_end_position(lit->end_position());
13591 shared_info->set_is_declaration(lit->is_declaration()); 13591 shared_info->set_is_declaration(lit->is_declaration());
13592 shared_info->set_is_named_expression(lit->is_named_expression()); 13592 shared_info->set_is_named_expression(lit->is_named_expression());
13593 shared_info->set_is_anonymous_expression(lit->is_anonymous_expression()); 13593 shared_info->set_is_anonymous_expression(lit->is_anonymous_expression());
13594 shared_info->set_inferred_name(*lit->inferred_name()); 13594 shared_info->set_inferred_name(*lit->inferred_name());
13595 shared_info->set_allows_lazy_compilation(lit->AllowsLazyCompilation()); 13595 shared_info->set_allows_lazy_compilation(lit->AllowsLazyCompilation());
13596 shared_info->set_allows_lazy_compilation_without_context( 13596 shared_info->set_allows_lazy_compilation_without_context(
13597 lit->AllowsLazyCompilationWithoutContext()); 13597 lit->AllowsLazyCompilationWithoutContext());
13598 shared_info->set_language_mode(lit->language_mode()); 13598 shared_info->set_language_mode(lit->language_mode());
13599 shared_info->set_uses_arguments(lit->scope()->arguments() != NULL); 13599 shared_info->set_uses_arguments(lit->scope()->arguments() != NULL);
13600 shared_info->set_has_duplicate_parameters(lit->has_duplicate_parameters()); 13600 shared_info->set_has_duplicate_parameters(lit->has_duplicate_parameters());
13601 shared_info->set_is_function(lit->is_function()); 13601 shared_info->set_is_function(lit->is_function());
13602 shared_info->set_never_compiled(true); 13602 shared_info->set_never_compiled(true);
13603 shared_info->set_kind(lit->kind()); 13603 shared_info->set_kind(lit->kind());
13604 if (!IsConstructable(lit->kind(), lit->language_mode())) { 13604 if (!IsConstructable(lit->kind(), lit->language_mode())) {
13605 shared_info->SetConstructStub( 13605 shared_info->SetConstructStub(
13606 *shared_info->GetIsolate()->builtins()->ConstructedNonConstructable()); 13606 *shared_info->GetIsolate()->builtins()->ConstructedNonConstructable());
13607 } 13607 }
13608 shared_info->set_needs_home_object(lit->scope()->NeedsHomeObject()); 13608 shared_info->set_needs_home_object(lit->scope()->NeedsHomeObject());
13609 shared_info->set_asm_function(lit->scope()->asm_function()); 13609 shared_info->set_asm_function(lit->scope()->asm_function());
13610 shared_info->set_requires_class_field_init(lit->requires_class_field_init());
13611 shared_info->set_is_class_field_initializer(
13612 lit->is_class_field_initializer());
13610 SetExpectedNofPropertiesFromEstimate(shared_info, lit); 13613 SetExpectedNofPropertiesFromEstimate(shared_info, lit);
13611 } 13614 }
13612 13615
13613 13616
13614 bool SharedFunctionInfo::VerifyBailoutId(BailoutId id) { 13617 bool SharedFunctionInfo::VerifyBailoutId(BailoutId id) {
13615 DCHECK(!id.IsNone()); 13618 DCHECK(!id.IsNone());
13616 Code* unoptimized = code(); 13619 Code* unoptimized = code();
13617 DeoptimizationOutputData* data = 13620 DeoptimizationOutputData* data =
13618 DeoptimizationOutputData::cast(unoptimized->deoptimization_data()); 13621 DeoptimizationOutputData::cast(unoptimized->deoptimization_data());
13619 unsigned ignore = Deoptimizer::GetOutputInfo(data, id, this); 13622 unsigned ignore = Deoptimizer::GetOutputInfo(data, id, this);
(...skipping 5797 matching lines...) Expand 10 before | Expand all | Expand 10 after
19417 for (PrototypeIterator iter(isolate, this, kStartAtReceiver, 19420 for (PrototypeIterator iter(isolate, this, kStartAtReceiver,
19418 PrototypeIterator::END_AT_NULL); 19421 PrototypeIterator::END_AT_NULL);
19419 !iter.IsAtEnd(); iter.AdvanceIgnoringProxies()) { 19422 !iter.IsAtEnd(); iter.AdvanceIgnoringProxies()) {
19420 if (iter.GetCurrent<Object>()->IsJSProxy()) return true; 19423 if (iter.GetCurrent<Object>()->IsJSProxy()) return true;
19421 } 19424 }
19422 return false; 19425 return false;
19423 } 19426 }
19424 19427
19425 } // namespace internal 19428 } // namespace internal
19426 } // namespace v8 19429 } // namespace v8
OLDNEW
« no previous file with comments | « src/objects.h ('k') | src/objects-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698