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

Unified Diff: src/code-stubs-hydrogen.cc

Issue 14075013: Replace CheckBuilder with IfBuilder everywhere. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/hydrogen.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/code-stubs-hydrogen.cc
diff --git a/src/code-stubs-hydrogen.cc b/src/code-stubs-hydrogen.cc
index f8661566e041714a46ea5543405dca69507a4e66..ee93a743379b5225aebd2d9ea6a480e5dec312d9 100644
--- a/src/code-stubs-hydrogen.cc
+++ b/src/code-stubs-hydrogen.cc
@@ -191,9 +191,10 @@ class CodeStubGraphBuilder: public CodeStubGraphBuilderBase {
virtual HValue* BuildCodeUninitializedStub() {
// Force a deopt that falls back to the runtime.
HValue* undefined = graph()->GetConstantUndefined();
- CheckBuilder builder(this);
- builder.CheckNotUndefined(undefined);
- builder.End();
+ IfBuilder builder(this);
+ builder.IfNot<HCompareObjectEqAndBranch, HValue*>(undefined, undefined);
+ builder.Then();
+ builder.ElseDeopt();
return undefined;
}
@@ -263,6 +264,7 @@ template <>
HValue* CodeStubGraphBuilder<FastCloneShallowArrayStub>::BuildCodeStub() {
Zone* zone = this->zone();
Factory* factory = isolate()->factory();
+ HValue* undefined = graph()->GetConstantUndefined();
AllocationSiteMode alloc_site_mode = casted_stub()->allocation_site_mode();
FastCloneShallowArrayStub::Mode mode = casted_stub()->mode();
int length = casted_stub()->length();
@@ -273,8 +275,9 @@ HValue* CodeStubGraphBuilder<FastCloneShallowArrayStub>::BuildCodeStub() {
NULL,
FAST_ELEMENTS));
- CheckBuilder builder(this);
- builder.CheckNotUndefined(boilerplate);
+ IfBuilder checker(this);
+ checker.IfNot<HCompareObjectEqAndBranch, HValue*>(boilerplate, undefined);
+ checker.Then();
if (mode == FastCloneShallowArrayStub::CLONE_ANY_ELEMENTS) {
HValue* elements =
@@ -313,7 +316,9 @@ HValue* CodeStubGraphBuilder<FastCloneShallowArrayStub>::BuildCodeStub() {
length));
}
- return environment()->Pop();
+ HValue* result = environment()->Pop();
+ checker.ElseDeopt();
+ return result;
}
@@ -326,6 +331,7 @@ template <>
HValue* CodeStubGraphBuilder<FastCloneShallowObjectStub>::BuildCodeStub() {
Zone* zone = this->zone();
Factory* factory = isolate()->factory();
+ HValue* undefined = graph()->GetConstantUndefined();
HInstruction* boilerplate =
AddInstruction(new(zone) HLoadKeyed(GetParameter(0),
@@ -333,8 +339,9 @@ HValue* CodeStubGraphBuilder<FastCloneShallowObjectStub>::BuildCodeStub() {
NULL,
FAST_ELEMENTS));
- CheckBuilder builder(this);
- builder.CheckNotUndefined(boilerplate);
+ IfBuilder checker(this);
+ checker.IfNot<HCompareObjectEqAndBranch, HValue*>(boilerplate, undefined);
+ checker.And();
int size = JSObject::kHeaderSize + casted_stub()->length() * kPointerSize;
HValue* boilerplate_size =
@@ -342,7 +349,8 @@ HValue* CodeStubGraphBuilder<FastCloneShallowObjectStub>::BuildCodeStub() {
HValue* size_in_words =
AddInstruction(new(zone) HConstant(size >> kPointerSizeLog2,
Representation::Integer32()));
- builder.CheckIntegerEq(boilerplate_size, size_in_words);
+ checker.IfCompare(boilerplate_size, size_in_words, Token::EQ);
+ checker.Then();
HValue* size_in_bytes =
AddInstruction(new(zone) HConstant(size, Representation::Integer32()));
@@ -366,7 +374,7 @@ HValue* CodeStubGraphBuilder<FastCloneShallowObjectStub>::BuildCodeStub() {
true, i));
}
- builder.End();
+ checker.ElseDeopt();
return object;
}
« no previous file with comments | « no previous file | src/hydrogen.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698