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

Side by Side Diff: src/hydrogen.cc

Issue 12377072: Handling expression decomposition and array bounds check hoisting: working code with lots of debugg… (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Rebased on master and fixed conflicts. Created 7 years, 9 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/hydrogen.h ('k') | src/hydrogen-instructions.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 669 matching lines...) Expand 10 before | Expand all | Expand 10 after
680 ASSERT(!finished_); 680 ASSERT(!finished_);
681 builder_->current_block()->Goto(merge_block_); 681 builder_->current_block()->Goto(merge_block_);
682 failure_block_->FinishExitWithDeoptimization(HDeoptimize::kUseAll); 682 failure_block_->FinishExitWithDeoptimization(HDeoptimize::kUseAll);
683 failure_block_->SetJoinId(id_); 683 failure_block_->SetJoinId(id_);
684 builder_->set_current_block(merge_block_); 684 builder_->set_current_block(merge_block_);
685 merge_block_->SetJoinId(id_); 685 merge_block_->SetJoinId(id_);
686 finished_ = true; 686 finished_ = true;
687 } 687 }
688 688
689 689
690 HConstant* HGraph::GetInvalidContext() {
691 return GetConstantInt32(&constant_invalid_context_, 0xFFFFC0C7);
692 }
693
694
690 HGraphBuilder::IfBuilder::IfBuilder(HGraphBuilder* builder, BailoutId id) 695 HGraphBuilder::IfBuilder::IfBuilder(HGraphBuilder* builder, BailoutId id)
691 : builder_(builder), 696 : builder_(builder),
692 finished_(false), 697 finished_(false),
693 id_(id) { 698 id_(id) {
694 HEnvironment* env = builder->environment(); 699 HEnvironment* env = builder->environment();
695 first_true_block_ = builder->CreateBasicBlock(env->Copy()); 700 first_true_block_ = builder->CreateBasicBlock(env->Copy());
696 last_true_block_ = NULL; 701 last_true_block_ = NULL;
697 first_false_block_ = builder->CreateBasicBlock(env->Copy()); 702 first_false_block_ = builder->CreateBasicBlock(env->Copy());
698 } 703 }
699 704
(...skipping 3300 matching lines...) Expand 10 before | Expand all | Expand 10 after
4000 4005
4001 // This method is recursive, so if its stack frame is large it could 4006 // This method is recursive, so if its stack frame is large it could
4002 // cause a stack overflow. 4007 // cause a stack overflow.
4003 // To keep the individual stack frames small we do the actual work inside 4008 // To keep the individual stack frames small we do the actual work inside
4004 // SetupInformativeDefinitionsInBlock(); 4009 // SetupInformativeDefinitionsInBlock();
4005 void HGraph::SetupInformativeDefinitionsRecursively(HBasicBlock* block) { 4010 void HGraph::SetupInformativeDefinitionsRecursively(HBasicBlock* block) {
4006 SetupInformativeDefinitionsInBlock(block); 4011 SetupInformativeDefinitionsInBlock(block);
4007 for (int i = 0; i < block->dominated_blocks()->length(); ++i) { 4012 for (int i = 0; i < block->dominated_blocks()->length(); ++i) {
4008 SetupInformativeDefinitionsRecursively(block->dominated_blocks()->at(i)); 4013 SetupInformativeDefinitionsRecursively(block->dominated_blocks()->at(i));
4009 } 4014 }
4015
4016 for (HInstruction* i = block->first(); i != NULL; i = i->next()) {
4017 if (i->IsBoundsCheck()) {
4018 HBoundsCheck* check = HBoundsCheck::cast(i);
4019 check->ApplyIndexChange();
4020 }
4021 }
4010 } 4022 }
4011 4023
4012 4024
4013 void HGraph::SetupInformativeDefinitions() { 4025 void HGraph::SetupInformativeDefinitions() {
4014 HPhase phase("H_Setup informative definitions", this); 4026 HPhase phase("H_Setup informative definitions", this);
4015 SetupInformativeDefinitionsRecursively(entry_block()); 4027 SetupInformativeDefinitionsRecursively(entry_block());
4016 } 4028 }
4017 4029
4018 4030
4019 // We try to "factor up" HBoundsCheck instructions towards the root of the 4031 // We try to "factor up" HBoundsCheck instructions towards the root of the
(...skipping 6917 matching lines...) Expand 10 before | Expand all | Expand 10 after
10937 } 10949 }
10938 } 10950 }
10939 10951
10940 #ifdef DEBUG 10952 #ifdef DEBUG
10941 if (graph_ != NULL) graph_->Verify(false); // No full verify. 10953 if (graph_ != NULL) graph_->Verify(false); // No full verify.
10942 if (allocator_ != NULL) allocator_->Verify(); 10954 if (allocator_ != NULL) allocator_->Verify();
10943 #endif 10955 #endif
10944 } 10956 }
10945 10957
10946 } } // namespace v8::internal 10958 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/hydrogen.h ('k') | src/hydrogen-instructions.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698