Index: src/code-stubs-hydrogen.cc |
diff --git a/src/code-stubs-hydrogen.cc b/src/code-stubs-hydrogen.cc |
index 86bf0757d457fce3cb769f4d91aaec2e7637968d..24c66fa8a94ae65a9647d8678c236c171e2aa0b9 100644 |
--- a/src/code-stubs-hydrogen.cc |
+++ b/src/code-stubs-hydrogen.cc |
@@ -676,4 +676,24 @@ Handle<Code> CompareNilICStub::GenerateCode() { |
return DoGenerateCode(this); |
} |
+ |
+template <> |
+HValue* CodeStubGraphBuilder<ToBooleanStub>::BuildCodeInitializedStub() { |
+ ToBooleanStub* stub = casted_stub(); |
+ |
+ IfBuilder if_true(this); |
+ if_true.If<HBranch>(GetParameter(0), stub->GetTypes()); |
+ if_true.Then(); |
+ if_true.Return(graph()->GetConstant1()); |
+ if_true.Else(); |
+ if_true.End(); |
+ return graph()->GetConstant0(); |
+} |
+ |
+ |
+Handle<Code> ToBooleanStub::GenerateCode() { |
+ return DoGenerateCode(this); |
+} |
+ |
+ |
} } // namespace v8::internal |