void FullCodeGenerator::EmitSuperConstructorCall(Call* expr) {
- if (!ValidateSuperCall(expr)) return;
Variable* new_target_var = scope()->DeclarationScope()->new_target_var();
GetVar(result_register(), new_target_var);
__ Push(result_register());
void FullCodeGenerator::EmitSuperConstructorCall(Call* expr) {
- if (!ValidateSuperCall(expr)) return;
-
Variable* new_target_var = scope()->DeclarationScope()->new_target_var();
GetVar(result_register(), new_target_var);
__ Push(result_register());
}
-bool FullCodeGenerator::ValidateSuperCall(Call* expr) {
- Variable* new_target_var = scope()->DeclarationScope()->new_target_var();
- if (new_target_var == nullptr) {
- // TODO(dslomov): this is not exactly correct, the spec requires us
- // to execute the constructor and only fail when an assigment to 'this'
- // is attempted. Will implement once we have general new.target support,
- // but also filed spec bug 3843 to make it an early error.
- __ CallRuntime(Runtime::kThrowUnsupportedSuperError, 0);
- RecordJSReturnSite(expr);
- context()->Plug(result_register());
- return false;
- }
- return true;
-}
-
-
void FullCodeGenerator::SetExpressionPosition(Expression* expr) {
if (!info_->is_debug()) {
CodeGenerator::RecordPositions(masm_, expr->position());
void EmitSetHomeObjectIfNeeded(Expression* initializer, int offset);
void EmitLoadSuperConstructor();
- bool ValidateSuperCall(Call* expr);
void CallIC(Handle<Code> code,
TypeFeedbackId id = TypeFeedbackId::None());
void FullCodeGenerator::EmitSuperConstructorCall(Call* expr) {
- if (!ValidateSuperCall(expr)) return;
-
Variable* new_target_var = scope()->DeclarationScope()->new_target_var();
GetVar(eax, new_target_var);
__ push(eax);
void FullCodeGenerator::EmitSuperConstructorCall(Call* expr) {
- if (!ValidateSuperCall(expr)) return;
Variable* new_target_var = scope()->DeclarationScope()->new_target_var();
GetVar(result_register(), new_target_var);
__ Push(result_register());
void FullCodeGenerator::EmitSuperConstructorCall(Call* expr) {
- if (!ValidateSuperCall(expr)) return;
Variable* new_target_var = scope()->DeclarationScope()->new_target_var();
GetVar(result_register(), new_target_var);
__ Push(result_register());
void FullCodeGenerator::EmitSuperConstructorCall(Call* expr) {
- if (!ValidateSuperCall(expr)) return;
Variable* new_target_var = scope()->DeclarationScope()->new_target_var();
GetVar(result_register(), new_target_var);
__ Push(result_register());
void FullCodeGenerator::EmitSuperConstructorCall(Call* expr) {
- if (!ValidateSuperCall(expr)) return;
-
Variable* new_target_var = scope()->DeclarationScope()->new_target_var();
GetVar(result_register(), new_target_var);
__ Push(result_register());
void FullCodeGenerator::EmitSuperConstructorCall(Call* expr) {
- if (!ValidateSuperCall(expr)) return;
-
Variable* new_target_var = scope()->DeclarationScope()->new_target_var();
GetVar(eax, new_target_var);
__ push(eax);