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

Side by Side Diff: src/ast.cc

Issue 269049: Split the AST LoopStatement type into separate types for do/while,... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 11 years, 2 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.h ('k') | src/codegen.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 2006-2008 the V8 project authors. All rights reserved. 1 // Copyright 2006-2008 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 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 // because we don't know the exact semantics of conflicting (const and 84 // because we don't know the exact semantics of conflicting (const and
85 // non-const) multiple variable declarations, const vars introduced via 85 // non-const) multiple variable declarations, const vars introduced via
86 // eval() etc. Const-ness and variable declarations are a complete mess 86 // eval() etc. Const-ness and variable declarations are a complete mess
87 // in JS. Sigh... 87 // in JS. Sigh...
88 var_ = var; 88 var_ = var;
89 var->var_uses()->RecordUses(&var_uses_); 89 var->var_uses()->RecordUses(&var_uses_);
90 var->obj_uses()->RecordUses(&obj_uses_); 90 var->obj_uses()->RecordUses(&obj_uses_);
91 } 91 }
92 92
93 93
94 #ifdef DEBUG
95
96 const char* LoopStatement::OperatorString() const {
97 switch (type()) {
98 case DO_LOOP: return "DO";
99 case FOR_LOOP: return "FOR";
100 case WHILE_LOOP: return "WHILE";
101 }
102 return NULL;
103 }
104
105 #endif // DEBUG
106
107
108 Token::Value Assignment::binary_op() const { 94 Token::Value Assignment::binary_op() const {
109 switch (op_) { 95 switch (op_) {
110 case Token::ASSIGN_BIT_OR: return Token::BIT_OR; 96 case Token::ASSIGN_BIT_OR: return Token::BIT_OR;
111 case Token::ASSIGN_BIT_XOR: return Token::BIT_XOR; 97 case Token::ASSIGN_BIT_XOR: return Token::BIT_XOR;
112 case Token::ASSIGN_BIT_AND: return Token::BIT_AND; 98 case Token::ASSIGN_BIT_AND: return Token::BIT_AND;
113 case Token::ASSIGN_SHL: return Token::SHL; 99 case Token::ASSIGN_SHL: return Token::SHL;
114 case Token::ASSIGN_SAR: return Token::SAR; 100 case Token::ASSIGN_SAR: return Token::SAR;
115 case Token::ASSIGN_SHR: return Token::SHR; 101 case Token::ASSIGN_SHR: return Token::SHR;
116 case Token::ASSIGN_ADD: return Token::ADD; 102 case Token::ASSIGN_ADD: return Token::ADD;
117 case Token::ASSIGN_SUB: return Token::SUB; 103 case Token::ASSIGN_SUB: return Token::SUB;
(...skipping 384 matching lines...) Expand 10 before | Expand all | Expand 10 after
502 if (kInfinity - max_match_ < node_max_match) { 488 if (kInfinity - max_match_ < node_max_match) {
503 max_match_ = kInfinity; 489 max_match_ = kInfinity;
504 } else { 490 } else {
505 max_match_ += node->max_match(); 491 max_match_ += node->max_match();
506 } 492 }
507 } 493 }
508 } 494 }
509 495
510 496
511 } } // namespace v8::internal 497 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/ast.h ('k') | src/codegen.h » ('j') | src/parser.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698