| 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 "v8.h" | 5 #include "v8.h" |
| 6 | 6 |
| 7 #include "codegen.h" | 7 #include "codegen.h" |
| 8 #include "compiler.h" | 8 #include "compiler.h" |
| 9 #include "debug.h" | 9 #include "debug.h" |
| 10 #include "full-codegen.h" | 10 #include "full-codegen.h" |
| (...skipping 805 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 816 BreakableStatementChecker checker(zone()); | 816 BreakableStatementChecker checker(zone()); |
| 817 checker.Check(stmt); | 817 checker.Check(stmt); |
| 818 // Record the statement position right here if the statement is not | 818 // Record the statement position right here if the statement is not |
| 819 // breakable. For breakable statements the actual recording of the | 819 // breakable. For breakable statements the actual recording of the |
| 820 // position will be postponed to the breakable code (typically an IC). | 820 // position will be postponed to the breakable code (typically an IC). |
| 821 bool position_recorded = CodeGenerator::RecordPositions( | 821 bool position_recorded = CodeGenerator::RecordPositions( |
| 822 masm_, stmt->position(), !checker.is_breakable()); | 822 masm_, stmt->position(), !checker.is_breakable()); |
| 823 // If the position recording did record a new position generate a debug | 823 // If the position recording did record a new position generate a debug |
| 824 // break slot to make the statement breakable. | 824 // break slot to make the statement breakable. |
| 825 if (position_recorded) { | 825 if (position_recorded) { |
| 826 Debug::GenerateSlot(masm_); | 826 DebugCodegen::GenerateSlot(masm_); |
| 827 } | 827 } |
| 828 } | 828 } |
| 829 } | 829 } |
| 830 | 830 |
| 831 | 831 |
| 832 void FullCodeGenerator::SetExpressionPosition(Expression* expr) { | 832 void FullCodeGenerator::SetExpressionPosition(Expression* expr) { |
| 833 if (!info_->is_debug()) { | 833 if (!info_->is_debug()) { |
| 834 CodeGenerator::RecordPositions(masm_, expr->position()); | 834 CodeGenerator::RecordPositions(masm_, expr->position()); |
| 835 } else { | 835 } else { |
| 836 // Check if the expression will be breakable without adding a debug break | 836 // Check if the expression will be breakable without adding a debug break |
| 837 // slot. | 837 // slot. |
| 838 BreakableStatementChecker checker(zone()); | 838 BreakableStatementChecker checker(zone()); |
| 839 checker.Check(expr); | 839 checker.Check(expr); |
| 840 // Record a statement position right here if the expression is not | 840 // Record a statement position right here if the expression is not |
| 841 // breakable. For breakable expressions the actual recording of the | 841 // breakable. For breakable expressions the actual recording of the |
| 842 // position will be postponed to the breakable code (typically an IC). | 842 // position will be postponed to the breakable code (typically an IC). |
| 843 // NOTE this will record a statement position for something which might | 843 // NOTE this will record a statement position for something which might |
| 844 // not be a statement. As stepping in the debugger will only stop at | 844 // not be a statement. As stepping in the debugger will only stop at |
| 845 // statement positions this is used for e.g. the condition expression of | 845 // statement positions this is used for e.g. the condition expression of |
| 846 // a do while loop. | 846 // a do while loop. |
| 847 bool position_recorded = CodeGenerator::RecordPositions( | 847 bool position_recorded = CodeGenerator::RecordPositions( |
| 848 masm_, expr->position(), !checker.is_breakable()); | 848 masm_, expr->position(), !checker.is_breakable()); |
| 849 // If the position recording did record a new position generate a debug | 849 // If the position recording did record a new position generate a debug |
| 850 // break slot to make the statement breakable. | 850 // break slot to make the statement breakable. |
| 851 if (position_recorded) { | 851 if (position_recorded) { |
| 852 Debug::GenerateSlot(masm_); | 852 DebugCodegen::GenerateSlot(masm_); |
| 853 } | 853 } |
| 854 } | 854 } |
| 855 } | 855 } |
| 856 | 856 |
| 857 | 857 |
| 858 void FullCodeGenerator::SetStatementPosition(int pos) { | 858 void FullCodeGenerator::SetStatementPosition(int pos) { |
| 859 CodeGenerator::RecordPositions(masm_, pos); | 859 CodeGenerator::RecordPositions(masm_, pos); |
| 860 } | 860 } |
| 861 | 861 |
| 862 | 862 |
| (...skipping 834 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1697 } | 1697 } |
| 1698 return true; | 1698 return true; |
| 1699 } | 1699 } |
| 1700 #endif // DEBUG | 1700 #endif // DEBUG |
| 1701 | 1701 |
| 1702 | 1702 |
| 1703 #undef __ | 1703 #undef __ |
| 1704 | 1704 |
| 1705 | 1705 |
| 1706 } } // namespace v8::internal | 1706 } } // namespace v8::internal |
| OLD | NEW |