| OLD | NEW |
| 1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 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 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 232 return false; | 232 return false; |
| 233 } | 233 } |
| 234 | 234 |
| 235 | 235 |
| 236 void Expression::CopyAnalysisResultsFrom(Expression* other) { | 236 void Expression::CopyAnalysisResultsFrom(Expression* other) { |
| 237 bitfields_ = other->bitfields_; | 237 bitfields_ = other->bitfields_; |
| 238 type_ = other->type_; | 238 type_ = other->type_; |
| 239 } | 239 } |
| 240 | 240 |
| 241 | 241 |
| 242 bool UnaryOperation::ResultOverwriteAllowed() { |
| 243 switch (op_) { |
| 244 case Token::BIT_NOT: |
| 245 case Token::SUB: |
| 246 return true; |
| 247 default: |
| 248 return false; |
| 249 } |
| 250 } |
| 251 |
| 252 |
| 253 bool BinaryOperation::ResultOverwriteAllowed() { |
| 254 switch (op_) { |
| 255 case Token::COMMA: |
| 256 case Token::OR: |
| 257 case Token::AND: |
| 258 return false; |
| 259 case Token::BIT_OR: |
| 260 case Token::BIT_XOR: |
| 261 case Token::BIT_AND: |
| 262 case Token::SHL: |
| 263 case Token::SAR: |
| 264 case Token::SHR: |
| 265 case Token::ADD: |
| 266 case Token::SUB: |
| 267 case Token::MUL: |
| 268 case Token::DIV: |
| 269 case Token::MOD: |
| 270 return true; |
| 271 default: |
| 272 UNREACHABLE(); |
| 273 } |
| 274 return false; |
| 275 } |
| 276 |
| 277 |
| 242 BinaryOperation::BinaryOperation(Assignment* assignment) { | 278 BinaryOperation::BinaryOperation(Assignment* assignment) { |
| 243 ASSERT(assignment->is_compound()); | 279 ASSERT(assignment->is_compound()); |
| 244 op_ = assignment->binary_op(); | 280 op_ = assignment->binary_op(); |
| 245 left_ = assignment->target(); | 281 left_ = assignment->target(); |
| 246 right_ = assignment->value(); | 282 right_ = assignment->value(); |
| 247 pos_ = assignment->position(); | 283 pos_ = assignment->position(); |
| 248 CopyAnalysisResultsFrom(assignment); | 284 CopyAnalysisResultsFrom(assignment); |
| 249 } | 285 } |
| 250 | 286 |
| 251 | 287 |
| (...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 593 cond_(NULL), | 629 cond_(NULL), |
| 594 may_have_function_literal_(true) { | 630 may_have_function_literal_(true) { |
| 595 } | 631 } |
| 596 | 632 |
| 597 | 633 |
| 598 CaseClause::CaseClause(Expression* label, ZoneList<Statement*>* statements) | 634 CaseClause::CaseClause(Expression* label, ZoneList<Statement*>* statements) |
| 599 : label_(label), statements_(statements) { | 635 : label_(label), statements_(statements) { |
| 600 } | 636 } |
| 601 | 637 |
| 602 } } // namespace v8::internal | 638 } } // namespace v8::internal |
| OLD | NEW |