Chromium Code Reviews| Index: src/code-stubs-hydrogen.cc |
| diff --git a/src/code-stubs-hydrogen.cc b/src/code-stubs-hydrogen.cc |
| index afd066d6f19ce566ad18dd99bd4f6655770a8d62..20288af53fe545e992ec495ebeed8b303e43faaa 100644 |
| --- a/src/code-stubs-hydrogen.cc |
| +++ b/src/code-stubs-hydrogen.cc |
| @@ -676,4 +676,25 @@ 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.Return(graph()->GetConstant0()); |
| + if_true.End(); |
| + return graph()->GetConstantUndefined(); |
|
Toon Verwaest
2013/05/28 09:33:32
This is a bit weird. What about just having the Th
|
| +} |
| + |
| + |
| +Handle<Code> ToBooleanStub::GenerateCode() { |
| + return DoGenerateCode(this); |
| +} |
| + |
| + |
| } } // namespace v8::internal |