| 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 726 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 737 | 737 |
| 738 int32_t LCodeGen::ToInteger32(LConstantOperand* op) const { | 738 int32_t LCodeGen::ToInteger32(LConstantOperand* op) const { |
| 739 return ToRepresentation(op, Representation::Integer32()); | 739 return ToRepresentation(op, Representation::Integer32()); |
| 740 } | 740 } |
| 741 | 741 |
| 742 | 742 |
| 743 int32_t LCodeGen::ToRepresentation(LConstantOperand* op, | 743 int32_t LCodeGen::ToRepresentation(LConstantOperand* op, |
| 744 const Representation& r) const { | 744 const Representation& r) const { |
| 745 HConstant* constant = chunk_->LookupConstant(op); | 745 HConstant* constant = chunk_->LookupConstant(op); |
| 746 int32_t value = constant->Integer32Value(); | 746 int32_t value = constant->Integer32Value(); |
| 747 if (r.IsInteger32()) return value; | 747 if (r.IsInteger32() || r.IsExternal()) return value; |
| 748 ASSERT(r.IsSmiOrTagged()); | 748 ASSERT(r.IsSmiOrTagged()); |
| 749 return reinterpret_cast<int32_t>(Smi::FromInt(value)); | 749 return reinterpret_cast<int32_t>(Smi::FromInt(value)); |
| 750 } | 750 } |
| 751 | 751 |
| 752 | 752 |
| 753 Handle<Object> LCodeGen::ToHandle(LConstantOperand* op) const { | 753 Handle<Object> LCodeGen::ToHandle(LConstantOperand* op) const { |
| 754 HConstant* constant = chunk_->LookupConstant(op); | 754 HConstant* constant = chunk_->LookupConstant(op); |
| 755 ASSERT(chunk_->LookupLiteralRepresentation(op).IsSmiOrTagged()); | 755 ASSERT(chunk_->LookupLiteralRepresentation(op).IsSmiOrTagged()); |
| 756 return constant->handle(isolate()); | 756 return constant->handle(isolate()); |
| 757 } | 757 } |
| (...skipping 5751 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6509 FixedArray::kHeaderSize - kPointerSize)); | 6509 FixedArray::kHeaderSize - kPointerSize)); |
| 6510 __ bind(&done); | 6510 __ bind(&done); |
| 6511 } | 6511 } |
| 6512 | 6512 |
| 6513 | 6513 |
| 6514 #undef __ | 6514 #undef __ |
| 6515 | 6515 |
| 6516 } } // namespace v8::internal | 6516 } } // namespace v8::internal |
| 6517 | 6517 |
| 6518 #endif // V8_TARGET_ARCH_IA32 | 6518 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |