| 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 742 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 753 | 753 |
| 754 | 754 |
| 755 bool Object::IsDependentCode() { | 755 bool Object::IsDependentCode() { |
| 756 if (!IsFixedArray()) return false; | 756 if (!IsFixedArray()) return false; |
| 757 // There's actually no way to see the difference between a fixed array and | 757 // There's actually no way to see the difference between a fixed array and |
| 758 // a dependent codes array. | 758 // a dependent codes array. |
| 759 return true; | 759 return true; |
| 760 } | 760 } |
| 761 | 761 |
| 762 | 762 |
| 763 bool Object::IsTypeFeedbackCells() { | |
| 764 if (!IsFixedArray()) return false; | |
| 765 // There's actually no way to see the difference between a fixed array and | |
| 766 // a cache cells array. Since this is used for asserts we can check that | |
| 767 // the length is plausible though. | |
| 768 if (FixedArray::cast(this)->length() % 2 != 0) return false; | |
| 769 return true; | |
| 770 } | |
| 771 | |
| 772 | |
| 773 bool Object::IsContext() { | 763 bool Object::IsContext() { |
| 774 if (!Object::IsHeapObject()) return false; | 764 if (!Object::IsHeapObject()) return false; |
| 775 Map* map = HeapObject::cast(this)->map(); | 765 Map* map = HeapObject::cast(this)->map(); |
| 776 Heap* heap = map->GetHeap(); | 766 Heap* heap = map->GetHeap(); |
| 777 return (map == heap->function_context_map() || | 767 return (map == heap->function_context_map() || |
| 778 map == heap->catch_context_map() || | 768 map == heap->catch_context_map() || |
| 779 map == heap->with_context_map() || | 769 map == heap->with_context_map() || |
| 780 map == heap->native_context_map() || | 770 map == heap->native_context_map() || |
| 781 map == heap->block_context_map() || | 771 map == heap->block_context_map() || |
| 782 map == heap->module_context_map() || | 772 map == heap->module_context_map() || |
| (...skipping 2001 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2784 | 2774 |
| 2785 | 2775 |
| 2786 CAST_ACCESSOR(FixedArray) | 2776 CAST_ACCESSOR(FixedArray) |
| 2787 CAST_ACCESSOR(FixedDoubleArray) | 2777 CAST_ACCESSOR(FixedDoubleArray) |
| 2788 CAST_ACCESSOR(FixedTypedArrayBase) | 2778 CAST_ACCESSOR(FixedTypedArrayBase) |
| 2789 CAST_ACCESSOR(ConstantPoolArray) | 2779 CAST_ACCESSOR(ConstantPoolArray) |
| 2790 CAST_ACCESSOR(DescriptorArray) | 2780 CAST_ACCESSOR(DescriptorArray) |
| 2791 CAST_ACCESSOR(DeoptimizationInputData) | 2781 CAST_ACCESSOR(DeoptimizationInputData) |
| 2792 CAST_ACCESSOR(DeoptimizationOutputData) | 2782 CAST_ACCESSOR(DeoptimizationOutputData) |
| 2793 CAST_ACCESSOR(DependentCode) | 2783 CAST_ACCESSOR(DependentCode) |
| 2794 CAST_ACCESSOR(TypeFeedbackCells) | |
| 2795 CAST_ACCESSOR(StringTable) | 2784 CAST_ACCESSOR(StringTable) |
| 2796 CAST_ACCESSOR(JSFunctionResultCache) | 2785 CAST_ACCESSOR(JSFunctionResultCache) |
| 2797 CAST_ACCESSOR(NormalizedMapCache) | 2786 CAST_ACCESSOR(NormalizedMapCache) |
| 2798 CAST_ACCESSOR(ScopeInfo) | 2787 CAST_ACCESSOR(ScopeInfo) |
| 2799 CAST_ACCESSOR(CompilationCacheTable) | 2788 CAST_ACCESSOR(CompilationCacheTable) |
| 2800 CAST_ACCESSOR(CodeCacheHashTable) | 2789 CAST_ACCESSOR(CodeCacheHashTable) |
| 2801 CAST_ACCESSOR(PolymorphicCodeCacheHashTable) | 2790 CAST_ACCESSOR(PolymorphicCodeCacheHashTable) |
| 2802 CAST_ACCESSOR(MapCache) | 2791 CAST_ACCESSOR(MapCache) |
| 2803 CAST_ACCESSOR(String) | 2792 CAST_ACCESSOR(String) |
| 2804 CAST_ACCESSOR(SeqString) | 2793 CAST_ACCESSOR(SeqString) |
| (...skipping 3748 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6553 return GetHeap()->CopyFixedDoubleArray(this); | 6542 return GetHeap()->CopyFixedDoubleArray(this); |
| 6554 } | 6543 } |
| 6555 | 6544 |
| 6556 | 6545 |
| 6557 MaybeObject* ConstantPoolArray::Copy() { | 6546 MaybeObject* ConstantPoolArray::Copy() { |
| 6558 if (length() == 0) return this; | 6547 if (length() == 0) return this; |
| 6559 return GetHeap()->CopyConstantPoolArray(this); | 6548 return GetHeap()->CopyConstantPoolArray(this); |
| 6560 } | 6549 } |
| 6561 | 6550 |
| 6562 | 6551 |
| 6563 void TypeFeedbackCells::SetAstId(int index, TypeFeedbackId id) { | 6552 Handle<Object> TypeFeedbackInfo::UninitializedSentinel(Isolate* isolate) { |
| 6564 set(1 + index * 2, Smi::FromInt(id.ToInt())); | |
| 6565 } | |
| 6566 | |
| 6567 | |
| 6568 TypeFeedbackId TypeFeedbackCells::AstId(int index) { | |
| 6569 return TypeFeedbackId(Smi::cast(get(1 + index * 2))->value()); | |
| 6570 } | |
| 6571 | |
| 6572 | |
| 6573 void TypeFeedbackCells::SetCell(int index, Cell* cell) { | |
| 6574 set(index * 2, cell); | |
| 6575 } | |
| 6576 | |
| 6577 | |
| 6578 Cell* TypeFeedbackCells::GetCell(int index) { | |
| 6579 return Cell::cast(get(index * 2)); | |
| 6580 } | |
| 6581 | |
| 6582 | |
| 6583 Handle<Object> TypeFeedbackCells::UninitializedSentinel(Isolate* isolate) { | |
| 6584 return isolate->factory()->the_hole_value(); | 6553 return isolate->factory()->the_hole_value(); |
| 6585 } | 6554 } |
| 6586 | 6555 |
| 6587 | 6556 |
| 6588 Handle<Object> TypeFeedbackCells::MegamorphicSentinel(Isolate* isolate) { | 6557 Handle<Object> TypeFeedbackInfo::MegamorphicSentinel(Isolate* isolate) { |
| 6589 return isolate->factory()->undefined_value(); | 6558 return isolate->factory()->undefined_value(); |
| 6590 } | 6559 } |
| 6591 | 6560 |
| 6592 | 6561 |
| 6593 Handle<Object> TypeFeedbackCells::MonomorphicArraySentinel(Isolate* isolate, | 6562 Handle<Object> TypeFeedbackInfo::MonomorphicArraySentinel(Isolate* isolate, |
| 6594 ElementsKind elements_kind) { | 6563 ElementsKind elements_kind) { |
| 6595 return Handle<Object>(Smi::FromInt(static_cast<int>(elements_kind)), isolate); | 6564 return Handle<Object>(Smi::FromInt(static_cast<int>(elements_kind)), isolate); |
| 6596 } | 6565 } |
| 6597 | 6566 |
| 6598 | 6567 |
| 6599 Object* TypeFeedbackCells::RawUninitializedSentinel(Heap* heap) { | 6568 Object* TypeFeedbackInfo::RawUninitializedSentinel(Heap* heap) { |
| 6600 return heap->the_hole_value(); | 6569 return heap->the_hole_value(); |
| 6601 } | 6570 } |
| 6602 | 6571 |
| 6603 | 6572 |
| 6604 int TypeFeedbackInfo::ic_total_count() { | 6573 int TypeFeedbackInfo::ic_total_count() { |
| 6605 int current = Smi::cast(READ_FIELD(this, kStorage1Offset))->value(); | 6574 int current = Smi::cast(READ_FIELD(this, kStorage1Offset))->value(); |
| 6606 return ICTotalCountField::decode(current); | 6575 return ICTotalCountField::decode(current); |
| 6607 } | 6576 } |
| 6608 | 6577 |
| 6609 | 6578 |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6672 } | 6641 } |
| 6673 | 6642 |
| 6674 | 6643 |
| 6675 bool TypeFeedbackInfo::matches_inlined_type_change_checksum(int checksum) { | 6644 bool TypeFeedbackInfo::matches_inlined_type_change_checksum(int checksum) { |
| 6676 int value = Smi::cast(READ_FIELD(this, kStorage2Offset))->value(); | 6645 int value = Smi::cast(READ_FIELD(this, kStorage2Offset))->value(); |
| 6677 int mask = (1 << kTypeChangeChecksumBits) - 1; | 6646 int mask = (1 << kTypeChangeChecksumBits) - 1; |
| 6678 return InlinedTypeChangeChecksum::decode(value) == (checksum & mask); | 6647 return InlinedTypeChangeChecksum::decode(value) == (checksum & mask); |
| 6679 } | 6648 } |
| 6680 | 6649 |
| 6681 | 6650 |
| 6682 ACCESSORS(TypeFeedbackInfo, type_feedback_cells, TypeFeedbackCells, | 6651 ACCESSORS(TypeFeedbackInfo, feedback_vector, FixedArray, |
| 6683 kTypeFeedbackCellsOffset) | 6652 kFeedbackVectorOffset) |
| 6684 | 6653 |
| 6685 | 6654 |
| 6686 SMI_ACCESSORS(AliasedArgumentsEntry, aliased_context_slot, kAliasedContextSlot) | 6655 SMI_ACCESSORS(AliasedArgumentsEntry, aliased_context_slot, kAliasedContextSlot) |
| 6687 | 6656 |
| 6688 | 6657 |
| 6689 Relocatable::Relocatable(Isolate* isolate) { | 6658 Relocatable::Relocatable(Isolate* isolate) { |
| 6690 isolate_ = isolate; | 6659 isolate_ = isolate; |
| 6691 prev_ = isolate->relocatable_top(); | 6660 prev_ = isolate->relocatable_top(); |
| 6692 isolate->set_relocatable_top(this); | 6661 isolate->set_relocatable_top(this); |
| 6693 } | 6662 } |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6787 #undef READ_UINT32_FIELD | 6756 #undef READ_UINT32_FIELD |
| 6788 #undef WRITE_UINT32_FIELD | 6757 #undef WRITE_UINT32_FIELD |
| 6789 #undef READ_SHORT_FIELD | 6758 #undef READ_SHORT_FIELD |
| 6790 #undef WRITE_SHORT_FIELD | 6759 #undef WRITE_SHORT_FIELD |
| 6791 #undef READ_BYTE_FIELD | 6760 #undef READ_BYTE_FIELD |
| 6792 #undef WRITE_BYTE_FIELD | 6761 #undef WRITE_BYTE_FIELD |
| 6793 | 6762 |
| 6794 } } // namespace v8::internal | 6763 } } // namespace v8::internal |
| 6795 | 6764 |
| 6796 #endif // V8_OBJECTS_INL_H_ | 6765 #endif // V8_OBJECTS_INL_H_ |
| OLD | NEW |