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 "elements.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 1544 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1592 return reinterpret_cast<FixedArrayBase*>(object); | 1593 return reinterpret_cast<FixedArrayBase*>(object); |
1593 } | 1594 } |
1594 | 1595 |
1595 | 1596 |
1596 Object* FixedArray::get(int index) { | 1597 Object* FixedArray::get(int index) { |
1597 ASSERT(index >= 0 && index < this->length()); | 1598 ASSERT(index >= 0 && index < this->length()); |
1598 return READ_FIELD(this, kHeaderSize + index * kPointerSize); | 1599 return READ_FIELD(this, kHeaderSize + index * kPointerSize); |
1599 } | 1600 } |
1600 | 1601 |
1601 | 1602 |
1603 bool FixedArray::is_the_hole(int index) { | |
1604 return get(index)->IsTheHole(); | |
Lasse Reichstein
2011/08/01 09:35:54
Is this really used so much that it needs this sho
danno
2011/08/02 13:37:46
Done.
| |
1605 } | |
1606 | |
1607 | |
1602 void FixedArray::set(int index, Smi* value) { | 1608 void FixedArray::set(int index, Smi* value) { |
1603 ASSERT(map() != HEAP->fixed_cow_array_map()); | 1609 ASSERT(map() != HEAP->fixed_cow_array_map()); |
1604 ASSERT(reinterpret_cast<Object*>(value)->IsSmi()); | 1610 ASSERT(reinterpret_cast<Object*>(value)->IsSmi()); |
1605 int offset = kHeaderSize + index * kPointerSize; | 1611 int offset = kHeaderSize + index * kPointerSize; |
1606 WRITE_FIELD(this, offset, value); | 1612 WRITE_FIELD(this, offset, value); |
1607 } | 1613 } |
1608 | 1614 |
1609 | 1615 |
1610 void FixedArray::set(int index, Object* value) { | 1616 void FixedArray::set(int index, Object* value) { |
1611 ASSERT(map() != HEAP->fixed_cow_array_map()); | 1617 ASSERT(map() != HEAP->fixed_cow_array_map()); |
(...skipping 14 matching lines...) Expand all Loading... | |
1626 } | 1632 } |
1627 | 1633 |
1628 | 1634 |
1629 inline double FixedDoubleArray::canonical_not_the_hole_nan_as_double() { | 1635 inline double FixedDoubleArray::canonical_not_the_hole_nan_as_double() { |
1630 ASSERT(BitCast<uint64_t>(OS::nan_value()) != kHoleNanInt64); | 1636 ASSERT(BitCast<uint64_t>(OS::nan_value()) != kHoleNanInt64); |
1631 ASSERT((BitCast<uint64_t>(OS::nan_value()) >> 32) != kHoleNanUpper32); | 1637 ASSERT((BitCast<uint64_t>(OS::nan_value()) >> 32) != kHoleNanUpper32); |
1632 return OS::nan_value(); | 1638 return OS::nan_value(); |
1633 } | 1639 } |
1634 | 1640 |
1635 | 1641 |
1636 double FixedDoubleArray::get(int index) { | 1642 double FixedDoubleArray::get_scalar(int index) { |
1637 ASSERT(map() != HEAP->fixed_cow_array_map() && | 1643 ASSERT(map() != HEAP->fixed_cow_array_map() && |
1638 map() != HEAP->fixed_array_map()); | 1644 map() != HEAP->fixed_array_map()); |
1639 ASSERT(index >= 0 && index < this->length()); | 1645 ASSERT(index >= 0 && index < this->length()); |
1640 double result = READ_DOUBLE_FIELD(this, kHeaderSize + index * kDoubleSize); | 1646 double result = READ_DOUBLE_FIELD(this, kHeaderSize + index * kDoubleSize); |
1641 ASSERT(!is_the_hole_nan(result)); | 1647 ASSERT(!is_the_hole_nan(result)); |
1642 return result; | 1648 return result; |
1643 } | 1649 } |
1644 | 1650 |
1645 | 1651 |
1652 MaybeObject* FixedDoubleArray::get(int index) { | |
1653 if (is_the_hole(index)) { | |
1654 return GetHeap()->the_hole_value(); | |
1655 } else { | |
1656 return GetHeap()->NumberFromDouble(get_scalar(index)); | |
1657 } | |
1658 } | |
1659 | |
1660 | |
1646 void FixedDoubleArray::set(int index, double value) { | 1661 void FixedDoubleArray::set(int index, double value) { |
1647 ASSERT(map() != HEAP->fixed_cow_array_map() && | 1662 ASSERT(map() != HEAP->fixed_cow_array_map() && |
1648 map() != HEAP->fixed_array_map()); | 1663 map() != HEAP->fixed_array_map()); |
1649 int offset = kHeaderSize + index * kDoubleSize; | 1664 int offset = kHeaderSize + index * kDoubleSize; |
1650 if (isnan(value)) value = canonical_not_the_hole_nan_as_double(); | 1665 if (isnan(value)) value = canonical_not_the_hole_nan_as_double(); |
1651 WRITE_DOUBLE_FIELD(this, offset, value); | 1666 WRITE_DOUBLE_FIELD(this, offset, value); |
1652 } | 1667 } |
1653 | 1668 |
1654 | 1669 |
1655 void FixedDoubleArray::set_the_hole(int index) { | 1670 void FixedDoubleArray::set_the_hole(int index) { |
1656 ASSERT(map() != HEAP->fixed_cow_array_map() && | 1671 ASSERT(map() != HEAP->fixed_cow_array_map() && |
1657 map() != HEAP->fixed_array_map()); | 1672 map() != HEAP->fixed_array_map()); |
1658 int offset = kHeaderSize + index * kDoubleSize; | 1673 int offset = kHeaderSize + index * kDoubleSize; |
1659 WRITE_DOUBLE_FIELD(this, offset, hole_nan_as_double()); | 1674 WRITE_DOUBLE_FIELD(this, offset, hole_nan_as_double()); |
1660 } | 1675 } |
1661 | 1676 |
1662 | 1677 |
1663 bool FixedDoubleArray::is_the_hole(int index) { | 1678 bool FixedDoubleArray::is_the_hole(int index) { |
1664 int offset = kHeaderSize + index * kDoubleSize; | 1679 int offset = kHeaderSize + index * kDoubleSize; |
1665 return is_the_hole_nan(READ_DOUBLE_FIELD(this, offset)); | 1680 return is_the_hole_nan(READ_DOUBLE_FIELD(this, offset)); |
Lasse Reichstein
2011/08/01 09:35:54
Probably stupid question, but can this read be una
danno
2011/08/02 13:37:46
Good question. I think not, since the (header) map
Lasse Reichstein
2011/08/02 13:59:58
I don't think that helps, since objects are pointe
| |
1666 } | 1681 } |
1667 | 1682 |
1668 | 1683 |
1669 void FixedDoubleArray::Initialize(FixedDoubleArray* from) { | 1684 void FixedDoubleArray::Initialize(FixedDoubleArray* from) { |
1670 int old_length = from->length(); | 1685 int old_length = from->length(); |
1671 ASSERT(old_length < length()); | 1686 ASSERT(old_length < length()); |
1672 OS::MemCopy(FIELD_ADDR(this, kHeaderSize), | 1687 OS::MemCopy(FIELD_ADDR(this, kHeaderSize), |
1673 FIELD_ADDR(from, kHeaderSize), | 1688 FIELD_ADDR(from, kHeaderSize), |
1674 old_length * kDoubleSize); | 1689 old_length * kDoubleSize); |
1675 int offset = kHeaderSize + old_length * kDoubleSize; | 1690 int offset = kHeaderSize + old_length * kDoubleSize; |
(...skipping 684 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2360 Address ByteArray::GetDataStartAddress() { | 2375 Address ByteArray::GetDataStartAddress() { |
2361 return reinterpret_cast<Address>(this) - kHeapObjectTag + kHeaderSize; | 2376 return reinterpret_cast<Address>(this) - kHeapObjectTag + kHeaderSize; |
2362 } | 2377 } |
2363 | 2378 |
2364 | 2379 |
2365 uint8_t* ExternalPixelArray::external_pixel_pointer() { | 2380 uint8_t* ExternalPixelArray::external_pixel_pointer() { |
2366 return reinterpret_cast<uint8_t*>(external_pointer()); | 2381 return reinterpret_cast<uint8_t*>(external_pointer()); |
2367 } | 2382 } |
2368 | 2383 |
2369 | 2384 |
2370 uint8_t ExternalPixelArray::get(int index) { | 2385 uint8_t ExternalPixelArray::get_scalar(int index) { |
2371 ASSERT((index >= 0) && (index < this->length())); | 2386 ASSERT((index >= 0) && (index < this->length())); |
2372 uint8_t* ptr = external_pixel_pointer(); | 2387 uint8_t* ptr = external_pixel_pointer(); |
2373 return ptr[index]; | 2388 return ptr[index]; |
2374 } | 2389 } |
2375 | 2390 |
2376 | 2391 |
2392 MaybeObject* ExternalPixelArray::get(int index) { | |
2393 return Smi::FromInt(static_cast<int>(get_scalar(index))); | |
2394 } | |
2395 | |
2396 | |
2377 void ExternalPixelArray::set(int index, uint8_t value) { | 2397 void ExternalPixelArray::set(int index, uint8_t value) { |
2378 ASSERT((index >= 0) && (index < this->length())); | 2398 ASSERT((index >= 0) && (index < this->length())); |
2379 uint8_t* ptr = external_pixel_pointer(); | 2399 uint8_t* ptr = external_pixel_pointer(); |
2380 ptr[index] = value; | 2400 ptr[index] = value; |
2381 } | 2401 } |
2382 | 2402 |
2383 | 2403 |
2384 void* ExternalArray::external_pointer() { | 2404 void* ExternalArray::external_pointer() { |
2385 intptr_t ptr = READ_INTPTR_FIELD(this, kExternalPointerOffset); | 2405 intptr_t ptr = READ_INTPTR_FIELD(this, kExternalPointerOffset); |
2386 return reinterpret_cast<void*>(ptr); | 2406 return reinterpret_cast<void*>(ptr); |
2387 } | 2407 } |
2388 | 2408 |
2389 | 2409 |
2390 void ExternalArray::set_external_pointer(void* value, WriteBarrierMode mode) { | 2410 void ExternalArray::set_external_pointer(void* value, WriteBarrierMode mode) { |
2391 intptr_t ptr = reinterpret_cast<intptr_t>(value); | 2411 intptr_t ptr = reinterpret_cast<intptr_t>(value); |
2392 WRITE_INTPTR_FIELD(this, kExternalPointerOffset, ptr); | 2412 WRITE_INTPTR_FIELD(this, kExternalPointerOffset, ptr); |
2393 } | 2413 } |
2394 | 2414 |
2395 | 2415 |
2396 int8_t ExternalByteArray::get(int index) { | 2416 int8_t ExternalByteArray::get_scalar(int index) { |
2397 ASSERT((index >= 0) && (index < this->length())); | 2417 ASSERT((index >= 0) && (index < this->length())); |
2398 int8_t* ptr = static_cast<int8_t*>(external_pointer()); | 2418 int8_t* ptr = static_cast<int8_t*>(external_pointer()); |
2399 return ptr[index]; | 2419 return ptr[index]; |
2400 } | 2420 } |
2401 | 2421 |
2402 | 2422 |
2423 MaybeObject* ExternalByteArray::get(int index) { | |
2424 return Smi::FromInt(static_cast<int>(get_scalar(index))); | |
2425 } | |
2426 | |
2427 | |
2403 void ExternalByteArray::set(int index, int8_t value) { | 2428 void ExternalByteArray::set(int index, int8_t value) { |
2404 ASSERT((index >= 0) && (index < this->length())); | 2429 ASSERT((index >= 0) && (index < this->length())); |
2405 int8_t* ptr = static_cast<int8_t*>(external_pointer()); | 2430 int8_t* ptr = static_cast<int8_t*>(external_pointer()); |
2406 ptr[index] = value; | 2431 ptr[index] = value; |
2407 } | 2432 } |
2408 | 2433 |
2409 | 2434 |
2410 uint8_t ExternalUnsignedByteArray::get(int index) { | 2435 uint8_t ExternalUnsignedByteArray::get_scalar(int index) { |
2411 ASSERT((index >= 0) && (index < this->length())); | 2436 ASSERT((index >= 0) && (index < this->length())); |
2412 uint8_t* ptr = static_cast<uint8_t*>(external_pointer()); | 2437 uint8_t* ptr = static_cast<uint8_t*>(external_pointer()); |
2413 return ptr[index]; | 2438 return ptr[index]; |
2414 } | 2439 } |
2415 | 2440 |
2416 | 2441 |
2442 MaybeObject* ExternalUnsignedByteArray::get(int index) { | |
2443 return Smi::FromInt(static_cast<int>(get_scalar(index))); | |
2444 } | |
2445 | |
2446 | |
2417 void ExternalUnsignedByteArray::set(int index, uint8_t value) { | 2447 void ExternalUnsignedByteArray::set(int index, uint8_t value) { |
2418 ASSERT((index >= 0) && (index < this->length())); | 2448 ASSERT((index >= 0) && (index < this->length())); |
2419 uint8_t* ptr = static_cast<uint8_t*>(external_pointer()); | 2449 uint8_t* ptr = static_cast<uint8_t*>(external_pointer()); |
2420 ptr[index] = value; | 2450 ptr[index] = value; |
2421 } | 2451 } |
2422 | 2452 |
2423 | 2453 |
2424 int16_t ExternalShortArray::get(int index) { | 2454 int16_t ExternalShortArray::get_scalar(int index) { |
2425 ASSERT((index >= 0) && (index < this->length())); | 2455 ASSERT((index >= 0) && (index < this->length())); |
2426 int16_t* ptr = static_cast<int16_t*>(external_pointer()); | 2456 int16_t* ptr = static_cast<int16_t*>(external_pointer()); |
2427 return ptr[index]; | 2457 return ptr[index]; |
2428 } | 2458 } |
2429 | 2459 |
2430 | 2460 |
2461 MaybeObject* ExternalShortArray::get(int index) { | |
2462 return Smi::FromInt(static_cast<int>(get_scalar(index))); | |
2463 } | |
2464 | |
2465 | |
2431 void ExternalShortArray::set(int index, int16_t value) { | 2466 void ExternalShortArray::set(int index, int16_t value) { |
2432 ASSERT((index >= 0) && (index < this->length())); | 2467 ASSERT((index >= 0) && (index < this->length())); |
2433 int16_t* ptr = static_cast<int16_t*>(external_pointer()); | 2468 int16_t* ptr = static_cast<int16_t*>(external_pointer()); |
2434 ptr[index] = value; | 2469 ptr[index] = value; |
2435 } | 2470 } |
2436 | 2471 |
2437 | 2472 |
2438 uint16_t ExternalUnsignedShortArray::get(int index) { | 2473 uint16_t ExternalUnsignedShortArray::get_scalar(int index) { |
2439 ASSERT((index >= 0) && (index < this->length())); | 2474 ASSERT((index >= 0) && (index < this->length())); |
2440 uint16_t* ptr = static_cast<uint16_t*>(external_pointer()); | 2475 uint16_t* ptr = static_cast<uint16_t*>(external_pointer()); |
2441 return ptr[index]; | 2476 return ptr[index]; |
2442 } | 2477 } |
2443 | 2478 |
2444 | 2479 |
2480 MaybeObject* ExternalUnsignedShortArray::get(int index) { | |
2481 return Smi::FromInt(static_cast<int>(get_scalar(index))); | |
2482 } | |
2483 | |
2484 | |
2445 void ExternalUnsignedShortArray::set(int index, uint16_t value) { | 2485 void ExternalUnsignedShortArray::set(int index, uint16_t value) { |
2446 ASSERT((index >= 0) && (index < this->length())); | 2486 ASSERT((index >= 0) && (index < this->length())); |
2447 uint16_t* ptr = static_cast<uint16_t*>(external_pointer()); | 2487 uint16_t* ptr = static_cast<uint16_t*>(external_pointer()); |
2448 ptr[index] = value; | 2488 ptr[index] = value; |
2449 } | 2489 } |
2450 | 2490 |
2451 | 2491 |
2452 int32_t ExternalIntArray::get(int index) { | 2492 int32_t ExternalIntArray::get_scalar(int index) { |
2453 ASSERT((index >= 0) && (index < this->length())); | 2493 ASSERT((index >= 0) && (index < this->length())); |
2454 int32_t* ptr = static_cast<int32_t*>(external_pointer()); | 2494 int32_t* ptr = static_cast<int32_t*>(external_pointer()); |
2455 return ptr[index]; | 2495 return ptr[index]; |
2456 } | 2496 } |
2457 | 2497 |
2458 | 2498 |
2499 MaybeObject* ExternalIntArray::get(int index) { | |
2500 return GetHeap()->NumberFromInt32(get_scalar(index)); | |
2501 } | |
2502 | |
2503 | |
2459 void ExternalIntArray::set(int index, int32_t value) { | 2504 void ExternalIntArray::set(int index, int32_t value) { |
2460 ASSERT((index >= 0) && (index < this->length())); | 2505 ASSERT((index >= 0) && (index < this->length())); |
2461 int32_t* ptr = static_cast<int32_t*>(external_pointer()); | 2506 int32_t* ptr = static_cast<int32_t*>(external_pointer()); |
2462 ptr[index] = value; | 2507 ptr[index] = value; |
2463 } | 2508 } |
2464 | 2509 |
2465 | 2510 |
2466 uint32_t ExternalUnsignedIntArray::get(int index) { | 2511 uint32_t ExternalUnsignedIntArray::get_scalar(int index) { |
2467 ASSERT((index >= 0) && (index < this->length())); | 2512 ASSERT((index >= 0) && (index < this->length())); |
2468 uint32_t* ptr = static_cast<uint32_t*>(external_pointer()); | 2513 uint32_t* ptr = static_cast<uint32_t*>(external_pointer()); |
2469 return ptr[index]; | 2514 return ptr[index]; |
2470 } | 2515 } |
2471 | 2516 |
2472 | 2517 |
2518 MaybeObject* ExternalUnsignedIntArray::get(int index) { | |
2519 return GetHeap()->NumberFromUint32(get_scalar(index)); | |
2520 } | |
2521 | |
2522 | |
2473 void ExternalUnsignedIntArray::set(int index, uint32_t value) { | 2523 void ExternalUnsignedIntArray::set(int index, uint32_t value) { |
2474 ASSERT((index >= 0) && (index < this->length())); | 2524 ASSERT((index >= 0) && (index < this->length())); |
2475 uint32_t* ptr = static_cast<uint32_t*>(external_pointer()); | 2525 uint32_t* ptr = static_cast<uint32_t*>(external_pointer()); |
2476 ptr[index] = value; | 2526 ptr[index] = value; |
2477 } | 2527 } |
2478 | 2528 |
2479 | 2529 |
2480 float ExternalFloatArray::get(int index) { | 2530 float ExternalFloatArray::get_scalar(int index) { |
2481 ASSERT((index >= 0) && (index < this->length())); | 2531 ASSERT((index >= 0) && (index < this->length())); |
2482 float* ptr = static_cast<float*>(external_pointer()); | 2532 float* ptr = static_cast<float*>(external_pointer()); |
2483 return ptr[index]; | 2533 return ptr[index]; |
2484 } | 2534 } |
2485 | 2535 |
2486 | 2536 |
2537 MaybeObject* ExternalFloatArray::get(int index) { | |
2538 return GetHeap()->NumberFromDouble(get_scalar(index)); | |
2539 } | |
2540 | |
2541 | |
2487 void ExternalFloatArray::set(int index, float value) { | 2542 void ExternalFloatArray::set(int index, float value) { |
2488 ASSERT((index >= 0) && (index < this->length())); | 2543 ASSERT((index >= 0) && (index < this->length())); |
2489 float* ptr = static_cast<float*>(external_pointer()); | 2544 float* ptr = static_cast<float*>(external_pointer()); |
2490 ptr[index] = value; | 2545 ptr[index] = value; |
2491 } | 2546 } |
2492 | 2547 |
2493 | 2548 |
2494 double ExternalDoubleArray::get(int index) { | 2549 double ExternalDoubleArray::get_scalar(int index) { |
2495 ASSERT((index >= 0) && (index < this->length())); | 2550 ASSERT((index >= 0) && (index < this->length())); |
2496 double* ptr = static_cast<double*>(external_pointer()); | 2551 double* ptr = static_cast<double*>(external_pointer()); |
2497 return ptr[index]; | 2552 return ptr[index]; |
2498 } | 2553 } |
2499 | 2554 |
2500 | 2555 |
2556 MaybeObject* ExternalDoubleArray::get(int index) { | |
2557 return GetHeap()->NumberFromDouble(get_scalar(index)); | |
2558 } | |
2559 | |
2560 | |
2501 void ExternalDoubleArray::set(int index, double value) { | 2561 void ExternalDoubleArray::set(int index, double value) { |
2502 ASSERT((index >= 0) && (index < this->length())); | 2562 ASSERT((index >= 0) && (index < this->length())); |
2503 double* ptr = static_cast<double*>(external_pointer()); | 2563 double* ptr = static_cast<double*>(external_pointer()); |
2504 ptr[index] = value; | 2564 ptr[index] = value; |
2505 } | 2565 } |
2506 | 2566 |
2507 | 2567 |
2508 int Map::visitor_id() { | 2568 int Map::visitor_id() { |
2509 return READ_BYTE_FIELD(this, kVisitorIdOffset); | 2569 return READ_BYTE_FIELD(this, kVisitorIdOffset); |
2510 } | 2570 } |
(...skipping 1461 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3972 (kind == FAST_DOUBLE_ELEMENTS && | 4032 (kind == FAST_DOUBLE_ELEMENTS && |
3973 elements()->IsFixedDoubleArray()) || | 4033 elements()->IsFixedDoubleArray()) || |
3974 (kind == DICTIONARY_ELEMENTS && | 4034 (kind == DICTIONARY_ELEMENTS && |
3975 elements()->IsFixedArray() && | 4035 elements()->IsFixedArray() && |
3976 elements()->IsDictionary()) || | 4036 elements()->IsDictionary()) || |
3977 (kind > DICTIONARY_ELEMENTS)); | 4037 (kind > DICTIONARY_ELEMENTS)); |
3978 return kind; | 4038 return kind; |
3979 } | 4039 } |
3980 | 4040 |
3981 | 4041 |
4042 ElementsHandler* JSObject::GetElementsHandler() { | |
4043 return ElementsHandler::ForKind(GetElementsKind()); | |
4044 } | |
4045 | |
4046 | |
3982 bool JSObject::HasFastElements() { | 4047 bool JSObject::HasFastElements() { |
3983 return GetElementsKind() == FAST_ELEMENTS; | 4048 return GetElementsKind() == FAST_ELEMENTS; |
3984 } | 4049 } |
3985 | 4050 |
3986 | 4051 |
3987 bool JSObject::HasFastDoubleElements() { | 4052 bool JSObject::HasFastDoubleElements() { |
3988 return GetElementsKind() == FAST_DOUBLE_ELEMENTS; | 4053 return GetElementsKind() == FAST_DOUBLE_ELEMENTS; |
3989 } | 4054 } |
3990 | 4055 |
3991 | 4056 |
(...skipping 549 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
4541 #undef WRITE_INT_FIELD | 4606 #undef WRITE_INT_FIELD |
4542 #undef READ_SHORT_FIELD | 4607 #undef READ_SHORT_FIELD |
4543 #undef WRITE_SHORT_FIELD | 4608 #undef WRITE_SHORT_FIELD |
4544 #undef READ_BYTE_FIELD | 4609 #undef READ_BYTE_FIELD |
4545 #undef WRITE_BYTE_FIELD | 4610 #undef WRITE_BYTE_FIELD |
4546 | 4611 |
4547 | 4612 |
4548 } } // namespace v8::internal | 4613 } } // namespace v8::internal |
4549 | 4614 |
4550 #endif // V8_OBJECTS_INL_H_ | 4615 #endif // V8_OBJECTS_INL_H_ |
OLD | NEW |