| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 // | 4 // |
| 5 // Review notes: | 5 // Review notes: |
| 6 // | 6 // |
| 7 // - The use of macros in these inline functions may seem superfluous | 7 // - The use of macros in these inline functions may seem superfluous |
| 8 // but it is absolutely needed to make sure gcc generates optimal | 8 // but it is absolutely needed to make sure gcc generates optimal |
| 9 // code. gcc is not happy when attempting to inline too deep. | 9 // code. gcc is not happy when attempting to inline too deep. |
| 10 // | 10 // |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 79 | 79 |
| 80 | 80 |
| 81 #define ACCESSORS(holder, name, type, offset) \ | 81 #define ACCESSORS(holder, name, type, offset) \ |
| 82 type* holder::name() const { return type::cast(READ_FIELD(this, offset)); } \ | 82 type* holder::name() const { return type::cast(READ_FIELD(this, offset)); } \ |
| 83 void holder::set_##name(type* value, WriteBarrierMode mode) { \ | 83 void holder::set_##name(type* value, WriteBarrierMode mode) { \ |
| 84 WRITE_FIELD(this, offset, value); \ | 84 WRITE_FIELD(this, offset, value); \ |
| 85 CONDITIONAL_WRITE_BARRIER(GetHeap(), this, offset, value, mode); \ | 85 CONDITIONAL_WRITE_BARRIER(GetHeap(), this, offset, value, mode); \ |
| 86 } | 86 } |
| 87 | 87 |
| 88 | 88 |
| 89 // Getter that returns a tagged Smi and setter that writes a tagged Smi. | |
| 90 #define ACCESSORS_TO_SMI(holder, name, offset) \ | |
| 91 Smi* holder::name() const { return Smi::cast(READ_FIELD(this, offset)); } \ | |
| 92 void holder::set_##name(Smi* value, WriteBarrierMode mode) { \ | |
| 93 WRITE_FIELD(this, offset, value); \ | |
| 94 } | |
| 95 | |
| 96 | |
| 97 // Getter that returns a Smi as an int and writes an int as a Smi. | 89 // Getter that returns a Smi as an int and writes an int as a Smi. |
| 98 #define SMI_ACCESSORS(holder, name, offset) \ | 90 #define SMI_ACCESSORS(holder, name, offset) \ |
| 99 int holder::name() const { \ | 91 int holder::name() const { \ |
| 100 Object* value = READ_FIELD(this, offset); \ | 92 Object* value = READ_FIELD(this, offset); \ |
| 101 return Smi::cast(value)->value(); \ | 93 return Smi::cast(value)->value(); \ |
| 102 } \ | 94 } \ |
| 103 void holder::set_##name(int value) { \ | 95 void holder::set_##name(int value) { \ |
| 104 WRITE_FIELD(this, offset, Smi::FromInt(value)); \ | 96 WRITE_FIELD(this, offset, Smi::FromInt(value)); \ |
| 105 } | 97 } |
| 106 | 98 |
| (...skipping 1569 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1676 FixedArrayBase* JSObject::elements() const { | 1668 FixedArrayBase* JSObject::elements() const { |
| 1677 Object* array = READ_FIELD(this, kElementsOffset); | 1669 Object* array = READ_FIELD(this, kElementsOffset); |
| 1678 return static_cast<FixedArrayBase*>(array); | 1670 return static_cast<FixedArrayBase*>(array); |
| 1679 } | 1671 } |
| 1680 | 1672 |
| 1681 | 1673 |
| 1682 void AllocationSite::Initialize() { | 1674 void AllocationSite::Initialize() { |
| 1683 set_transition_info(Smi::FromInt(0)); | 1675 set_transition_info(Smi::FromInt(0)); |
| 1684 SetElementsKind(GetInitialFastElementsKind()); | 1676 SetElementsKind(GetInitialFastElementsKind()); |
| 1685 set_nested_site(Smi::FromInt(0)); | 1677 set_nested_site(Smi::FromInt(0)); |
| 1686 set_pretenure_data(Smi::FromInt(0)); | 1678 set_pretenure_data(0); |
| 1687 set_pretenure_create_count(Smi::FromInt(0)); | 1679 set_pretenure_create_count(0); |
| 1688 set_dependent_code(DependentCode::cast(GetHeap()->empty_fixed_array()), | 1680 set_dependent_code(DependentCode::cast(GetHeap()->empty_fixed_array()), |
| 1689 SKIP_WRITE_BARRIER); | 1681 SKIP_WRITE_BARRIER); |
| 1690 } | 1682 } |
| 1691 | 1683 |
| 1692 | 1684 |
| 1693 bool AllocationSite::IsZombie() { return pretenure_decision() == kZombie; } | 1685 bool AllocationSite::IsZombie() { return pretenure_decision() == kZombie; } |
| 1694 | 1686 |
| 1695 | 1687 |
| 1696 bool AllocationSite::IsMaybeTenure() { | 1688 bool AllocationSite::IsMaybeTenure() { |
| 1697 return pretenure_decision() == kMaybeTenure; | 1689 return pretenure_decision() == kMaybeTenure; |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1772 if (FLAG_allocation_site_pretenuring) { | 1764 if (FLAG_allocation_site_pretenuring) { |
| 1773 return type == JS_ARRAY_TYPE || | 1765 return type == JS_ARRAY_TYPE || |
| 1774 type == JS_OBJECT_TYPE || | 1766 type == JS_OBJECT_TYPE || |
| 1775 type < FIRST_NONSTRING_TYPE; | 1767 type < FIRST_NONSTRING_TYPE; |
| 1776 } | 1768 } |
| 1777 return type == JS_ARRAY_TYPE; | 1769 return type == JS_ARRAY_TYPE; |
| 1778 } | 1770 } |
| 1779 | 1771 |
| 1780 | 1772 |
| 1781 AllocationSite::PretenureDecision AllocationSite::pretenure_decision() { | 1773 AllocationSite::PretenureDecision AllocationSite::pretenure_decision() { |
| 1782 int value = pretenure_data()->value(); | 1774 int value = pretenure_data(); |
| 1783 return PretenureDecisionBits::decode(value); | 1775 return PretenureDecisionBits::decode(value); |
| 1784 } | 1776 } |
| 1785 | 1777 |
| 1786 | 1778 |
| 1787 void AllocationSite::set_pretenure_decision(PretenureDecision decision) { | 1779 void AllocationSite::set_pretenure_decision(PretenureDecision decision) { |
| 1788 int value = pretenure_data()->value(); | 1780 int value = pretenure_data(); |
| 1789 set_pretenure_data( | 1781 set_pretenure_data(PretenureDecisionBits::update(value, decision)); |
| 1790 Smi::FromInt(PretenureDecisionBits::update(value, decision)), | |
| 1791 SKIP_WRITE_BARRIER); | |
| 1792 } | 1782 } |
| 1793 | 1783 |
| 1794 | 1784 |
| 1795 bool AllocationSite::deopt_dependent_code() { | 1785 bool AllocationSite::deopt_dependent_code() { |
| 1796 int value = pretenure_data()->value(); | 1786 int value = pretenure_data(); |
| 1797 return DeoptDependentCodeBit::decode(value); | 1787 return DeoptDependentCodeBit::decode(value); |
| 1798 } | 1788 } |
| 1799 | 1789 |
| 1800 | 1790 |
| 1801 void AllocationSite::set_deopt_dependent_code(bool deopt) { | 1791 void AllocationSite::set_deopt_dependent_code(bool deopt) { |
| 1802 int value = pretenure_data()->value(); | 1792 int value = pretenure_data(); |
| 1803 set_pretenure_data(Smi::FromInt(DeoptDependentCodeBit::update(value, deopt)), | 1793 set_pretenure_data(DeoptDependentCodeBit::update(value, deopt)); |
| 1804 SKIP_WRITE_BARRIER); | |
| 1805 } | 1794 } |
| 1806 | 1795 |
| 1807 | 1796 |
| 1808 int AllocationSite::memento_found_count() { | 1797 int AllocationSite::memento_found_count() { |
| 1809 int value = pretenure_data()->value(); | 1798 int value = pretenure_data(); |
| 1810 return MementoFoundCountBits::decode(value); | 1799 return MementoFoundCountBits::decode(value); |
| 1811 } | 1800 } |
| 1812 | 1801 |
| 1813 | 1802 |
| 1814 inline void AllocationSite::set_memento_found_count(int count) { | 1803 inline void AllocationSite::set_memento_found_count(int count) { |
| 1815 int value = pretenure_data()->value(); | 1804 int value = pretenure_data(); |
| 1816 // Verify that we can count more mementos than we can possibly find in one | 1805 // Verify that we can count more mementos than we can possibly find in one |
| 1817 // new space collection. | 1806 // new space collection. |
| 1818 DCHECK((GetHeap()->MaxSemiSpaceSize() / | 1807 DCHECK((GetHeap()->MaxSemiSpaceSize() / |
| 1819 (Heap::kMinObjectSizeInWords * kPointerSize + | 1808 (Heap::kMinObjectSizeInWords * kPointerSize + |
| 1820 AllocationMemento::kSize)) < MementoFoundCountBits::kMax); | 1809 AllocationMemento::kSize)) < MementoFoundCountBits::kMax); |
| 1821 DCHECK(count < MementoFoundCountBits::kMax); | 1810 DCHECK(count < MementoFoundCountBits::kMax); |
| 1822 set_pretenure_data( | 1811 set_pretenure_data(MementoFoundCountBits::update(value, count)); |
| 1823 Smi::FromInt(MementoFoundCountBits::update(value, count)), | |
| 1824 SKIP_WRITE_BARRIER); | |
| 1825 } | 1812 } |
| 1826 | 1813 |
| 1827 | 1814 |
| 1828 int AllocationSite::memento_create_count() { | 1815 int AllocationSite::memento_create_count() { return pretenure_create_count(); } |
| 1829 return pretenure_create_count()->value(); | 1816 |
| 1817 |
| 1818 void AllocationSite::set_memento_create_count(int count) { |
| 1819 set_pretenure_create_count(count); |
| 1830 } | 1820 } |
| 1831 | 1821 |
| 1832 | 1822 |
| 1833 void AllocationSite::set_memento_create_count(int count) { | |
| 1834 set_pretenure_create_count(Smi::FromInt(count), SKIP_WRITE_BARRIER); | |
| 1835 } | |
| 1836 | |
| 1837 | |
| 1838 inline bool AllocationSite::IncrementMementoFoundCount() { | 1823 inline bool AllocationSite::IncrementMementoFoundCount() { |
| 1839 if (IsZombie()) return false; | 1824 if (IsZombie()) return false; |
| 1840 | 1825 |
| 1841 int value = memento_found_count(); | 1826 int value = memento_found_count(); |
| 1842 set_memento_found_count(value + 1); | 1827 set_memento_found_count(value + 1); |
| 1843 return memento_found_count() == kPretenureMinimumCreated; | 1828 return memento_found_count() == kPretenureMinimumCreated; |
| 1844 } | 1829 } |
| 1845 | 1830 |
| 1846 | 1831 |
| 1847 inline void AllocationSite::IncrementMementoCreateCount() { | 1832 inline void AllocationSite::IncrementMementoCreateCount() { |
| (...skipping 1763 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3611 if ((one->IsInternalizedString() && two->IsInternalizedString()) || | 3596 if ((one->IsInternalizedString() && two->IsInternalizedString()) || |
| 3612 one->IsSymbol() || two->IsSymbol()) { | 3597 one->IsSymbol() || two->IsSymbol()) { |
| 3613 return false; | 3598 return false; |
| 3614 } | 3599 } |
| 3615 return String::SlowEquals(Handle<String>::cast(one), | 3600 return String::SlowEquals(Handle<String>::cast(one), |
| 3616 Handle<String>::cast(two)); | 3601 Handle<String>::cast(two)); |
| 3617 } | 3602 } |
| 3618 | 3603 |
| 3619 | 3604 |
| 3620 ACCESSORS(Symbol, name, Object, kNameOffset) | 3605 ACCESSORS(Symbol, name, Object, kNameOffset) |
| 3621 ACCESSORS(Symbol, flags, Smi, kFlagsOffset) | 3606 SMI_ACCESSORS(Symbol, flags, kFlagsOffset) |
| 3622 BOOL_ACCESSORS(Symbol, flags, is_private, kPrivateBit) | 3607 BOOL_ACCESSORS(Symbol, flags, is_private, kPrivateBit) |
| 3623 | 3608 |
| 3624 | 3609 |
| 3625 bool String::Equals(String* other) { | 3610 bool String::Equals(String* other) { |
| 3626 if (other == this) return true; | 3611 if (other == this) return true; |
| 3627 if (this->IsInternalizedString() && other->IsInternalizedString()) { | 3612 if (this->IsInternalizedString() && other->IsInternalizedString()) { |
| 3628 return false; | 3613 return false; |
| 3629 } | 3614 } |
| 3630 return SlowEquals(other); | 3615 return SlowEquals(other); |
| 3631 } | 3616 } |
| (...skipping 1887 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5519 ACCESSORS(JSFunction, next_function_link, Object, kNextFunctionLinkOffset) | 5504 ACCESSORS(JSFunction, next_function_link, Object, kNextFunctionLinkOffset) |
| 5520 | 5505 |
| 5521 ACCESSORS(GlobalObject, builtins, JSBuiltinsObject, kBuiltinsOffset) | 5506 ACCESSORS(GlobalObject, builtins, JSBuiltinsObject, kBuiltinsOffset) |
| 5522 ACCESSORS(GlobalObject, native_context, Context, kNativeContextOffset) | 5507 ACCESSORS(GlobalObject, native_context, Context, kNativeContextOffset) |
| 5523 ACCESSORS(GlobalObject, global_proxy, JSObject, kGlobalProxyOffset) | 5508 ACCESSORS(GlobalObject, global_proxy, JSObject, kGlobalProxyOffset) |
| 5524 | 5509 |
| 5525 ACCESSORS(JSGlobalProxy, native_context, Object, kNativeContextOffset) | 5510 ACCESSORS(JSGlobalProxy, native_context, Object, kNativeContextOffset) |
| 5526 ACCESSORS(JSGlobalProxy, hash, Object, kHashOffset) | 5511 ACCESSORS(JSGlobalProxy, hash, Object, kHashOffset) |
| 5527 | 5512 |
| 5528 ACCESSORS(AccessorInfo, name, Object, kNameOffset) | 5513 ACCESSORS(AccessorInfo, name, Object, kNameOffset) |
| 5529 ACCESSORS_TO_SMI(AccessorInfo, flag, kFlagOffset) | 5514 SMI_ACCESSORS(AccessorInfo, flag, kFlagOffset) |
| 5530 ACCESSORS(AccessorInfo, expected_receiver_type, Object, | 5515 ACCESSORS(AccessorInfo, expected_receiver_type, Object, |
| 5531 kExpectedReceiverTypeOffset) | 5516 kExpectedReceiverTypeOffset) |
| 5532 | 5517 |
| 5533 ACCESSORS(ExecutableAccessorInfo, getter, Object, kGetterOffset) | 5518 ACCESSORS(ExecutableAccessorInfo, getter, Object, kGetterOffset) |
| 5534 ACCESSORS(ExecutableAccessorInfo, setter, Object, kSetterOffset) | 5519 ACCESSORS(ExecutableAccessorInfo, setter, Object, kSetterOffset) |
| 5535 ACCESSORS(ExecutableAccessorInfo, data, Object, kDataOffset) | 5520 ACCESSORS(ExecutableAccessorInfo, data, Object, kDataOffset) |
| 5536 | 5521 |
| 5537 ACCESSORS(Box, value, Object, kValueOffset) | 5522 ACCESSORS(Box, value, Object, kValueOffset) |
| 5538 | 5523 |
| 5539 ACCESSORS(PrototypeInfo, prototype_users, Object, kPrototypeUsersOffset) | 5524 ACCESSORS(PrototypeInfo, prototype_users, Object, kPrototypeUsersOffset) |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5583 ACCESSORS(FunctionTemplateInfo, indexed_property_handler, Object, | 5568 ACCESSORS(FunctionTemplateInfo, indexed_property_handler, Object, |
| 5584 kIndexedPropertyHandlerOffset) | 5569 kIndexedPropertyHandlerOffset) |
| 5585 ACCESSORS(FunctionTemplateInfo, instance_template, Object, | 5570 ACCESSORS(FunctionTemplateInfo, instance_template, Object, |
| 5586 kInstanceTemplateOffset) | 5571 kInstanceTemplateOffset) |
| 5587 ACCESSORS(FunctionTemplateInfo, class_name, Object, kClassNameOffset) | 5572 ACCESSORS(FunctionTemplateInfo, class_name, Object, kClassNameOffset) |
| 5588 ACCESSORS(FunctionTemplateInfo, signature, Object, kSignatureOffset) | 5573 ACCESSORS(FunctionTemplateInfo, signature, Object, kSignatureOffset) |
| 5589 ACCESSORS(FunctionTemplateInfo, instance_call_handler, Object, | 5574 ACCESSORS(FunctionTemplateInfo, instance_call_handler, Object, |
| 5590 kInstanceCallHandlerOffset) | 5575 kInstanceCallHandlerOffset) |
| 5591 ACCESSORS(FunctionTemplateInfo, access_check_info, Object, | 5576 ACCESSORS(FunctionTemplateInfo, access_check_info, Object, |
| 5592 kAccessCheckInfoOffset) | 5577 kAccessCheckInfoOffset) |
| 5593 ACCESSORS_TO_SMI(FunctionTemplateInfo, flag, kFlagOffset) | 5578 SMI_ACCESSORS(FunctionTemplateInfo, flag, kFlagOffset) |
| 5594 | 5579 |
| 5595 ACCESSORS(ObjectTemplateInfo, constructor, Object, kConstructorOffset) | 5580 ACCESSORS(ObjectTemplateInfo, constructor, Object, kConstructorOffset) |
| 5596 ACCESSORS(ObjectTemplateInfo, internal_field_count, Object, | 5581 ACCESSORS(ObjectTemplateInfo, internal_field_count, Object, |
| 5597 kInternalFieldCountOffset) | 5582 kInternalFieldCountOffset) |
| 5598 | 5583 |
| 5599 ACCESSORS(TypeSwitchInfo, types, Object, kTypesOffset) | 5584 ACCESSORS(TypeSwitchInfo, types, Object, kTypesOffset) |
| 5600 | 5585 |
| 5601 ACCESSORS(AllocationSite, transition_info, Object, kTransitionInfoOffset) | 5586 ACCESSORS(AllocationSite, transition_info, Object, kTransitionInfoOffset) |
| 5602 ACCESSORS(AllocationSite, nested_site, Object, kNestedSiteOffset) | 5587 ACCESSORS(AllocationSite, nested_site, Object, kNestedSiteOffset) |
| 5603 ACCESSORS_TO_SMI(AllocationSite, pretenure_data, kPretenureDataOffset) | 5588 SMI_ACCESSORS(AllocationSite, pretenure_data, kPretenureDataOffset) |
| 5604 ACCESSORS_TO_SMI(AllocationSite, pretenure_create_count, | 5589 SMI_ACCESSORS(AllocationSite, pretenure_create_count, |
| 5605 kPretenureCreateCountOffset) | 5590 kPretenureCreateCountOffset) |
| 5606 ACCESSORS(AllocationSite, dependent_code, DependentCode, | 5591 ACCESSORS(AllocationSite, dependent_code, DependentCode, |
| 5607 kDependentCodeOffset) | 5592 kDependentCodeOffset) |
| 5608 ACCESSORS(AllocationSite, weak_next, Object, kWeakNextOffset) | 5593 ACCESSORS(AllocationSite, weak_next, Object, kWeakNextOffset) |
| 5609 ACCESSORS(AllocationMemento, allocation_site, Object, kAllocationSiteOffset) | 5594 ACCESSORS(AllocationMemento, allocation_site, Object, kAllocationSiteOffset) |
| 5610 | 5595 |
| 5611 ACCESSORS(Script, source, Object, kSourceOffset) | 5596 ACCESSORS(Script, source, Object, kSourceOffset) |
| 5612 ACCESSORS(Script, name, Object, kNameOffset) | 5597 ACCESSORS(Script, name, Object, kNameOffset) |
| 5613 ACCESSORS(Script, id, Smi, kIdOffset) | 5598 SMI_ACCESSORS(Script, id, kIdOffset) |
| 5614 ACCESSORS_TO_SMI(Script, line_offset, kLineOffsetOffset) | 5599 SMI_ACCESSORS(Script, line_offset, kLineOffsetOffset) |
| 5615 ACCESSORS_TO_SMI(Script, column_offset, kColumnOffsetOffset) | 5600 SMI_ACCESSORS(Script, column_offset, kColumnOffsetOffset) |
| 5616 ACCESSORS(Script, context_data, Object, kContextOffset) | 5601 ACCESSORS(Script, context_data, Object, kContextOffset) |
| 5617 ACCESSORS(Script, wrapper, HeapObject, kWrapperOffset) | 5602 ACCESSORS(Script, wrapper, HeapObject, kWrapperOffset) |
| 5618 ACCESSORS_TO_SMI(Script, type, kTypeOffset) | 5603 SMI_ACCESSORS(Script, type, kTypeOffset) |
| 5619 ACCESSORS(Script, line_ends, Object, kLineEndsOffset) | 5604 ACCESSORS(Script, line_ends, Object, kLineEndsOffset) |
| 5620 ACCESSORS(Script, eval_from_shared, Object, kEvalFromSharedOffset) | 5605 ACCESSORS(Script, eval_from_shared, Object, kEvalFromSharedOffset) |
| 5621 ACCESSORS_TO_SMI(Script, eval_from_instructions_offset, | 5606 SMI_ACCESSORS(Script, eval_from_instructions_offset, |
| 5622 kEvalFrominstructionsOffsetOffset) | 5607 kEvalFrominstructionsOffsetOffset) |
| 5623 ACCESSORS(Script, shared_function_infos, Object, kSharedFunctionInfosOffset) | 5608 ACCESSORS(Script, shared_function_infos, Object, kSharedFunctionInfosOffset) |
| 5624 ACCESSORS_TO_SMI(Script, flags, kFlagsOffset) | 5609 SMI_ACCESSORS(Script, flags, kFlagsOffset) |
| 5625 ACCESSORS(Script, source_url, Object, kSourceUrlOffset) | 5610 ACCESSORS(Script, source_url, Object, kSourceUrlOffset) |
| 5626 ACCESSORS(Script, source_mapping_url, Object, kSourceMappingUrlOffset) | 5611 ACCESSORS(Script, source_mapping_url, Object, kSourceMappingUrlOffset) |
| 5627 | 5612 |
| 5628 Script::CompilationType Script::compilation_type() { | 5613 Script::CompilationType Script::compilation_type() { |
| 5629 return BooleanBit::get(flags(), kCompilationTypeBit) ? | 5614 return BooleanBit::get(flags(), kCompilationTypeBit) ? |
| 5630 COMPILATION_TYPE_EVAL : COMPILATION_TYPE_HOST; | 5615 COMPILATION_TYPE_EVAL : COMPILATION_TYPE_HOST; |
| 5631 } | 5616 } |
| 5632 void Script::set_compilation_type(CompilationType type) { | 5617 void Script::set_compilation_type(CompilationType type) { |
| 5633 set_flags(BooleanBit::set(flags(), kCompilationTypeBit, | 5618 set_flags(BooleanBit::set(flags(), kCompilationTypeBit, |
| 5634 type == COMPILATION_TYPE_EVAL)); | 5619 type == COMPILATION_TYPE_EVAL)); |
| 5635 } | 5620 } |
| 5636 bool Script::hide_source() { return BooleanBit::get(flags(), kHideSourceBit); } | 5621 bool Script::hide_source() { return BooleanBit::get(flags(), kHideSourceBit); } |
| 5637 void Script::set_hide_source(bool value) { | 5622 void Script::set_hide_source(bool value) { |
| 5638 set_flags(BooleanBit::set(flags(), kHideSourceBit, value)); | 5623 set_flags(BooleanBit::set(flags(), kHideSourceBit, value)); |
| 5639 } | 5624 } |
| 5640 Script::CompilationState Script::compilation_state() { | 5625 Script::CompilationState Script::compilation_state() { |
| 5641 return BooleanBit::get(flags(), kCompilationStateBit) ? | 5626 return BooleanBit::get(flags(), kCompilationStateBit) ? |
| 5642 COMPILATION_STATE_COMPILED : COMPILATION_STATE_INITIAL; | 5627 COMPILATION_STATE_COMPILED : COMPILATION_STATE_INITIAL; |
| 5643 } | 5628 } |
| 5644 void Script::set_compilation_state(CompilationState state) { | 5629 void Script::set_compilation_state(CompilationState state) { |
| 5645 set_flags(BooleanBit::set(flags(), kCompilationStateBit, | 5630 set_flags(BooleanBit::set(flags(), kCompilationStateBit, |
| 5646 state == COMPILATION_STATE_COMPILED)); | 5631 state == COMPILATION_STATE_COMPILED)); |
| 5647 } | 5632 } |
| 5648 ScriptOriginOptions Script::origin_options() { | 5633 ScriptOriginOptions Script::origin_options() { |
| 5649 return ScriptOriginOptions((flags()->value() & kOriginOptionsMask) >> | 5634 return ScriptOriginOptions((flags() & kOriginOptionsMask) >> |
| 5650 kOriginOptionsShift); | 5635 kOriginOptionsShift); |
| 5651 } | 5636 } |
| 5652 void Script::set_origin_options(ScriptOriginOptions origin_options) { | 5637 void Script::set_origin_options(ScriptOriginOptions origin_options) { |
| 5653 DCHECK(!(origin_options.Flags() & ~((1 << kOriginOptionsSize) - 1))); | 5638 DCHECK(!(origin_options.Flags() & ~((1 << kOriginOptionsSize) - 1))); |
| 5654 set_flags(Smi::FromInt((flags()->value() & ~kOriginOptionsMask) | | 5639 set_flags((flags() & ~kOriginOptionsMask) | |
| 5655 (origin_options.Flags() << kOriginOptionsShift))); | 5640 (origin_options.Flags() << kOriginOptionsShift)); |
| 5656 } | 5641 } |
| 5657 | 5642 |
| 5658 | 5643 |
| 5659 ACCESSORS(DebugInfo, shared, SharedFunctionInfo, kSharedFunctionInfoIndex) | 5644 ACCESSORS(DebugInfo, shared, SharedFunctionInfo, kSharedFunctionInfoIndex) |
| 5660 ACCESSORS(DebugInfo, code, Code, kCodeIndex) | 5645 ACCESSORS(DebugInfo, code, Code, kCodeIndex) |
| 5661 ACCESSORS(DebugInfo, break_points, FixedArray, kBreakPointsStateIndex) | 5646 ACCESSORS(DebugInfo, break_points, FixedArray, kBreakPointsStateIndex) |
| 5662 | 5647 |
| 5663 ACCESSORS_TO_SMI(BreakPointInfo, code_position, kCodePositionIndex) | 5648 SMI_ACCESSORS(BreakPointInfo, code_position, kCodePositionIndex) |
| 5664 ACCESSORS_TO_SMI(BreakPointInfo, source_position, kSourcePositionIndex) | 5649 SMI_ACCESSORS(BreakPointInfo, source_position, kSourcePositionIndex) |
| 5665 ACCESSORS_TO_SMI(BreakPointInfo, statement_position, kStatementPositionIndex) | 5650 SMI_ACCESSORS(BreakPointInfo, statement_position, kStatementPositionIndex) |
| 5666 ACCESSORS(BreakPointInfo, break_point_objects, Object, kBreakPointObjectsIndex) | 5651 ACCESSORS(BreakPointInfo, break_point_objects, Object, kBreakPointObjectsIndex) |
| 5667 | 5652 |
| 5668 ACCESSORS(SharedFunctionInfo, name, Object, kNameOffset) | 5653 ACCESSORS(SharedFunctionInfo, name, Object, kNameOffset) |
| 5669 ACCESSORS(SharedFunctionInfo, optimized_code_map, Object, | 5654 ACCESSORS(SharedFunctionInfo, optimized_code_map, Object, |
| 5670 kOptimizedCodeMapOffset) | 5655 kOptimizedCodeMapOffset) |
| 5671 ACCESSORS(SharedFunctionInfo, construct_stub, Code, kConstructStubOffset) | 5656 ACCESSORS(SharedFunctionInfo, construct_stub, Code, kConstructStubOffset) |
| 5672 ACCESSORS(SharedFunctionInfo, feedback_vector, TypeFeedbackVector, | 5657 ACCESSORS(SharedFunctionInfo, feedback_vector, TypeFeedbackVector, |
| 5673 kFeedbackVectorOffset) | 5658 kFeedbackVectorOffset) |
| 5674 #if TRACE_MAPS | 5659 #if TRACE_MAPS |
| 5675 SMI_ACCESSORS(SharedFunctionInfo, unique_id, kUniqueIdOffset) | 5660 SMI_ACCESSORS(SharedFunctionInfo, unique_id, kUniqueIdOffset) |
| (...skipping 423 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6099 void SharedFunctionInfo::set_disable_optimization_reason(BailoutReason reason) { | 6084 void SharedFunctionInfo::set_disable_optimization_reason(BailoutReason reason) { |
| 6100 set_opt_count_and_bailout_reason(DisabledOptimizationReasonBits::update( | 6085 set_opt_count_and_bailout_reason(DisabledOptimizationReasonBits::update( |
| 6101 opt_count_and_bailout_reason(), reason)); | 6086 opt_count_and_bailout_reason(), reason)); |
| 6102 } | 6087 } |
| 6103 | 6088 |
| 6104 | 6089 |
| 6105 bool SharedFunctionInfo::IsBuiltin() { | 6090 bool SharedFunctionInfo::IsBuiltin() { |
| 6106 Object* script_obj = script(); | 6091 Object* script_obj = script(); |
| 6107 if (script_obj->IsUndefined()) return true; | 6092 if (script_obj->IsUndefined()) return true; |
| 6108 Script* script = Script::cast(script_obj); | 6093 Script* script = Script::cast(script_obj); |
| 6109 Script::Type type = static_cast<Script::Type>(script->type()->value()); | 6094 Script::Type type = static_cast<Script::Type>(script->type()); |
| 6110 return type != Script::TYPE_NORMAL; | 6095 return type != Script::TYPE_NORMAL; |
| 6111 } | 6096 } |
| 6112 | 6097 |
| 6113 | 6098 |
| 6114 bool SharedFunctionInfo::IsSubjectToDebugging() { return !IsBuiltin(); } | 6099 bool SharedFunctionInfo::IsSubjectToDebugging() { return !IsBuiltin(); } |
| 6115 | 6100 |
| 6116 | 6101 |
| 6117 bool JSFunction::IsBuiltin() { return shared()->IsBuiltin(); } | 6102 bool JSFunction::IsBuiltin() { return shared()->IsBuiltin(); } |
| 6118 | 6103 |
| 6119 | 6104 |
| (...skipping 1172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7292 return BooleanBit::get(flag(), kSpecialDataProperty); | 7277 return BooleanBit::get(flag(), kSpecialDataProperty); |
| 7293 } | 7278 } |
| 7294 | 7279 |
| 7295 | 7280 |
| 7296 void AccessorInfo::set_is_special_data_property(bool value) { | 7281 void AccessorInfo::set_is_special_data_property(bool value) { |
| 7297 set_flag(BooleanBit::set(flag(), kSpecialDataProperty, value)); | 7282 set_flag(BooleanBit::set(flag(), kSpecialDataProperty, value)); |
| 7298 } | 7283 } |
| 7299 | 7284 |
| 7300 | 7285 |
| 7301 PropertyAttributes AccessorInfo::property_attributes() { | 7286 PropertyAttributes AccessorInfo::property_attributes() { |
| 7302 return AttributesField::decode(static_cast<uint32_t>(flag()->value())); | 7287 return AttributesField::decode(static_cast<uint32_t>(flag())); |
| 7303 } | 7288 } |
| 7304 | 7289 |
| 7305 | 7290 |
| 7306 void AccessorInfo::set_property_attributes(PropertyAttributes attributes) { | 7291 void AccessorInfo::set_property_attributes(PropertyAttributes attributes) { |
| 7307 set_flag(Smi::FromInt(AttributesField::update(flag()->value(), attributes))); | 7292 set_flag(AttributesField::update(flag(), attributes)); |
| 7308 } | 7293 } |
| 7309 | 7294 |
| 7310 | 7295 |
| 7311 bool AccessorInfo::IsCompatibleReceiver(Object* receiver) { | 7296 bool AccessorInfo::IsCompatibleReceiver(Object* receiver) { |
| 7312 if (!HasExpectedReceiverType()) return true; | 7297 if (!HasExpectedReceiverType()) return true; |
| 7313 if (!receiver->IsJSObject()) return false; | 7298 if (!receiver->IsJSObject()) return false; |
| 7314 return FunctionTemplateInfo::cast(expected_receiver_type()) | 7299 return FunctionTemplateInfo::cast(expected_receiver_type()) |
| 7315 ->IsTemplateFor(JSObject::cast(receiver)->map()); | 7300 ->IsTemplateFor(JSObject::cast(receiver)->map()); |
| 7316 } | 7301 } |
| 7317 | 7302 |
| (...skipping 649 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7967 | 7952 |
| 7968 String::SubStringRange::iterator String::SubStringRange::end() { | 7953 String::SubStringRange::iterator String::SubStringRange::end() { |
| 7969 return String::SubStringRange::iterator(string_, first_ + length_); | 7954 return String::SubStringRange::iterator(string_, first_ + length_); |
| 7970 } | 7955 } |
| 7971 | 7956 |
| 7972 | 7957 |
| 7973 #undef TYPE_CHECKER | 7958 #undef TYPE_CHECKER |
| 7974 #undef CAST_ACCESSOR | 7959 #undef CAST_ACCESSOR |
| 7975 #undef INT_ACCESSORS | 7960 #undef INT_ACCESSORS |
| 7976 #undef ACCESSORS | 7961 #undef ACCESSORS |
| 7977 #undef ACCESSORS_TO_SMI | |
| 7978 #undef SMI_ACCESSORS | 7962 #undef SMI_ACCESSORS |
| 7979 #undef SYNCHRONIZED_SMI_ACCESSORS | 7963 #undef SYNCHRONIZED_SMI_ACCESSORS |
| 7980 #undef NOBARRIER_SMI_ACCESSORS | 7964 #undef NOBARRIER_SMI_ACCESSORS |
| 7981 #undef BOOL_GETTER | 7965 #undef BOOL_GETTER |
| 7982 #undef BOOL_ACCESSORS | 7966 #undef BOOL_ACCESSORS |
| 7983 #undef FIELD_ADDR | 7967 #undef FIELD_ADDR |
| 7984 #undef FIELD_ADDR_CONST | 7968 #undef FIELD_ADDR_CONST |
| 7985 #undef READ_FIELD | 7969 #undef READ_FIELD |
| 7986 #undef NOBARRIER_READ_FIELD | 7970 #undef NOBARRIER_READ_FIELD |
| 7987 #undef WRITE_FIELD | 7971 #undef WRITE_FIELD |
| (...skipping 25 matching lines...) Expand all Loading... |
| 8013 #undef READ_INT64_FIELD | 7997 #undef READ_INT64_FIELD |
| 8014 #undef WRITE_INT64_FIELD | 7998 #undef WRITE_INT64_FIELD |
| 8015 #undef READ_BYTE_FIELD | 7999 #undef READ_BYTE_FIELD |
| 8016 #undef WRITE_BYTE_FIELD | 8000 #undef WRITE_BYTE_FIELD |
| 8017 #undef NOBARRIER_READ_BYTE_FIELD | 8001 #undef NOBARRIER_READ_BYTE_FIELD |
| 8018 #undef NOBARRIER_WRITE_BYTE_FIELD | 8002 #undef NOBARRIER_WRITE_BYTE_FIELD |
| 8019 | 8003 |
| 8020 } } // namespace v8::internal | 8004 } } // namespace v8::internal |
| 8021 | 8005 |
| 8022 #endif // V8_OBJECTS_INL_H_ | 8006 #endif // V8_OBJECTS_INL_H_ |
| OLD | NEW |