| OLD | NEW |
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 17 matching lines...) Expand all Loading... |
| 28 // Review notes: | 28 // Review notes: |
| 29 // | 29 // |
| 30 // - The use of macros in these inline functions may seem superfluous | 30 // - The use of macros in these inline functions may seem superfluous |
| 31 // but it is absolutely needed to make sure gcc generates optimal | 31 // but it is absolutely needed to make sure gcc generates optimal |
| 32 // code. gcc is not happy when attempting to inline too deep. | 32 // code. gcc is not happy when attempting to inline too deep. |
| 33 // | 33 // |
| 34 | 34 |
| 35 #ifndef V8_OBJECTS_INL_H_ | 35 #ifndef V8_OBJECTS_INL_H_ |
| 36 #define V8_OBJECTS_INL_H_ | 36 #define V8_OBJECTS_INL_H_ |
| 37 | 37 |
| 38 #include "assembler.h" |
| 38 #include "objects.h" | 39 #include "objects.h" |
| 39 #include "contexts.h" | 40 #include "contexts.h" |
| 40 #include "conversions-inl.h" | 41 #include "conversions-inl.h" |
| 41 #include "heap.h" | 42 #include "heap.h" |
| 42 #include "isolate.h" | 43 #include "isolate.h" |
| 43 #include "property.h" | 44 #include "property.h" |
| 44 #include "spaces.h" | 45 #include "spaces.h" |
| 45 #include "v8memory.h" | 46 #include "v8memory.h" |
| 46 | 47 |
| 47 namespace v8 { | 48 namespace v8 { |
| (...skipping 1555 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1603 | 1604 |
| 1604 void FixedArray::set(int index, Object* value) { | 1605 void FixedArray::set(int index, Object* value) { |
| 1605 ASSERT(map() != HEAP->fixed_cow_array_map()); | 1606 ASSERT(map() != HEAP->fixed_cow_array_map()); |
| 1606 ASSERT(index >= 0 && index < this->length()); | 1607 ASSERT(index >= 0 && index < this->length()); |
| 1607 int offset = kHeaderSize + index * kPointerSize; | 1608 int offset = kHeaderSize + index * kPointerSize; |
| 1608 WRITE_FIELD(this, offset, value); | 1609 WRITE_FIELD(this, offset, value); |
| 1609 WRITE_BARRIER(this, offset); | 1610 WRITE_BARRIER(this, offset); |
| 1610 } | 1611 } |
| 1611 | 1612 |
| 1612 | 1613 |
| 1614 inline bool FixedDoubleArray::is_the_hole_nan(double value) { |
| 1615 return BitCast<uint64_t, double>(value) == kHoleNanInt64; |
| 1616 } |
| 1617 |
| 1618 |
| 1619 inline double FixedDoubleArray::hole_nan_as_double() { |
| 1620 return BitCast<double, uint64_t>(kHoleNanInt64); |
| 1621 } |
| 1622 |
| 1623 |
| 1624 inline double FixedDoubleArray::canonical_not_the_hole_nan_as_double() { |
| 1625 return BitCast<double, uint64_t>(kCanonicalNonHoleNanInt64); |
| 1626 } |
| 1627 |
| 1628 |
| 1613 double FixedDoubleArray::get(int index) { | 1629 double FixedDoubleArray::get(int index) { |
| 1614 ASSERT(map() != HEAP->fixed_cow_array_map() && | 1630 ASSERT(map() != HEAP->fixed_cow_array_map() && |
| 1615 map() != HEAP->fixed_array_map()); | 1631 map() != HEAP->fixed_array_map()); |
| 1616 ASSERT(index >= 0 && index < this->length()); | 1632 ASSERT(index >= 0 && index < this->length()); |
| 1617 double result = READ_DOUBLE_FIELD(this, kHeaderSize + index * kDoubleSize); | 1633 double result = READ_DOUBLE_FIELD(this, kHeaderSize + index * kDoubleSize); |
| 1618 ASSERT(!is_the_hole_nan(result)); | 1634 ASSERT(!is_the_hole_nan(result)); |
| 1619 return result; | 1635 return result; |
| 1620 } | 1636 } |
| 1621 | 1637 |
| 1622 | 1638 |
| (...skipping 2823 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4446 #undef WRITE_INT_FIELD | 4462 #undef WRITE_INT_FIELD |
| 4447 #undef READ_SHORT_FIELD | 4463 #undef READ_SHORT_FIELD |
| 4448 #undef WRITE_SHORT_FIELD | 4464 #undef WRITE_SHORT_FIELD |
| 4449 #undef READ_BYTE_FIELD | 4465 #undef READ_BYTE_FIELD |
| 4450 #undef WRITE_BYTE_FIELD | 4466 #undef WRITE_BYTE_FIELD |
| 4451 | 4467 |
| 4452 | 4468 |
| 4453 } } // namespace v8::internal | 4469 } } // namespace v8::internal |
| 4454 | 4470 |
| 4455 #endif // V8_OBJECTS_INL_H_ | 4471 #endif // V8_OBJECTS_INL_H_ |
| OLD | NEW |