OLD | NEW |
---|---|
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 2767 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2778 } | 2778 } |
2779 if (HChange::cast(value())->value()->type().IsSmi()) { | 2779 if (HChange::cast(value())->value()->type().IsSmi()) { |
2780 return false; | 2780 return false; |
2781 } | 2781 } |
2782 } | 2782 } |
2783 return true; | 2783 return true; |
2784 } | 2784 } |
2785 | 2785 |
2786 | 2786 |
2787 #define H_CONSTANT_INT32(val) \ | 2787 #define H_CONSTANT_INT32(val) \ |
2788 new(zone) HConstant(FACTORY->NewNumberFromInt(val, TENURED), \ | 2788 new(zone) HConstant(static_cast<int32_t>(val), Representation::Integer32()) |
2789 Representation::Integer32()) | |
2790 #define H_CONSTANT_DOUBLE(val) \ | 2789 #define H_CONSTANT_DOUBLE(val) \ |
2791 new(zone) HConstant(FACTORY->NewNumber(val, TENURED), \ | 2790 new(zone) HConstant(static_cast<double>(val), Representation::Double()) |
Jakob Kummerow
2013/02/21 12:17:04
I don't think this cast is necessary, but it shoul
| |
2792 Representation::Double()) | |
2793 | 2791 |
2794 #define DEFINE_NEW_H_SIMPLE_ARITHMETIC_INSTR(HInstr, op) \ | 2792 #define DEFINE_NEW_H_SIMPLE_ARITHMETIC_INSTR(HInstr, op) \ |
2795 HInstruction* HInstr::New( \ | 2793 HInstruction* HInstr::New( \ |
2796 Zone* zone, HValue* context, HValue* left, HValue* right) { \ | 2794 Zone* zone, HValue* context, HValue* left, HValue* right) { \ |
2797 if (FLAG_fold_constants && left->IsConstant() && right->IsConstant()) { \ | 2795 if (FLAG_fold_constants && left->IsConstant() && right->IsConstant()) { \ |
2798 HConstant* c_left = HConstant::cast(left); \ | 2796 HConstant* c_left = HConstant::cast(left); \ |
2799 HConstant* c_right = HConstant::cast(right); \ | 2797 HConstant* c_right = HConstant::cast(right); \ |
2800 if ((c_left->HasNumberValue() && c_right->HasNumberValue())) { \ | 2798 if ((c_left->HasNumberValue() && c_right->HasNumberValue())) { \ |
2801 double double_res = c_left->DoubleValue() op c_right->DoubleValue(); \ | 2799 double double_res = c_left->DoubleValue() op c_right->DoubleValue(); \ |
2802 if (TypeInfo::IsInt32Double(double_res)) { \ | 2800 if (TypeInfo::IsInt32Double(double_res)) { \ |
(...skipping 447 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3250 | 3248 |
3251 | 3249 |
3252 void HCheckFunction::Verify() { | 3250 void HCheckFunction::Verify() { |
3253 HInstruction::Verify(); | 3251 HInstruction::Verify(); |
3254 ASSERT(HasNoUses()); | 3252 ASSERT(HasNoUses()); |
3255 } | 3253 } |
3256 | 3254 |
3257 #endif | 3255 #endif |
3258 | 3256 |
3259 } } // namespace v8::internal | 3257 } } // namespace v8::internal |
OLD | NEW |