OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 525 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
536 bool arguments_allowed() { return flag_ == ARGUMENTS_ALLOWED; } | 536 bool arguments_allowed() { return flag_ == ARGUMENTS_ALLOWED; } |
537 | 537 |
538 private: | 538 private: |
539 ArgumentsAllowedFlag flag_; | 539 ArgumentsAllowedFlag flag_; |
540 }; | 540 }; |
541 | 541 |
542 | 542 |
543 class TestContext: public AstContext { | 543 class TestContext: public AstContext { |
544 public: | 544 public: |
545 TestContext(HGraphBuilder* owner, | 545 TestContext(HGraphBuilder* owner, |
| 546 Expression* condition, |
546 HBasicBlock* if_true, | 547 HBasicBlock* if_true, |
547 HBasicBlock* if_false) | 548 HBasicBlock* if_false) |
548 : AstContext(owner, Expression::kTest), | 549 : AstContext(owner, Expression::kTest), |
| 550 condition_(condition), |
549 if_true_(if_true), | 551 if_true_(if_true), |
550 if_false_(if_false) { | 552 if_false_(if_false) { |
551 } | 553 } |
552 | 554 |
553 virtual void ReturnValue(HValue* value); | 555 virtual void ReturnValue(HValue* value); |
554 virtual void ReturnInstruction(HInstruction* instr, int ast_id); | 556 virtual void ReturnInstruction(HInstruction* instr, int ast_id); |
555 | 557 |
556 static TestContext* cast(AstContext* context) { | 558 static TestContext* cast(AstContext* context) { |
557 ASSERT(context->IsTest()); | 559 ASSERT(context->IsTest()); |
558 return reinterpret_cast<TestContext*>(context); | 560 return reinterpret_cast<TestContext*>(context); |
559 } | 561 } |
560 | 562 |
| 563 Expression* condition() const { return condition_; } |
561 HBasicBlock* if_true() const { return if_true_; } | 564 HBasicBlock* if_true() const { return if_true_; } |
562 HBasicBlock* if_false() const { return if_false_; } | 565 HBasicBlock* if_false() const { return if_false_; } |
563 | 566 |
564 private: | 567 private: |
565 // Build the shared core part of the translation unpacking a value into | 568 // Build the shared core part of the translation unpacking a value into |
566 // control flow. | 569 // control flow. |
567 void BuildBranch(HValue* value); | 570 void BuildBranch(HValue* value); |
568 | 571 |
| 572 Expression* condition_; |
569 HBasicBlock* if_true_; | 573 HBasicBlock* if_true_; |
570 HBasicBlock* if_false_; | 574 HBasicBlock* if_false_; |
571 }; | 575 }; |
572 | 576 |
573 | 577 |
574 class FunctionState BASE_EMBEDDED { | 578 class FunctionState BASE_EMBEDDED { |
575 public: | 579 public: |
576 FunctionState(HGraphBuilder* owner, | 580 FunctionState(HGraphBuilder* owner, |
577 CompilationInfo* info, | 581 CompilationInfo* info, |
578 TypeFeedbackOracle* oracle); | 582 TypeFeedbackOracle* oracle); |
(...skipping 611 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1190 const char* filename_; | 1194 const char* filename_; |
1191 HeapStringAllocator string_allocator_; | 1195 HeapStringAllocator string_allocator_; |
1192 StringStream trace_; | 1196 StringStream trace_; |
1193 int indent_; | 1197 int indent_; |
1194 }; | 1198 }; |
1195 | 1199 |
1196 | 1200 |
1197 } } // namespace v8::internal | 1201 } } // namespace v8::internal |
1198 | 1202 |
1199 #endif // V8_HYDROGEN_H_ | 1203 #endif // V8_HYDROGEN_H_ |
OLD | NEW |