OLD | NEW |
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 Loading... |
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::VisitSuperPropertyReference( | 279 void BreakableStatementChecker::VisitSuperReference(SuperReference* expr) {} |
280 SuperPropertyReference* expr) {} | |
281 | |
282 | |
283 void BreakableStatementChecker::VisitSuperCallReference( | |
284 SuperCallReference* expr) {} | |
285 | 280 |
286 | 281 |
287 #define __ ACCESS_MASM(masm()) | 282 #define __ ACCESS_MASM(masm()) |
288 | 283 |
289 bool FullCodeGenerator::MakeCode(CompilationInfo* info) { | 284 bool FullCodeGenerator::MakeCode(CompilationInfo* info) { |
290 Isolate* isolate = info->isolate(); | 285 Isolate* isolate = info->isolate(); |
291 | 286 |
292 TimerEventScope<TimerEventCompileFullCode> timer(info->isolate()); | 287 TimerEventScope<TimerEventCompileFullCode> timer(info->isolate()); |
293 | 288 |
294 // Ensure that the feedback vector is large enough. | 289 // Ensure that the feedback vector is large enough. |
(...skipping 371 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
666 masm_, stmt->position(), !checker.is_breakable()); | 661 masm_, stmt->position(), !checker.is_breakable()); |
667 // If the position recording did record a new position generate a debug | 662 // If the position recording did record a new position generate a debug |
668 // break slot to make the statement breakable. | 663 // break slot to make the statement breakable. |
669 if (position_recorded) { | 664 if (position_recorded) { |
670 DebugCodegen::GenerateSlot(masm_); | 665 DebugCodegen::GenerateSlot(masm_); |
671 } | 666 } |
672 } | 667 } |
673 } | 668 } |
674 | 669 |
675 | 670 |
676 void FullCodeGenerator::VisitSuperPropertyReference( | 671 void FullCodeGenerator::VisitSuperReference(SuperReference* super) { |
677 SuperPropertyReference* super) { | |
678 __ CallRuntime(Runtime::kThrowUnsupportedSuperError, 0); | 672 __ CallRuntime(Runtime::kThrowUnsupportedSuperError, 0); |
679 } | 673 } |
680 | 674 |
681 | |
682 void FullCodeGenerator::VisitSuperCallReference(SuperCallReference* super) { | |
683 __ CallRuntime(Runtime::kThrowUnsupportedSuperError, 0); | |
684 } | |
685 | |
686 | 675 |
687 void FullCodeGenerator::SetExpressionPosition(Expression* expr) { | 676 void FullCodeGenerator::SetExpressionPosition(Expression* expr) { |
688 if (!info_->is_debug()) { | 677 if (!info_->is_debug()) { |
689 CodeGenerator::RecordPositions(masm_, expr->position()); | 678 CodeGenerator::RecordPositions(masm_, expr->position()); |
690 } else { | 679 } else { |
691 // Check if the expression will be breakable without adding a debug break | 680 // Check if the expression will be breakable without adding a debug break |
692 // slot. | 681 // slot. |
693 BreakableStatementChecker checker(info_->isolate(), zone()); | 682 BreakableStatementChecker checker(info_->isolate(), zone()); |
694 checker.Check(expr); | 683 checker.Check(expr); |
695 // Record a statement position right here if the expression is not | 684 // Record a statement position right here if the expression is not |
(...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
982 | 971 |
983 void FullCodeGenerator::EmitPropertyKey(ObjectLiteralProperty* property, | 972 void FullCodeGenerator::EmitPropertyKey(ObjectLiteralProperty* property, |
984 BailoutId bailout_id) { | 973 BailoutId bailout_id) { |
985 VisitForStackValue(property->key()); | 974 VisitForStackValue(property->key()); |
986 __ InvokeBuiltin(Builtins::TO_NAME, CALL_FUNCTION); | 975 __ InvokeBuiltin(Builtins::TO_NAME, CALL_FUNCTION); |
987 PrepareForBailoutForId(bailout_id, NO_REGISTERS); | 976 PrepareForBailoutForId(bailout_id, NO_REGISTERS); |
988 __ Push(result_register()); | 977 __ Push(result_register()); |
989 } | 978 } |
990 | 979 |
991 | 980 |
992 void FullCodeGenerator::EmitLoadSuperConstructor(SuperCallReference* ref) { | |
993 VisitForStackValue(ref->this_function_var()); | |
994 __ CallRuntime(Runtime::kGetPrototype, 1); | |
995 } | |
996 | |
997 | |
998 void FullCodeGenerator::VisitReturnStatement(ReturnStatement* stmt) { | 981 void FullCodeGenerator::VisitReturnStatement(ReturnStatement* stmt) { |
999 Comment cmnt(masm_, "[ ReturnStatement"); | 982 Comment cmnt(masm_, "[ ReturnStatement"); |
1000 SetStatementPosition(stmt); | 983 SetStatementPosition(stmt); |
1001 Expression* expr = stmt->expression(); | 984 Expression* expr = stmt->expression(); |
1002 VisitForAccumulatorValue(expr); | 985 VisitForAccumulatorValue(expr); |
1003 EmitUnwindBeforeReturn(); | 986 EmitUnwindBeforeReturn(); |
1004 EmitReturnSequence(); | 987 EmitReturnSequence(); |
1005 } | 988 } |
1006 | 989 |
1007 | 990 |
(...skipping 651 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1659 } | 1642 } |
1660 codegen_->PrepareForBailoutForId(exit_id_, NO_REGISTERS); | 1643 codegen_->PrepareForBailoutForId(exit_id_, NO_REGISTERS); |
1661 codegen_->scope_ = saved_scope_; | 1644 codegen_->scope_ = saved_scope_; |
1662 } | 1645 } |
1663 | 1646 |
1664 | 1647 |
1665 #undef __ | 1648 #undef __ |
1666 | 1649 |
1667 | 1650 |
1668 } } // namespace v8::internal | 1651 } } // namespace v8::internal |
OLD | NEW |