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 12 matching lines...) Expand all Loading... |
23 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 23 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
24 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 24 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
25 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 25 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
27 | 27 |
28 #include "v8.h" | 28 #include "v8.h" |
29 | 29 |
30 #include "double.h" | 30 #include "double.h" |
31 #include "factory.h" | 31 #include "factory.h" |
32 #include "hydrogen-infer-representation.h" | 32 #include "hydrogen-infer-representation.h" |
| 33 #include "property-details-inl.h" |
33 | 34 |
34 #if V8_TARGET_ARCH_IA32 | 35 #if V8_TARGET_ARCH_IA32 |
35 #include "ia32/lithium-ia32.h" | 36 #include "ia32/lithium-ia32.h" |
36 #elif V8_TARGET_ARCH_X64 | 37 #elif V8_TARGET_ARCH_X64 |
37 #include "x64/lithium-x64.h" | 38 #include "x64/lithium-x64.h" |
38 #elif V8_TARGET_ARCH_A64 | 39 #elif V8_TARGET_ARCH_A64 |
39 #include "a64/lithium-a64.h" | 40 #include "a64/lithium-a64.h" |
40 #elif V8_TARGET_ARCH_ARM | 41 #elif V8_TARGET_ARCH_ARM |
41 #include "arm/lithium-arm.h" | 42 #include "arm/lithium-arm.h" |
42 #elif V8_TARGET_ARCH_MIPS | 43 #elif V8_TARGET_ARCH_MIPS |
(...skipping 1383 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1426 return this; | 1427 return this; |
1427 } | 1428 } |
1428 | 1429 |
1429 | 1430 |
1430 void HTypeof::PrintDataTo(StringStream* stream) { | 1431 void HTypeof::PrintDataTo(StringStream* stream) { |
1431 value()->PrintNameTo(stream); | 1432 value()->PrintNameTo(stream); |
1432 } | 1433 } |
1433 | 1434 |
1434 | 1435 |
1435 HInstruction* HForceRepresentation::New(Zone* zone, HValue* context, | 1436 HInstruction* HForceRepresentation::New(Zone* zone, HValue* context, |
1436 HValue* value, Representation required_representation) { | 1437 HValue* value, Representation representation) { |
1437 if (FLAG_fold_constants && value->IsConstant()) { | 1438 if (FLAG_fold_constants && value->IsConstant()) { |
1438 HConstant* c = HConstant::cast(value); | 1439 HConstant* c = HConstant::cast(value); |
1439 if (c->HasNumberValue()) { | 1440 if (c->HasNumberValue()) { |
1440 double double_res = c->DoubleValue(); | 1441 double double_res = c->DoubleValue(); |
1441 if (IsInt32Double(double_res)) { | 1442 if (representation.CanContainDouble(double_res)) { |
1442 return HConstant::New(zone, context, | 1443 return HConstant::New(zone, context, |
1443 static_cast<int32_t>(double_res), | 1444 static_cast<int32_t>(double_res), |
1444 required_representation); | 1445 representation); |
1445 } | 1446 } |
1446 } | 1447 } |
1447 } | 1448 } |
1448 return new(zone) HForceRepresentation(value, required_representation); | 1449 return new(zone) HForceRepresentation(value, representation); |
1449 } | 1450 } |
1450 | 1451 |
1451 | 1452 |
1452 void HForceRepresentation::PrintDataTo(StringStream* stream) { | 1453 void HForceRepresentation::PrintDataTo(StringStream* stream) { |
1453 stream->Add("%s ", representation().Mnemonic()); | 1454 stream->Add("%s ", representation().Mnemonic()); |
1454 value()->PrintNameTo(stream); | 1455 value()->PrintNameTo(stream); |
1455 } | 1456 } |
1456 | 1457 |
1457 | 1458 |
1458 void HChange::PrintDataTo(StringStream* stream) { | 1459 void HChange::PrintDataTo(StringStream* stream) { |
(...skipping 3094 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4553 break; | 4554 break; |
4554 case kExternalMemory: | 4555 case kExternalMemory: |
4555 stream->Add("[external-memory]"); | 4556 stream->Add("[external-memory]"); |
4556 break; | 4557 break; |
4557 } | 4558 } |
4558 | 4559 |
4559 stream->Add("@%d", offset()); | 4560 stream->Add("@%d", offset()); |
4560 } | 4561 } |
4561 | 4562 |
4562 } } // namespace v8::internal | 4563 } } // namespace v8::internal |
OLD | NEW |