OLD | NEW |
1 // Copyright 2009 the V8 project authors. All rights reserved. | 1 // Copyright 2009 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 451 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
462 if (old_entry != NULL) { | 462 if (old_entry != NULL) { |
463 old_entry->name = entry->name; | 463 old_entry->name = entry->name; |
464 old_entry->method = entry->method; | 464 old_entry->method = entry->method; |
465 } | 465 } |
466 entry->name = new_entry.name; | 466 entry->name = new_entry.name; |
467 entry->method = new_entry.method; | 467 entry->method = new_entry.method; |
468 return true; | 468 return true; |
469 } | 469 } |
470 | 470 |
471 | 471 |
| 472 // Simple condition analysis. ALWAYS_TRUE and ALWAYS_FALSE represent a |
| 473 // known result for the test expression, with no side effects. |
| 474 CodeGenerator::ConditionAnalysis CodeGenerator::AnalyzeCondition( |
| 475 Expression* cond) { |
| 476 if (cond == NULL) return ALWAYS_TRUE; |
| 477 |
| 478 Literal* lit = cond->AsLiteral(); |
| 479 if (lit == NULL) return DONT_KNOW; |
| 480 |
| 481 if (lit->IsTrue()) { |
| 482 return ALWAYS_TRUE; |
| 483 } else if (lit->IsFalse()) { |
| 484 return ALWAYS_FALSE; |
| 485 } |
| 486 |
| 487 return DONT_KNOW; |
| 488 } |
| 489 |
| 490 |
472 static inline void RecordPositions(CodeGenerator* cgen, int pos) { | 491 static inline void RecordPositions(CodeGenerator* cgen, int pos) { |
473 if (pos != RelocInfo::kNoPosition) { | 492 if (pos != RelocInfo::kNoPosition) { |
474 cgen->masm()->RecordStatementPosition(pos); | 493 cgen->masm()->RecordStatementPosition(pos); |
475 cgen->masm()->RecordPosition(pos); | 494 cgen->masm()->RecordPosition(pos); |
476 } | 495 } |
477 } | 496 } |
478 | 497 |
479 | 498 |
480 void CodeGenerator::CodeForFunctionPosition(FunctionLiteral* fun) { | 499 void CodeGenerator::CodeForFunctionPosition(FunctionLiteral* fun) { |
481 if (FLAG_debug_info) RecordPositions(this, fun->start_position()); | 500 if (FLAG_debug_info) RecordPositions(this, fun->start_position()); |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
515 void ArgumentsAccessStub::Generate(MacroAssembler* masm) { | 534 void ArgumentsAccessStub::Generate(MacroAssembler* masm) { |
516 switch (type_) { | 535 switch (type_) { |
517 case READ_LENGTH: GenerateReadLength(masm); break; | 536 case READ_LENGTH: GenerateReadLength(masm); break; |
518 case READ_ELEMENT: GenerateReadElement(masm); break; | 537 case READ_ELEMENT: GenerateReadElement(masm); break; |
519 case NEW_OBJECT: GenerateNewObject(masm); break; | 538 case NEW_OBJECT: GenerateNewObject(masm); break; |
520 } | 539 } |
521 } | 540 } |
522 | 541 |
523 | 542 |
524 } } // namespace v8::internal | 543 } } // namespace v8::internal |
OLD | NEW |