}
-bool FunctionLiteral::uses_super_constructor_call() const {
- DCHECK_NOT_NULL(scope());
- return scope()->uses_super_constructor_call() ||
- scope()->inner_uses_super_constructor_call();
-}
-
-
// Helper to find an existing shared function info in the baseline code for the
// given function literal. Used to canonicalize SharedFunctionInfo objects.
void FunctionLiteral::InitializeSharedInfo(
bool is_anonymous() const { return IsAnonymous::decode(bitfield_); }
LanguageMode language_mode() const;
bool uses_super_property() const;
- bool uses_super_constructor_call() const;
static bool NeedsHomeObject(Expression* literal) {
return literal != NULL && literal->IsFunctionLiteral() &&
BOOL_ACCESSORS(SharedFunctionInfo, compiler_hints, uses_super_property,
kUsesSuperProperty)
-BOOL_ACCESSORS(SharedFunctionInfo, compiler_hints, uses_super_constructor_call,
- kUsesSuperConstructorCall)
BOOL_ACCESSORS(SharedFunctionInfo, compiler_hints, native, kNative)
BOOL_ACCESSORS(SharedFunctionInfo, compiler_hints, inline_builtin,
kInlineBuiltin)
lit->flags()->Contains(AstPropertiesFlag::kDontCache));
shared_info->set_kind(lit->kind());
shared_info->set_uses_super_property(lit->uses_super_property());
- shared_info->set_uses_super_constructor_call(
- lit->uses_super_constructor_call());
shared_info->set_asm_function(lit->scope()->asm_function());
}
// This is needed to set up the [[HomeObject]] on the function instance.
DECL_BOOLEAN_ACCESSORS(uses_super_property)
- // Indicates that this function uses the super constructor.
- DECL_BOOLEAN_ACCESSORS(uses_super_constructor_call)
-
// True if the function has any duplicated parameter names.
DECL_BOOLEAN_ACCESSORS(has_duplicate_parameters)
kStrongModeFunction,
kUsesArguments,
kUsesSuperProperty,
- kUsesSuperConstructorCall,
kHasDuplicateParameters,
kNative,
kInlineBuiltin,
Runtime::FunctionForId(Runtime::kInlineDefaultConstructorCallSuper),
args, pos);
body->Add(factory()->NewReturnStatement(call, pos), zone());
- function_scope->RecordSuperConstructorCallUsage();
}
materialized_literal_count = function_state.materialized_literal_count();
DCHECK(expression->IsFunctionLiteral());
result = expression->AsFunctionLiteral();
} else if (shared_info->is_default_constructor()) {
- result = DefaultConstructor(shared_info->uses_super_constructor_call(),
+ result = DefaultConstructor(IsSubclassConstructor(shared_info->kind()),
scope, shared_info->start_position(),
shared_info->end_position());
} else {
// new super() is never allowed.
// super() is only allowed in derived constructor
if (!is_new && peek() == Token::LPAREN && IsSubclassConstructor(kind)) {
- scope_->RecordSuperConstructorCallUsage();
return this->SuperReference(scope_, factory());
}
}
scope_calls_eval_ = false;
scope_uses_arguments_ = false;
scope_uses_super_property_ = false;
- scope_uses_super_constructor_call_ = false;
scope_uses_this_ = false;
asm_module_ = false;
asm_function_ = outer_scope != NULL && outer_scope->asm_module_;
inner_scope_uses_arguments_ = false;
inner_scope_uses_this_ = false;
inner_scope_uses_super_property_ = false;
- inner_scope_uses_super_constructor_call_ = false;
force_eager_compilation_ = false;
force_context_allocation_ = (outer_scope != NULL && !is_function_scope())
? outer_scope->has_forced_context_allocation() : false;
// Propagate usage flags to outer scope.
if (uses_arguments()) outer_scope_->RecordArgumentsUsage();
if (uses_super_property()) outer_scope_->RecordSuperPropertyUsage();
- if (uses_super_constructor_call()) {
- outer_scope_->RecordSuperConstructorCallUsage();
- }
if (uses_this()) outer_scope_->RecordThisUsage();
return NULL;
if (scope_uses_arguments_) Indent(n1, "// scope uses 'arguments'\n");
if (scope_uses_super_property_)
Indent(n1, "// scope uses 'super' property\n");
- if (scope_uses_super_constructor_call_)
- Indent(n1, "// scope uses 'super' constructor\n");
if (scope_uses_this_) Indent(n1, "// scope uses 'this'\n");
if (inner_scope_uses_arguments_) {
Indent(n1, "// inner scope uses 'arguments'\n");
}
if (inner_scope_uses_super_property_)
Indent(n1, "// inner scope uses 'super' property\n");
- if (inner_scope_uses_super_constructor_call_) {
- Indent(n1, "// inner scope uses 'super' constructor\n");
- }
if (inner_scope_uses_this_) Indent(n1, "// inner scope uses 'this'\n");
if (outer_scope_calls_sloppy_eval_) {
Indent(n1, "// outer scope calls 'eval' in sloppy context\n");
inner->inner_scope_uses_super_property_) {
inner_scope_uses_super_property_ = true;
}
- if (inner->uses_super_constructor_call() ||
- inner->inner_scope_uses_super_constructor_call_) {
- inner_scope_uses_super_constructor_call_ = true;
- }
if (inner->scope_uses_this_ || inner->inner_scope_uses_this_) {
inner_scope_uses_this_ = true;
}
// Inform the scope that the corresponding code uses "super".
void RecordSuperPropertyUsage() { scope_uses_super_property_ = true; }
- // Inform the scope that the corresponding code invokes "super" constructor.
- void RecordSuperConstructorCallUsage() {
- scope_uses_super_constructor_call_ = true;
- }
-
// Inform the scope that the corresponding code uses "this".
void RecordThisUsage() { scope_uses_this_ = true; }
bool inner_uses_super_property() const {
return inner_scope_uses_super_property_;
}
- // Does this scope calls "super" constructor.
- bool uses_super_constructor_call() const {
- return scope_uses_super_constructor_call_;
- }
- // Does any inner scope calls "super" constructor.
- bool inner_uses_super_constructor_call() const {
- return inner_scope_uses_super_constructor_call_;
- }
// Does this scope access "this".
bool uses_this() const { return scope_uses_this_; }
// Does any inner scope access "this".
bool scope_uses_arguments_;
// This scope uses "super" property ('super.foo').
bool scope_uses_super_property_;
- // This scope uses "super" constructor ('super(..)').
- bool scope_uses_super_constructor_call_;
// This scope uses "this".
bool scope_uses_this_;
// This scope contains an "use asm" annotation.
bool inner_scope_calls_eval_;
bool inner_scope_uses_arguments_;
bool inner_scope_uses_super_property_;
- bool inner_scope_uses_super_constructor_call_;
bool inner_scope_uses_this_;
bool force_eager_compilation_;
bool force_context_allocation_;