OLD | NEW |
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 616 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
627 HConstant* HGraph::GetConstantFalse() { | 627 HConstant* HGraph::GetConstantFalse() { |
628 return GetConstant(&constant_false_, isolate()->factory()->false_value()); | 628 return GetConstant(&constant_false_, isolate()->factory()->false_value()); |
629 } | 629 } |
630 | 630 |
631 | 631 |
632 HConstant* HGraph::GetConstantHole() { | 632 HConstant* HGraph::GetConstantHole() { |
633 return GetConstant(&constant_hole_, isolate()->factory()->the_hole_value()); | 633 return GetConstant(&constant_hole_, isolate()->factory()->the_hole_value()); |
634 } | 634 } |
635 | 635 |
636 | 636 |
| 637 HConstant* HGraph::GetInvalidContext() { |
| 638 return GetConstantInt32(&constant_invalid_context_, 0xFFFFC0C7); |
| 639 } |
| 640 |
| 641 |
637 HGraphBuilder::IfBuilder::IfBuilder(HGraphBuilder* builder, BailoutId id) | 642 HGraphBuilder::IfBuilder::IfBuilder(HGraphBuilder* builder, BailoutId id) |
638 : builder_(builder), | 643 : builder_(builder), |
639 finished_(false), | 644 finished_(false), |
640 id_(id) { | 645 id_(id) { |
641 HEnvironment* env = builder->environment(); | 646 HEnvironment* env = builder->environment(); |
642 HEnvironment* true_env = env->Copy(); | 647 HEnvironment* true_env = env->Copy(); |
643 HEnvironment* false_env = env->Copy(); | 648 HEnvironment* false_env = env->Copy(); |
644 HEnvironment* merge_env = env->Copy(); | 649 HEnvironment* merge_env = env->Copy(); |
645 true_block_ = builder->CreateBasicBlock(true_env); | 650 true_block_ = builder->CreateBasicBlock(true_env); |
646 false_block_ = builder->CreateBasicBlock(false_env); | 651 false_block_ = builder->CreateBasicBlock(false_env); |
(...skipping 3251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3898 | 3903 |
3899 // This method is recursive, so if its stack frame is large it could | 3904 // This method is recursive, so if its stack frame is large it could |
3900 // cause a stack overflow. | 3905 // cause a stack overflow. |
3901 // To keep the individual stack frames small we do the actual work inside | 3906 // To keep the individual stack frames small we do the actual work inside |
3902 // SetupInformativeDefinitionsInBlock(); | 3907 // SetupInformativeDefinitionsInBlock(); |
3903 void HGraph::SetupInformativeDefinitionsRecursively(HBasicBlock* block) { | 3908 void HGraph::SetupInformativeDefinitionsRecursively(HBasicBlock* block) { |
3904 SetupInformativeDefinitionsInBlock(block); | 3909 SetupInformativeDefinitionsInBlock(block); |
3905 for (int i = 0; i < block->dominated_blocks()->length(); ++i) { | 3910 for (int i = 0; i < block->dominated_blocks()->length(); ++i) { |
3906 SetupInformativeDefinitionsRecursively(block->dominated_blocks()->at(i)); | 3911 SetupInformativeDefinitionsRecursively(block->dominated_blocks()->at(i)); |
3907 } | 3912 } |
| 3913 |
| 3914 for (HInstruction* i = block->first(); i != NULL; i = i->next()) { |
| 3915 if (i->IsBoundsCheck()) { |
| 3916 HBoundsCheck* check = HBoundsCheck::cast(i); |
| 3917 check->ApplyIndexChange(); |
| 3918 } |
| 3919 } |
3908 } | 3920 } |
3909 | 3921 |
3910 | 3922 |
3911 void HGraph::SetupInformativeDefinitions() { | 3923 void HGraph::SetupInformativeDefinitions() { |
3912 HPhase phase("H_Setup informative definitions", this); | 3924 HPhase phase("H_Setup informative definitions", this); |
3913 SetupInformativeDefinitionsRecursively(entry_block()); | 3925 SetupInformativeDefinitionsRecursively(entry_block()); |
3914 } | 3926 } |
3915 | 3927 |
3916 | 3928 |
3917 // We try to "factor up" HBoundsCheck instructions towards the root of the | 3929 // We try to "factor up" HBoundsCheck instructions towards the root of the |
(...skipping 6759 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10677 } | 10689 } |
10678 } | 10690 } |
10679 | 10691 |
10680 #ifdef DEBUG | 10692 #ifdef DEBUG |
10681 if (graph_ != NULL) graph_->Verify(false); // No full verify. | 10693 if (graph_ != NULL) graph_->Verify(false); // No full verify. |
10682 if (allocator_ != NULL) allocator_->Verify(); | 10694 if (allocator_ != NULL) allocator_->Verify(); |
10683 #endif | 10695 #endif |
10684 } | 10696 } |
10685 | 10697 |
10686 } } // namespace v8::internal | 10698 } } // namespace v8::internal |
OLD | NEW |