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/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #include "src/code-stubs.h" | 7 #include "src/code-stubs.h" |
8 #include "src/field-index.h" | 8 #include "src/field-index.h" |
9 #include "src/hydrogen.h" | 9 #include "src/hydrogen.h" |
10 #include "src/lithium.h" | 10 #include "src/lithium.h" |
(...skipping 1045 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1056 return DoGenerateCode(this); | 1056 return DoGenerateCode(this); |
1057 } | 1057 } |
1058 | 1058 |
1059 | 1059 |
1060 template <> | 1060 template <> |
1061 HValue* CodeStubGraphBuilder<ToBooleanStub>::BuildCodeInitializedStub() { | 1061 HValue* CodeStubGraphBuilder<ToBooleanStub>::BuildCodeInitializedStub() { |
1062 ToBooleanStub* stub = casted_stub(); | 1062 ToBooleanStub* stub = casted_stub(); |
1063 HValue* true_value = NULL; | 1063 HValue* true_value = NULL; |
1064 HValue* false_value = NULL; | 1064 HValue* false_value = NULL; |
1065 | 1065 |
1066 switch (stub->GetMode()) { | 1066 switch (stub->mode()) { |
1067 case ToBooleanStub::RESULT_AS_SMI: | 1067 case ToBooleanStub::RESULT_AS_SMI: |
1068 true_value = graph()->GetConstant1(); | 1068 true_value = graph()->GetConstant1(); |
1069 false_value = graph()->GetConstant0(); | 1069 false_value = graph()->GetConstant0(); |
1070 break; | 1070 break; |
1071 case ToBooleanStub::RESULT_AS_ODDBALL: | 1071 case ToBooleanStub::RESULT_AS_ODDBALL: |
1072 true_value = graph()->GetConstantTrue(); | 1072 true_value = graph()->GetConstantTrue(); |
1073 false_value = graph()->GetConstantFalse(); | 1073 false_value = graph()->GetConstantFalse(); |
1074 break; | 1074 break; |
1075 case ToBooleanStub::RESULT_AS_INVERSE_ODDBALL: | 1075 case ToBooleanStub::RESULT_AS_INVERSE_ODDBALL: |
1076 true_value = graph()->GetConstantFalse(); | 1076 true_value = graph()->GetConstantFalse(); |
1077 false_value = graph()->GetConstantTrue(); | 1077 false_value = graph()->GetConstantTrue(); |
1078 break; | 1078 break; |
1079 } | 1079 } |
1080 | 1080 |
1081 IfBuilder if_true(this); | 1081 IfBuilder if_true(this); |
1082 if_true.If<HBranch>(GetParameter(0), stub->GetTypes()); | 1082 if_true.If<HBranch>(GetParameter(0), stub->types()); |
1083 if_true.Then(); | 1083 if_true.Then(); |
1084 if_true.Return(true_value); | 1084 if_true.Return(true_value); |
1085 if_true.Else(); | 1085 if_true.Else(); |
1086 if_true.End(); | 1086 if_true.End(); |
1087 return false_value; | 1087 return false_value; |
1088 } | 1088 } |
1089 | 1089 |
1090 | 1090 |
1091 Handle<Code> ToBooleanStub::GenerateCode() { | 1091 Handle<Code> ToBooleanStub::GenerateCode() { |
1092 return DoGenerateCode(this); | 1092 return DoGenerateCode(this); |
(...skipping 713 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1806 HValue* receiver = GetParameter(FullVectorLoadConvention::kReceiverIndex); | 1806 HValue* receiver = GetParameter(FullVectorLoadConvention::kReceiverIndex); |
1807 Add<HDeoptimize>("Always deopt", Deoptimizer::EAGER); | 1807 Add<HDeoptimize>("Always deopt", Deoptimizer::EAGER); |
1808 return receiver; | 1808 return receiver; |
1809 } | 1809 } |
1810 | 1810 |
1811 | 1811 |
1812 Handle<Code> VectorKeyedLoadStub::GenerateCode() { | 1812 Handle<Code> VectorKeyedLoadStub::GenerateCode() { |
1813 return DoGenerateCode(this); | 1813 return DoGenerateCode(this); |
1814 } | 1814 } |
1815 } } // namespace v8::internal | 1815 } } // namespace v8::internal |
OLD | NEW |