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

Side by Side Diff: src/hydrogen-instructions.cc

Issue 300423003: Handle HCheckInstanceType and HIsStringAndBranch in check elimination. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressed comments Created 6 years, 6 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-instructions.h ('k') | src/unique.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 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "v8.h" 5 #include "v8.h"
6 6
7 #include "double.h" 7 #include "double.h"
8 #include "factory.h" 8 #include "factory.h"
9 #include "hydrogen-infer-representation.h" 9 #include "hydrogen-infer-representation.h"
10 #include "property-details-inl.h" 10 #include "property-details-inl.h"
(...skipping 3233 matching lines...) Expand 10 before | Expand all | Expand 10 after
3244 *block = ConstantIsObject(HConstant::cast(value()), isolate()) 3244 *block = ConstantIsObject(HConstant::cast(value()), isolate())
3245 ? FirstSuccessor() : SecondSuccessor(); 3245 ? FirstSuccessor() : SecondSuccessor();
3246 return true; 3246 return true;
3247 } 3247 }
3248 *block = NULL; 3248 *block = NULL;
3249 return false; 3249 return false;
3250 } 3250 }
3251 3251
3252 3252
3253 bool HIsStringAndBranch::KnownSuccessorBlock(HBasicBlock** block) { 3253 bool HIsStringAndBranch::KnownSuccessorBlock(HBasicBlock** block) {
3254 if (known_successor_index() != kNoKnownSuccessorIndex) {
3255 *block = SuccessorAt(known_successor_index());
3256 return true;
3257 }
3254 if (FLAG_fold_constants && value()->IsConstant()) { 3258 if (FLAG_fold_constants && value()->IsConstant()) {
3255 *block = HConstant::cast(value())->HasStringValue() 3259 *block = HConstant::cast(value())->HasStringValue()
3256 ? FirstSuccessor() : SecondSuccessor(); 3260 ? FirstSuccessor() : SecondSuccessor();
3257 return true; 3261 return true;
3258 } 3262 }
3263 if (value()->type().IsString()) {
3264 *block = FirstSuccessor();
3265 return true;
3266 }
3267 if (value()->type().IsSmi() ||
3268 value()->type().IsNull() ||
3269 value()->type().IsBoolean() ||
3270 value()->type().IsUndefined() ||
3271 value()->type().IsJSObject()) {
3272 *block = SecondSuccessor();
3273 return true;
3274 }
3259 *block = NULL; 3275 *block = NULL;
3260 return false; 3276 return false;
3261 } 3277 }
3262 3278
3263 3279
3264 bool HIsUndetectableAndBranch::KnownSuccessorBlock(HBasicBlock** block) { 3280 bool HIsUndetectableAndBranch::KnownSuccessorBlock(HBasicBlock** block) {
3265 if (FLAG_fold_constants && value()->IsConstant()) { 3281 if (FLAG_fold_constants && value()->IsConstant()) {
3266 *block = HConstant::cast(value())->IsUndetectable() 3282 *block = HConstant::cast(value())->IsUndetectable()
3267 ? FirstSuccessor() : SecondSuccessor(); 3283 ? FirstSuccessor() : SecondSuccessor();
3268 return true; 3284 return true;
(...skipping 1478 matching lines...) Expand 10 before | Expand all | Expand 10 after
4747 break; 4763 break;
4748 case kExternalMemory: 4764 case kExternalMemory:
4749 stream->Add("[external-memory]"); 4765 stream->Add("[external-memory]");
4750 break; 4766 break;
4751 } 4767 }
4752 4768
4753 stream->Add("@%d", offset()); 4769 stream->Add("@%d", offset());
4754 } 4770 }
4755 4771
4756 } } // namespace v8::internal 4772 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/hydrogen-instructions.h ('k') | src/unique.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698