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

Side by Side Diff: src/full-codegen.cc

Issue 1146863007: [es6] Super call in arrows and eval (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 6 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/full-codegen.h ('k') | src/hydrogen.cc » ('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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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/v8.h" 5 #include "src/v8.h"
6 6
7 #include "src/ast.h" 7 #include "src/ast.h"
8 #include "src/ast-numbering.h" 8 #include "src/ast-numbering.h"
9 #include "src/code-factory.h" 9 #include "src/code-factory.h"
10 #include "src/codegen.h" 10 #include "src/codegen.h"
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after
269 269
270 void BreakableStatementChecker::VisitSpread(Spread* expr) { 270 void BreakableStatementChecker::VisitSpread(Spread* expr) {
271 Visit(expr->expression()); 271 Visit(expr->expression());
272 } 272 }
273 273
274 274
275 void BreakableStatementChecker::VisitThisFunction(ThisFunction* expr) { 275 void BreakableStatementChecker::VisitThisFunction(ThisFunction* expr) {
276 } 276 }
277 277
278 278
279 void BreakableStatementChecker::VisitSuperReference(SuperReference* expr) {} 279 void BreakableStatementChecker::VisitSuperPropertyReference(
280 SuperPropertyReference* expr) {}
281
282
283 void BreakableStatementChecker::VisitSuperCallReference(
284 SuperCallReference* expr) {}
280 285
281 286
282 #define __ ACCESS_MASM(masm()) 287 #define __ ACCESS_MASM(masm())
283 288
284 bool FullCodeGenerator::MakeCode(CompilationInfo* info) { 289 bool FullCodeGenerator::MakeCode(CompilationInfo* info) {
285 Isolate* isolate = info->isolate(); 290 Isolate* isolate = info->isolate();
286 291
287 TimerEventScope<TimerEventCompileFullCode> timer(info->isolate()); 292 TimerEventScope<TimerEventCompileFullCode> timer(info->isolate());
288 293
289 // Ensure that the feedback vector is large enough. 294 // Ensure that the feedback vector is large enough.
(...skipping 371 matching lines...) Expand 10 before | Expand all | Expand 10 after
661 masm_, stmt->position(), !checker.is_breakable()); 666 masm_, stmt->position(), !checker.is_breakable());
662 // If the position recording did record a new position generate a debug 667 // If the position recording did record a new position generate a debug
663 // break slot to make the statement breakable. 668 // break slot to make the statement breakable.
664 if (position_recorded) { 669 if (position_recorded) {
665 DebugCodegen::GenerateSlot(masm_); 670 DebugCodegen::GenerateSlot(masm_);
666 } 671 }
667 } 672 }
668 } 673 }
669 674
670 675
671 void FullCodeGenerator::VisitSuperReference(SuperReference* super) { 676 void FullCodeGenerator::VisitSuperPropertyReference(
677 SuperPropertyReference* super) {
672 __ CallRuntime(Runtime::kThrowUnsupportedSuperError, 0); 678 __ CallRuntime(Runtime::kThrowUnsupportedSuperError, 0);
673 } 679 }
674 680
681
682 void FullCodeGenerator::VisitSuperCallReference(SuperCallReference* super) {
683 __ CallRuntime(Runtime::kThrowUnsupportedSuperError, 0);
684 }
685
675 686
676 void FullCodeGenerator::SetExpressionPosition(Expression* expr) { 687 void FullCodeGenerator::SetExpressionPosition(Expression* expr) {
677 if (!info_->is_debug()) { 688 if (!info_->is_debug()) {
678 CodeGenerator::RecordPositions(masm_, expr->position()); 689 CodeGenerator::RecordPositions(masm_, expr->position());
679 } else { 690 } else {
680 // Check if the expression will be breakable without adding a debug break 691 // Check if the expression will be breakable without adding a debug break
681 // slot. 692 // slot.
682 BreakableStatementChecker checker(info_->isolate(), zone()); 693 BreakableStatementChecker checker(info_->isolate(), zone());
683 checker.Check(expr); 694 checker.Check(expr);
684 // Record a statement position right here if the expression is not 695 // Record a statement position right here if the expression is not
(...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after
971 982
972 void FullCodeGenerator::EmitPropertyKey(ObjectLiteralProperty* property, 983 void FullCodeGenerator::EmitPropertyKey(ObjectLiteralProperty* property,
973 BailoutId bailout_id) { 984 BailoutId bailout_id) {
974 VisitForStackValue(property->key()); 985 VisitForStackValue(property->key());
975 __ InvokeBuiltin(Builtins::TO_NAME, CALL_FUNCTION); 986 __ InvokeBuiltin(Builtins::TO_NAME, CALL_FUNCTION);
976 PrepareForBailoutForId(bailout_id, NO_REGISTERS); 987 PrepareForBailoutForId(bailout_id, NO_REGISTERS);
977 __ Push(result_register()); 988 __ Push(result_register());
978 } 989 }
979 990
980 991
992 void FullCodeGenerator::EmitLoadSuperConstructor(SuperCallReference* ref) {
993 VisitForStackValue(ref->this_function_var());
994 __ CallRuntime(Runtime::kGetPrototype, 1);
995 }
996
997
981 void FullCodeGenerator::VisitReturnStatement(ReturnStatement* stmt) { 998 void FullCodeGenerator::VisitReturnStatement(ReturnStatement* stmt) {
982 Comment cmnt(masm_, "[ ReturnStatement"); 999 Comment cmnt(masm_, "[ ReturnStatement");
983 SetStatementPosition(stmt); 1000 SetStatementPosition(stmt);
984 Expression* expr = stmt->expression(); 1001 Expression* expr = stmt->expression();
985 VisitForAccumulatorValue(expr); 1002 VisitForAccumulatorValue(expr);
986 EmitUnwindBeforeReturn(); 1003 EmitUnwindBeforeReturn();
987 EmitReturnSequence(); 1004 EmitReturnSequence();
988 } 1005 }
989 1006
990 1007
(...skipping 651 matching lines...) Expand 10 before | Expand all | Expand 10 after
1642 } 1659 }
1643 codegen_->PrepareForBailoutForId(exit_id_, NO_REGISTERS); 1660 codegen_->PrepareForBailoutForId(exit_id_, NO_REGISTERS);
1644 codegen_->scope_ = saved_scope_; 1661 codegen_->scope_ = saved_scope_;
1645 } 1662 }
1646 1663
1647 1664
1648 #undef __ 1665 #undef __
1649 1666
1650 1667
1651 } } // namespace v8::internal 1668 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/full-codegen.h ('k') | src/hydrogen.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698