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

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

Issue 24076007: Unify handling of position info in AST, part 1 (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 3 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 | Annotate | Revision Log
« no previous file with comments | « src/ast.cc ('k') | src/parser.h » ('j') | src/parser.cc » ('J')
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 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 808 matching lines...) Expand 10 before | Expand all | Expand 10 after
819 819
820 820
821 void FullCodeGenerator::SetReturnPosition(FunctionLiteral* fun) { 821 void FullCodeGenerator::SetReturnPosition(FunctionLiteral* fun) {
822 CodeGenerator::RecordPositions(masm_, fun->end_position() - 1); 822 CodeGenerator::RecordPositions(masm_, fun->end_position() - 1);
823 } 823 }
824 824
825 825
826 void FullCodeGenerator::SetStatementPosition(Statement* stmt) { 826 void FullCodeGenerator::SetStatementPosition(Statement* stmt) {
827 #ifdef ENABLE_DEBUGGER_SUPPORT 827 #ifdef ENABLE_DEBUGGER_SUPPORT
828 if (!isolate()->debugger()->IsDebuggerActive()) { 828 if (!isolate()->debugger()->IsDebuggerActive()) {
829 CodeGenerator::RecordPositions(masm_, stmt->statement_pos()); 829 CodeGenerator::RecordPositions(masm_, stmt->position());
830 } else { 830 } else {
831 // Check if the statement will be breakable without adding a debug break 831 // Check if the statement will be breakable without adding a debug break
832 // slot. 832 // slot.
833 BreakableStatementChecker checker(isolate()); 833 BreakableStatementChecker checker(isolate());
834 checker.Check(stmt); 834 checker.Check(stmt);
835 // Record the statement position right here if the statement is not 835 // Record the statement position right here if the statement is not
836 // breakable. For breakable statements the actual recording of the 836 // breakable. For breakable statements the actual recording of the
837 // position will be postponed to the breakable code (typically an IC). 837 // position will be postponed to the breakable code (typically an IC).
838 bool position_recorded = CodeGenerator::RecordPositions( 838 bool position_recorded = CodeGenerator::RecordPositions(
839 masm_, stmt->statement_pos(), !checker.is_breakable()); 839 masm_, stmt->position(), !checker.is_breakable());
840 // If the position recording did record a new position generate a debug 840 // If the position recording did record a new position generate a debug
841 // break slot to make the statement breakable. 841 // break slot to make the statement breakable.
842 if (position_recorded) { 842 if (position_recorded) {
843 Debug::GenerateSlot(masm_); 843 Debug::GenerateSlot(masm_);
844 } 844 }
845 } 845 }
846 #else 846 #else
847 CodeGenerator::RecordPositions(masm_, stmt->statement_pos()); 847 CodeGenerator::RecordPositions(masm_, stmt->position());
848 #endif 848 #endif
849 } 849 }
850 850
851 851
852 void FullCodeGenerator::SetExpressionPosition(Expression* expr, int pos) { 852 void FullCodeGenerator::SetExpressionPosition(Expression* expr, int pos) {
853 #ifdef ENABLE_DEBUGGER_SUPPORT 853 #ifdef ENABLE_DEBUGGER_SUPPORT
854 if (!isolate()->debugger()->IsDebuggerActive()) { 854 if (!isolate()->debugger()->IsDebuggerActive()) {
855 CodeGenerator::RecordPositions(masm_, pos); 855 CodeGenerator::RecordPositions(masm_, pos);
856 } else { 856 } else {
857 // Check if the expression will be breakable without adding a debug break 857 // Check if the expression will be breakable without adding a debug break
(...skipping 754 matching lines...) Expand 10 before | Expand all | Expand 10 after
1612 } 1612 }
1613 1613
1614 return false; 1614 return false;
1615 } 1615 }
1616 1616
1617 1617
1618 #undef __ 1618 #undef __
1619 1619
1620 1620
1621 } } // namespace v8::internal 1621 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/ast.cc ('k') | src/parser.h » ('j') | src/parser.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698