OLD | NEW |
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 "src/code-stubs.h" | 5 #include "src/code-stubs.h" |
6 | 6 |
7 #include "src/bailout-reason.h" | 7 #include "src/bailout-reason.h" |
8 #include "src/crankshaft/hydrogen.h" | 8 #include "src/crankshaft/hydrogen.h" |
9 #include "src/crankshaft/lithium.h" | 9 #include "src/crankshaft/lithium.h" |
10 #include "src/field-index.h" | 10 #include "src/field-index.h" |
(...skipping 1687 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1698 | 1698 |
1699 | 1699 |
1700 Handle<Code> StringAddStub::GenerateCode() { | 1700 Handle<Code> StringAddStub::GenerateCode() { |
1701 return DoGenerateCode(this); | 1701 return DoGenerateCode(this); |
1702 } | 1702 } |
1703 | 1703 |
1704 | 1704 |
1705 template <> | 1705 template <> |
1706 HValue* CodeStubGraphBuilder<ToBooleanStub>::BuildCodeInitializedStub() { | 1706 HValue* CodeStubGraphBuilder<ToBooleanStub>::BuildCodeInitializedStub() { |
1707 ToBooleanStub* stub = casted_stub(); | 1707 ToBooleanStub* stub = casted_stub(); |
1708 HValue* true_value = NULL; | |
1709 HValue* false_value = NULL; | |
1710 | |
1711 switch (stub->mode()) { | |
1712 case ToBooleanStub::RESULT_AS_SMI: | |
1713 true_value = graph()->GetConstant1(); | |
1714 false_value = graph()->GetConstant0(); | |
1715 break; | |
1716 case ToBooleanStub::RESULT_AS_ODDBALL: | |
1717 true_value = graph()->GetConstantTrue(); | |
1718 false_value = graph()->GetConstantFalse(); | |
1719 break; | |
1720 case ToBooleanStub::RESULT_AS_INVERSE_ODDBALL: | |
1721 true_value = graph()->GetConstantFalse(); | |
1722 false_value = graph()->GetConstantTrue(); | |
1723 break; | |
1724 } | |
1725 | |
1726 IfBuilder if_true(this); | 1708 IfBuilder if_true(this); |
1727 if_true.If<HBranch>(GetParameter(0), stub->types()); | 1709 if_true.If<HBranch>(GetParameter(0), stub->types()); |
1728 if_true.Then(); | 1710 if_true.Then(); |
1729 if_true.Return(true_value); | 1711 if_true.Return(graph()->GetConstantTrue()); |
1730 if_true.Else(); | 1712 if_true.Else(); |
1731 if_true.End(); | 1713 if_true.End(); |
1732 return false_value; | 1714 return graph()->GetConstantFalse(); |
1733 } | 1715 } |
1734 | 1716 |
1735 | 1717 |
1736 Handle<Code> ToBooleanStub::GenerateCode() { | 1718 Handle<Code> ToBooleanStub::GenerateCode() { |
1737 return DoGenerateCode(this); | 1719 return DoGenerateCode(this); |
1738 } | 1720 } |
1739 | 1721 |
1740 | 1722 |
1741 template <> | 1723 template <> |
1742 HValue* CodeStubGraphBuilder<StoreGlobalStub>::BuildCodeInitializedStub() { | 1724 HValue* CodeStubGraphBuilder<StoreGlobalStub>::BuildCodeInitializedStub() { |
(...skipping 687 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2430 return Pop(); | 2412 return Pop(); |
2431 } | 2413 } |
2432 | 2414 |
2433 | 2415 |
2434 Handle<Code> KeyedLoadGenericStub::GenerateCode() { | 2416 Handle<Code> KeyedLoadGenericStub::GenerateCode() { |
2435 return DoGenerateCode(this); | 2417 return DoGenerateCode(this); |
2436 } | 2418 } |
2437 | 2419 |
2438 } // namespace internal | 2420 } // namespace internal |
2439 } // namespace v8 | 2421 } // namespace v8 |
OLD | NEW |