| 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 3882 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3893 return H_CONSTANT_DOUBLE(d); | 3893 return H_CONSTANT_DOUBLE(d); |
| 3894 default: | 3894 default: |
| 3895 UNREACHABLE(); | 3895 UNREACHABLE(); |
| 3896 break; | 3896 break; |
| 3897 } | 3897 } |
| 3898 } | 3898 } |
| 3899 switch (op) { | 3899 switch (op) { |
| 3900 case kMathExp: | 3900 case kMathExp: |
| 3901 return H_CONSTANT_DOUBLE(fast_exp(d)); | 3901 return H_CONSTANT_DOUBLE(fast_exp(d)); |
| 3902 case kMathLog: | 3902 case kMathLog: |
| 3903 return H_CONSTANT_DOUBLE(log(d)); | 3903 return H_CONSTANT_DOUBLE(std::log(d)); |
| 3904 case kMathSqrt: | 3904 case kMathSqrt: |
| 3905 return H_CONSTANT_DOUBLE(fast_sqrt(d)); | 3905 return H_CONSTANT_DOUBLE(fast_sqrt(d)); |
| 3906 case kMathPowHalf: | 3906 case kMathPowHalf: |
| 3907 return H_CONSTANT_DOUBLE(power_double_double(d, 0.5)); | 3907 return H_CONSTANT_DOUBLE(power_double_double(d, 0.5)); |
| 3908 case kMathAbs: | 3908 case kMathAbs: |
| 3909 return H_CONSTANT_DOUBLE((d >= 0.0) ? d + 0.0 : -d); | 3909 return H_CONSTANT_DOUBLE((d >= 0.0) ? d + 0.0 : -d); |
| 3910 case kMathRound: | 3910 case kMathRound: |
| 3911 // -0.5 .. -0.0 round to -0.0. | 3911 // -0.5 .. -0.0 round to -0.0. |
| 3912 if ((d >= -0.5 && Double(d).Sign() < 0)) return H_CONSTANT_DOUBLE(-0.0); | 3912 if ((d >= -0.5 && Double(d).Sign() < 0)) return H_CONSTANT_DOUBLE(-0.0); |
| 3913 // Doubles are represented as Significant * 2 ^ Exponent. If the | 3913 // Doubles are represented as Significant * 2 ^ Exponent. If the |
| 3914 // Exponent is not negative, the double value is already an integer. | 3914 // Exponent is not negative, the double value is already an integer. |
| 3915 if (Double(d).Exponent() >= 0) return H_CONSTANT_DOUBLE(d); | 3915 if (Double(d).Exponent() >= 0) return H_CONSTANT_DOUBLE(d); |
| 3916 return H_CONSTANT_DOUBLE(floor(d + 0.5)); | 3916 return H_CONSTANT_DOUBLE(std::floor(d + 0.5)); |
| 3917 case kMathFloor: | 3917 case kMathFloor: |
| 3918 return H_CONSTANT_DOUBLE(floor(d)); | 3918 return H_CONSTANT_DOUBLE(std::floor(d)); |
| 3919 default: | 3919 default: |
| 3920 UNREACHABLE(); | 3920 UNREACHABLE(); |
| 3921 break; | 3921 break; |
| 3922 } | 3922 } |
| 3923 } while (false); | 3923 } while (false); |
| 3924 return new(zone) HUnaryMathOperation(context, value, op); | 3924 return new(zone) HUnaryMathOperation(context, value, op); |
| 3925 } | 3925 } |
| 3926 | 3926 |
| 3927 | 3927 |
| 3928 HInstruction* HPower::New(Zone* zone, | 3928 HInstruction* HPower::New(Zone* zone, |
| (...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4279 return HObjectAccess(portion, offset, representation); | 4279 return HObjectAccess(portion, offset, representation); |
| 4280 } | 4280 } |
| 4281 | 4281 |
| 4282 | 4282 |
| 4283 HObjectAccess HObjectAccess::ForAllocationSiteOffset(int offset) { | 4283 HObjectAccess HObjectAccess::ForAllocationSiteOffset(int offset) { |
| 4284 switch (offset) { | 4284 switch (offset) { |
| 4285 case AllocationSite::kTransitionInfoOffset: | 4285 case AllocationSite::kTransitionInfoOffset: |
| 4286 return HObjectAccess(kInobject, offset, Representation::Tagged()); | 4286 return HObjectAccess(kInobject, offset, Representation::Tagged()); |
| 4287 case AllocationSite::kNestedSiteOffset: | 4287 case AllocationSite::kNestedSiteOffset: |
| 4288 return HObjectAccess(kInobject, offset, Representation::Tagged()); | 4288 return HObjectAccess(kInobject, offset, Representation::Tagged()); |
| 4289 case AllocationSite::kMementoFoundCountOffset: | 4289 case AllocationSite::kPretenureDataOffset: |
| 4290 return HObjectAccess(kInobject, offset, Representation::Smi()); | 4290 return HObjectAccess(kInobject, offset, Representation::Smi()); |
| 4291 case AllocationSite::kMementoCreateCountOffset: | 4291 case AllocationSite::kPretenureCreateCountOffset: |
| 4292 return HObjectAccess(kInobject, offset, Representation::Smi()); | |
| 4293 case AllocationSite::kPretenureDecisionOffset: | |
| 4294 return HObjectAccess(kInobject, offset, Representation::Smi()); | 4292 return HObjectAccess(kInobject, offset, Representation::Smi()); |
| 4295 case AllocationSite::kDependentCodeOffset: | 4293 case AllocationSite::kDependentCodeOffset: |
| 4296 return HObjectAccess(kInobject, offset, Representation::Tagged()); | 4294 return HObjectAccess(kInobject, offset, Representation::Tagged()); |
| 4297 case AllocationSite::kWeakNextOffset: | 4295 case AllocationSite::kWeakNextOffset: |
| 4298 return HObjectAccess(kInobject, offset, Representation::Tagged()); | 4296 return HObjectAccess(kInobject, offset, Representation::Tagged()); |
| 4299 default: | 4297 default: |
| 4300 UNREACHABLE(); | 4298 UNREACHABLE(); |
| 4301 } | 4299 } |
| 4302 return HObjectAccess(kInobject, offset); | 4300 return HObjectAccess(kInobject, offset); |
| 4303 } | 4301 } |
| (...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4449 break; | 4447 break; |
| 4450 case kExternalMemory: | 4448 case kExternalMemory: |
| 4451 stream->Add("[external-memory]"); | 4449 stream->Add("[external-memory]"); |
| 4452 break; | 4450 break; |
| 4453 } | 4451 } |
| 4454 | 4452 |
| 4455 stream->Add("@%d", offset()); | 4453 stream->Add("@%d", offset()); |
| 4456 } | 4454 } |
| 4457 | 4455 |
| 4458 } } // namespace v8::internal | 4456 } } // namespace v8::internal |
| OLD | NEW |