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 1562 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1669 FixedArrayBase* JSObject::elements() const { | 1661 FixedArrayBase* JSObject::elements() const { |
1670 Object* array = READ_FIELD(this, kElementsOffset); | 1662 Object* array = READ_FIELD(this, kElementsOffset); |
1671 return static_cast<FixedArrayBase*>(array); | 1663 return static_cast<FixedArrayBase*>(array); |
1672 } | 1664 } |
1673 | 1665 |
1674 | 1666 |
1675 void AllocationSite::Initialize() { | 1667 void AllocationSite::Initialize() { |
1676 set_transition_info(Smi::FromInt(0)); | 1668 set_transition_info(Smi::FromInt(0)); |
1677 SetElementsKind(GetInitialFastElementsKind()); | 1669 SetElementsKind(GetInitialFastElementsKind()); |
1678 set_nested_site(Smi::FromInt(0)); | 1670 set_nested_site(Smi::FromInt(0)); |
1679 set_pretenure_data(Smi::FromInt(0)); | 1671 set_pretenure_data(0); |
1680 set_pretenure_create_count(Smi::FromInt(0)); | 1672 set_pretenure_create_count(0); |
1681 set_dependent_code(DependentCode::cast(GetHeap()->empty_fixed_array()), | 1673 set_dependent_code(DependentCode::cast(GetHeap()->empty_fixed_array()), |
1682 SKIP_WRITE_BARRIER); | 1674 SKIP_WRITE_BARRIER); |
1683 } | 1675 } |
1684 | 1676 |
1685 | 1677 |
1686 bool AllocationSite::IsZombie() { return pretenure_decision() == kZombie; } | 1678 bool AllocationSite::IsZombie() { return pretenure_decision() == kZombie; } |
1687 | 1679 |
1688 | 1680 |
1689 bool AllocationSite::IsMaybeTenure() { | 1681 bool AllocationSite::IsMaybeTenure() { |
1690 return pretenure_decision() == kMaybeTenure; | 1682 return pretenure_decision() == kMaybeTenure; |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1765 if (FLAG_allocation_site_pretenuring) { | 1757 if (FLAG_allocation_site_pretenuring) { |
1766 return type == JS_ARRAY_TYPE || | 1758 return type == JS_ARRAY_TYPE || |
1767 type == JS_OBJECT_TYPE || | 1759 type == JS_OBJECT_TYPE || |
1768 type < FIRST_NONSTRING_TYPE; | 1760 type < FIRST_NONSTRING_TYPE; |
1769 } | 1761 } |
1770 return type == JS_ARRAY_TYPE; | 1762 return type == JS_ARRAY_TYPE; |
1771 } | 1763 } |
1772 | 1764 |
1773 | 1765 |
1774 AllocationSite::PretenureDecision AllocationSite::pretenure_decision() { | 1766 AllocationSite::PretenureDecision AllocationSite::pretenure_decision() { |
1775 int value = pretenure_data()->value(); | 1767 int value = pretenure_data(); |
1776 return PretenureDecisionBits::decode(value); | 1768 return PretenureDecisionBits::decode(value); |
1777 } | 1769 } |
1778 | 1770 |
1779 | 1771 |
1780 void AllocationSite::set_pretenure_decision(PretenureDecision decision) { | 1772 void AllocationSite::set_pretenure_decision(PretenureDecision decision) { |
1781 int value = pretenure_data()->value(); | 1773 int value = pretenure_data(); |
1782 set_pretenure_data( | 1774 set_pretenure_data(PretenureDecisionBits::update(value, decision)); |
1783 Smi::FromInt(PretenureDecisionBits::update(value, decision)), | |
1784 SKIP_WRITE_BARRIER); | |
1785 } | 1775 } |
1786 | 1776 |
1787 | 1777 |
1788 bool AllocationSite::deopt_dependent_code() { | 1778 bool AllocationSite::deopt_dependent_code() { |
1789 int value = pretenure_data()->value(); | 1779 int value = pretenure_data(); |
1790 return DeoptDependentCodeBit::decode(value); | 1780 return DeoptDependentCodeBit::decode(value); |
1791 } | 1781 } |
1792 | 1782 |
1793 | 1783 |
1794 void AllocationSite::set_deopt_dependent_code(bool deopt) { | 1784 void AllocationSite::set_deopt_dependent_code(bool deopt) { |
1795 int value = pretenure_data()->value(); | 1785 int value = pretenure_data(); |
1796 set_pretenure_data(Smi::FromInt(DeoptDependentCodeBit::update(value, deopt)), | 1786 set_pretenure_data(DeoptDependentCodeBit::update(value, deopt)); |
1797 SKIP_WRITE_BARRIER); | |
1798 } | 1787 } |
1799 | 1788 |
1800 | 1789 |
1801 int AllocationSite::memento_found_count() { | 1790 int AllocationSite::memento_found_count() { |
1802 int value = pretenure_data()->value(); | 1791 int value = pretenure_data(); |
1803 return MementoFoundCountBits::decode(value); | 1792 return MementoFoundCountBits::decode(value); |
1804 } | 1793 } |
1805 | 1794 |
1806 | 1795 |
1807 inline void AllocationSite::set_memento_found_count(int count) { | 1796 inline void AllocationSite::set_memento_found_count(int count) { |
1808 int value = pretenure_data()->value(); | 1797 int value = pretenure_data(); |
1809 // Verify that we can count more mementos than we can possibly find in one | 1798 // Verify that we can count more mementos than we can possibly find in one |
1810 // new space collection. | 1799 // new space collection. |
1811 DCHECK((GetHeap()->MaxSemiSpaceSize() / | 1800 DCHECK((GetHeap()->MaxSemiSpaceSize() / |
1812 (Heap::kMinObjectSizeInWords * kPointerSize + | 1801 (Heap::kMinObjectSizeInWords * kPointerSize + |
1813 AllocationMemento::kSize)) < MementoFoundCountBits::kMax); | 1802 AllocationMemento::kSize)) < MementoFoundCountBits::kMax); |
1814 DCHECK(count < MementoFoundCountBits::kMax); | 1803 DCHECK(count < MementoFoundCountBits::kMax); |
1815 set_pretenure_data( | 1804 set_pretenure_data(MementoFoundCountBits::update(value, count)); |
1816 Smi::FromInt(MementoFoundCountBits::update(value, count)), | |
1817 SKIP_WRITE_BARRIER); | |
1818 } | 1805 } |
1819 | 1806 |
1820 | 1807 |
1821 int AllocationSite::memento_create_count() { | 1808 int AllocationSite::memento_create_count() { return pretenure_create_count(); } |
1822 return pretenure_create_count()->value(); | 1809 |
| 1810 |
| 1811 void AllocationSite::set_memento_create_count(int count) { |
| 1812 set_pretenure_create_count(count); |
1823 } | 1813 } |
1824 | 1814 |
1825 | 1815 |
1826 void AllocationSite::set_memento_create_count(int count) { | |
1827 set_pretenure_create_count(Smi::FromInt(count), SKIP_WRITE_BARRIER); | |
1828 } | |
1829 | |
1830 | |
1831 inline bool AllocationSite::IncrementMementoFoundCount() { | 1816 inline bool AllocationSite::IncrementMementoFoundCount() { |
1832 if (IsZombie()) return false; | 1817 if (IsZombie()) return false; |
1833 | 1818 |
1834 int value = memento_found_count(); | 1819 int value = memento_found_count(); |
1835 set_memento_found_count(value + 1); | 1820 set_memento_found_count(value + 1); |
1836 return memento_found_count() == kPretenureMinimumCreated; | 1821 return memento_found_count() == kPretenureMinimumCreated; |
1837 } | 1822 } |
1838 | 1823 |
1839 | 1824 |
1840 inline void AllocationSite::IncrementMementoCreateCount() { | 1825 inline void AllocationSite::IncrementMementoCreateCount() { |
(...skipping 1763 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3604 if ((one->IsInternalizedString() && two->IsInternalizedString()) || | 3589 if ((one->IsInternalizedString() && two->IsInternalizedString()) || |
3605 one->IsSymbol() || two->IsSymbol()) { | 3590 one->IsSymbol() || two->IsSymbol()) { |
3606 return false; | 3591 return false; |
3607 } | 3592 } |
3608 return String::SlowEquals(Handle<String>::cast(one), | 3593 return String::SlowEquals(Handle<String>::cast(one), |
3609 Handle<String>::cast(two)); | 3594 Handle<String>::cast(two)); |
3610 } | 3595 } |
3611 | 3596 |
3612 | 3597 |
3613 ACCESSORS(Symbol, name, Object, kNameOffset) | 3598 ACCESSORS(Symbol, name, Object, kNameOffset) |
3614 ACCESSORS(Symbol, flags, Smi, kFlagsOffset) | 3599 SMI_ACCESSORS(Symbol, flags, kFlagsOffset) |
3615 BOOL_ACCESSORS(Symbol, flags, is_private, kPrivateBit) | 3600 BOOL_ACCESSORS(Symbol, flags, is_private, kPrivateBit) |
3616 | 3601 |
3617 | 3602 |
3618 bool String::Equals(String* other) { | 3603 bool String::Equals(String* other) { |
3619 if (other == this) return true; | 3604 if (other == this) return true; |
3620 if (this->IsInternalizedString() && other->IsInternalizedString()) { | 3605 if (this->IsInternalizedString() && other->IsInternalizedString()) { |
3621 return false; | 3606 return false; |
3622 } | 3607 } |
3623 return SlowEquals(other); | 3608 return SlowEquals(other); |
3624 } | 3609 } |
(...skipping 1887 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5512 ACCESSORS(JSFunction, next_function_link, Object, kNextFunctionLinkOffset) | 5497 ACCESSORS(JSFunction, next_function_link, Object, kNextFunctionLinkOffset) |
5513 | 5498 |
5514 ACCESSORS(GlobalObject, builtins, JSBuiltinsObject, kBuiltinsOffset) | 5499 ACCESSORS(GlobalObject, builtins, JSBuiltinsObject, kBuiltinsOffset) |
5515 ACCESSORS(GlobalObject, native_context, Context, kNativeContextOffset) | 5500 ACCESSORS(GlobalObject, native_context, Context, kNativeContextOffset) |
5516 ACCESSORS(GlobalObject, global_proxy, JSObject, kGlobalProxyOffset) | 5501 ACCESSORS(GlobalObject, global_proxy, JSObject, kGlobalProxyOffset) |
5517 | 5502 |
5518 ACCESSORS(JSGlobalProxy, native_context, Object, kNativeContextOffset) | 5503 ACCESSORS(JSGlobalProxy, native_context, Object, kNativeContextOffset) |
5519 ACCESSORS(JSGlobalProxy, hash, Object, kHashOffset) | 5504 ACCESSORS(JSGlobalProxy, hash, Object, kHashOffset) |
5520 | 5505 |
5521 ACCESSORS(AccessorInfo, name, Object, kNameOffset) | 5506 ACCESSORS(AccessorInfo, name, Object, kNameOffset) |
5522 ACCESSORS_TO_SMI(AccessorInfo, flag, kFlagOffset) | 5507 SMI_ACCESSORS(AccessorInfo, flag, kFlagOffset) |
5523 ACCESSORS(AccessorInfo, expected_receiver_type, Object, | 5508 ACCESSORS(AccessorInfo, expected_receiver_type, Object, |
5524 kExpectedReceiverTypeOffset) | 5509 kExpectedReceiverTypeOffset) |
5525 | 5510 |
5526 ACCESSORS(ExecutableAccessorInfo, getter, Object, kGetterOffset) | 5511 ACCESSORS(ExecutableAccessorInfo, getter, Object, kGetterOffset) |
5527 ACCESSORS(ExecutableAccessorInfo, setter, Object, kSetterOffset) | 5512 ACCESSORS(ExecutableAccessorInfo, setter, Object, kSetterOffset) |
5528 ACCESSORS(ExecutableAccessorInfo, data, Object, kDataOffset) | 5513 ACCESSORS(ExecutableAccessorInfo, data, Object, kDataOffset) |
5529 | 5514 |
5530 ACCESSORS(Box, value, Object, kValueOffset) | 5515 ACCESSORS(Box, value, Object, kValueOffset) |
5531 | 5516 |
5532 ACCESSORS(PrototypeInfo, prototype_users, Object, kPrototypeUsersOffset) | 5517 ACCESSORS(PrototypeInfo, prototype_users, Object, kPrototypeUsersOffset) |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5576 ACCESSORS(FunctionTemplateInfo, indexed_property_handler, Object, | 5561 ACCESSORS(FunctionTemplateInfo, indexed_property_handler, Object, |
5577 kIndexedPropertyHandlerOffset) | 5562 kIndexedPropertyHandlerOffset) |
5578 ACCESSORS(FunctionTemplateInfo, instance_template, Object, | 5563 ACCESSORS(FunctionTemplateInfo, instance_template, Object, |
5579 kInstanceTemplateOffset) | 5564 kInstanceTemplateOffset) |
5580 ACCESSORS(FunctionTemplateInfo, class_name, Object, kClassNameOffset) | 5565 ACCESSORS(FunctionTemplateInfo, class_name, Object, kClassNameOffset) |
5581 ACCESSORS(FunctionTemplateInfo, signature, Object, kSignatureOffset) | 5566 ACCESSORS(FunctionTemplateInfo, signature, Object, kSignatureOffset) |
5582 ACCESSORS(FunctionTemplateInfo, instance_call_handler, Object, | 5567 ACCESSORS(FunctionTemplateInfo, instance_call_handler, Object, |
5583 kInstanceCallHandlerOffset) | 5568 kInstanceCallHandlerOffset) |
5584 ACCESSORS(FunctionTemplateInfo, access_check_info, Object, | 5569 ACCESSORS(FunctionTemplateInfo, access_check_info, Object, |
5585 kAccessCheckInfoOffset) | 5570 kAccessCheckInfoOffset) |
5586 ACCESSORS_TO_SMI(FunctionTemplateInfo, flag, kFlagOffset) | 5571 SMI_ACCESSORS(FunctionTemplateInfo, flag, kFlagOffset) |
5587 | 5572 |
5588 ACCESSORS(ObjectTemplateInfo, constructor, Object, kConstructorOffset) | 5573 ACCESSORS(ObjectTemplateInfo, constructor, Object, kConstructorOffset) |
5589 ACCESSORS(ObjectTemplateInfo, internal_field_count, Object, | 5574 ACCESSORS(ObjectTemplateInfo, internal_field_count, Object, |
5590 kInternalFieldCountOffset) | 5575 kInternalFieldCountOffset) |
5591 | 5576 |
5592 ACCESSORS(TypeSwitchInfo, types, Object, kTypesOffset) | 5577 ACCESSORS(TypeSwitchInfo, types, Object, kTypesOffset) |
5593 | 5578 |
5594 ACCESSORS(AllocationSite, transition_info, Object, kTransitionInfoOffset) | 5579 ACCESSORS(AllocationSite, transition_info, Object, kTransitionInfoOffset) |
5595 ACCESSORS(AllocationSite, nested_site, Object, kNestedSiteOffset) | 5580 ACCESSORS(AllocationSite, nested_site, Object, kNestedSiteOffset) |
5596 ACCESSORS_TO_SMI(AllocationSite, pretenure_data, kPretenureDataOffset) | 5581 SMI_ACCESSORS(AllocationSite, pretenure_data, kPretenureDataOffset) |
5597 ACCESSORS_TO_SMI(AllocationSite, pretenure_create_count, | 5582 SMI_ACCESSORS(AllocationSite, pretenure_create_count, |
5598 kPretenureCreateCountOffset) | 5583 kPretenureCreateCountOffset) |
5599 ACCESSORS(AllocationSite, dependent_code, DependentCode, | 5584 ACCESSORS(AllocationSite, dependent_code, DependentCode, |
5600 kDependentCodeOffset) | 5585 kDependentCodeOffset) |
5601 ACCESSORS(AllocationSite, weak_next, Object, kWeakNextOffset) | 5586 ACCESSORS(AllocationSite, weak_next, Object, kWeakNextOffset) |
5602 ACCESSORS(AllocationMemento, allocation_site, Object, kAllocationSiteOffset) | 5587 ACCESSORS(AllocationMemento, allocation_site, Object, kAllocationSiteOffset) |
5603 | 5588 |
5604 ACCESSORS(Script, source, Object, kSourceOffset) | 5589 ACCESSORS(Script, source, Object, kSourceOffset) |
5605 ACCESSORS(Script, name, Object, kNameOffset) | 5590 ACCESSORS(Script, name, Object, kNameOffset) |
5606 ACCESSORS(Script, id, Smi, kIdOffset) | 5591 SMI_ACCESSORS(Script, id, kIdOffset) |
5607 ACCESSORS_TO_SMI(Script, line_offset, kLineOffsetOffset) | 5592 SMI_ACCESSORS(Script, line_offset, kLineOffsetOffset) |
5608 ACCESSORS_TO_SMI(Script, column_offset, kColumnOffsetOffset) | 5593 SMI_ACCESSORS(Script, column_offset, kColumnOffsetOffset) |
5609 ACCESSORS(Script, context_data, Object, kContextOffset) | 5594 ACCESSORS(Script, context_data, Object, kContextOffset) |
5610 ACCESSORS(Script, wrapper, HeapObject, kWrapperOffset) | 5595 ACCESSORS(Script, wrapper, HeapObject, kWrapperOffset) |
5611 ACCESSORS_TO_SMI(Script, type, kTypeOffset) | 5596 SMI_ACCESSORS(Script, type, kTypeOffset) |
5612 ACCESSORS(Script, line_ends, Object, kLineEndsOffset) | 5597 ACCESSORS(Script, line_ends, Object, kLineEndsOffset) |
5613 ACCESSORS(Script, eval_from_shared, Object, kEvalFromSharedOffset) | 5598 ACCESSORS(Script, eval_from_shared, Object, kEvalFromSharedOffset) |
5614 ACCESSORS_TO_SMI(Script, eval_from_instructions_offset, | 5599 SMI_ACCESSORS(Script, eval_from_instructions_offset, |
5615 kEvalFrominstructionsOffsetOffset) | 5600 kEvalFrominstructionsOffsetOffset) |
5616 ACCESSORS(Script, shared_function_infos, Object, kSharedFunctionInfosOffset) | 5601 ACCESSORS(Script, shared_function_infos, Object, kSharedFunctionInfosOffset) |
5617 ACCESSORS_TO_SMI(Script, flags, kFlagsOffset) | 5602 SMI_ACCESSORS(Script, flags, kFlagsOffset) |
5618 ACCESSORS(Script, source_url, Object, kSourceUrlOffset) | 5603 ACCESSORS(Script, source_url, Object, kSourceUrlOffset) |
5619 ACCESSORS(Script, source_mapping_url, Object, kSourceMappingUrlOffset) | 5604 ACCESSORS(Script, source_mapping_url, Object, kSourceMappingUrlOffset) |
5620 | 5605 |
5621 Script::CompilationType Script::compilation_type() { | 5606 Script::CompilationType Script::compilation_type() { |
5622 return BooleanBit::get(flags(), kCompilationTypeBit) ? | 5607 return BooleanBit::get(flags(), kCompilationTypeBit) ? |
5623 COMPILATION_TYPE_EVAL : COMPILATION_TYPE_HOST; | 5608 COMPILATION_TYPE_EVAL : COMPILATION_TYPE_HOST; |
5624 } | 5609 } |
5625 void Script::set_compilation_type(CompilationType type) { | 5610 void Script::set_compilation_type(CompilationType type) { |
5626 set_flags(BooleanBit::set(flags(), kCompilationTypeBit, | 5611 set_flags(BooleanBit::set(flags(), kCompilationTypeBit, |
5627 type == COMPILATION_TYPE_EVAL)); | 5612 type == COMPILATION_TYPE_EVAL)); |
5628 } | 5613 } |
5629 bool Script::hide_source() { return BooleanBit::get(flags(), kHideSourceBit); } | 5614 bool Script::hide_source() { return BooleanBit::get(flags(), kHideSourceBit); } |
5630 void Script::set_hide_source(bool value) { | 5615 void Script::set_hide_source(bool value) { |
5631 set_flags(BooleanBit::set(flags(), kHideSourceBit, value)); | 5616 set_flags(BooleanBit::set(flags(), kHideSourceBit, value)); |
5632 } | 5617 } |
5633 Script::CompilationState Script::compilation_state() { | 5618 Script::CompilationState Script::compilation_state() { |
5634 return BooleanBit::get(flags(), kCompilationStateBit) ? | 5619 return BooleanBit::get(flags(), kCompilationStateBit) ? |
5635 COMPILATION_STATE_COMPILED : COMPILATION_STATE_INITIAL; | 5620 COMPILATION_STATE_COMPILED : COMPILATION_STATE_INITIAL; |
5636 } | 5621 } |
5637 void Script::set_compilation_state(CompilationState state) { | 5622 void Script::set_compilation_state(CompilationState state) { |
5638 set_flags(BooleanBit::set(flags(), kCompilationStateBit, | 5623 set_flags(BooleanBit::set(flags(), kCompilationStateBit, |
5639 state == COMPILATION_STATE_COMPILED)); | 5624 state == COMPILATION_STATE_COMPILED)); |
5640 } | 5625 } |
5641 ScriptOriginOptions Script::origin_options() { | 5626 ScriptOriginOptions Script::origin_options() { |
5642 return ScriptOriginOptions((flags()->value() & kOriginOptionsMask) >> | 5627 return ScriptOriginOptions((flags() & kOriginOptionsMask) >> |
5643 kOriginOptionsShift); | 5628 kOriginOptionsShift); |
5644 } | 5629 } |
5645 void Script::set_origin_options(ScriptOriginOptions origin_options) { | 5630 void Script::set_origin_options(ScriptOriginOptions origin_options) { |
5646 DCHECK(!(origin_options.Flags() & ~((1 << kOriginOptionsSize) - 1))); | 5631 DCHECK(!(origin_options.Flags() & ~((1 << kOriginOptionsSize) - 1))); |
5647 set_flags(Smi::FromInt((flags()->value() & ~kOriginOptionsMask) | | 5632 set_flags((flags() & ~kOriginOptionsMask) | |
5648 (origin_options.Flags() << kOriginOptionsShift))); | 5633 (origin_options.Flags() << kOriginOptionsShift)); |
5649 } | 5634 } |
5650 | 5635 |
5651 | 5636 |
5652 ACCESSORS(DebugInfo, shared, SharedFunctionInfo, kSharedFunctionInfoIndex) | 5637 ACCESSORS(DebugInfo, shared, SharedFunctionInfo, kSharedFunctionInfoIndex) |
5653 ACCESSORS(DebugInfo, code, Code, kCodeIndex) | 5638 ACCESSORS(DebugInfo, code, Code, kCodeIndex) |
5654 ACCESSORS(DebugInfo, break_points, FixedArray, kBreakPointsStateIndex) | 5639 ACCESSORS(DebugInfo, break_points, FixedArray, kBreakPointsStateIndex) |
5655 | 5640 |
5656 ACCESSORS_TO_SMI(BreakPointInfo, code_position, kCodePositionIndex) | 5641 SMI_ACCESSORS(BreakPointInfo, code_position, kCodePositionIndex) |
5657 ACCESSORS_TO_SMI(BreakPointInfo, source_position, kSourcePositionIndex) | 5642 SMI_ACCESSORS(BreakPointInfo, source_position, kSourcePositionIndex) |
5658 ACCESSORS_TO_SMI(BreakPointInfo, statement_position, kStatementPositionIndex) | 5643 SMI_ACCESSORS(BreakPointInfo, statement_position, kStatementPositionIndex) |
5659 ACCESSORS(BreakPointInfo, break_point_objects, Object, kBreakPointObjectsIndex) | 5644 ACCESSORS(BreakPointInfo, break_point_objects, Object, kBreakPointObjectsIndex) |
5660 | 5645 |
5661 ACCESSORS(SharedFunctionInfo, name, Object, kNameOffset) | 5646 ACCESSORS(SharedFunctionInfo, name, Object, kNameOffset) |
5662 ACCESSORS(SharedFunctionInfo, optimized_code_map, Object, | 5647 ACCESSORS(SharedFunctionInfo, optimized_code_map, Object, |
5663 kOptimizedCodeMapOffset) | 5648 kOptimizedCodeMapOffset) |
5664 ACCESSORS(SharedFunctionInfo, construct_stub, Code, kConstructStubOffset) | 5649 ACCESSORS(SharedFunctionInfo, construct_stub, Code, kConstructStubOffset) |
5665 ACCESSORS(SharedFunctionInfo, feedback_vector, TypeFeedbackVector, | 5650 ACCESSORS(SharedFunctionInfo, feedback_vector, TypeFeedbackVector, |
5666 kFeedbackVectorOffset) | 5651 kFeedbackVectorOffset) |
5667 #if TRACE_MAPS | 5652 #if TRACE_MAPS |
5668 SMI_ACCESSORS(SharedFunctionInfo, unique_id, kUniqueIdOffset) | 5653 SMI_ACCESSORS(SharedFunctionInfo, unique_id, kUniqueIdOffset) |
(...skipping 423 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6092 void SharedFunctionInfo::set_disable_optimization_reason(BailoutReason reason) { | 6077 void SharedFunctionInfo::set_disable_optimization_reason(BailoutReason reason) { |
6093 set_opt_count_and_bailout_reason(DisabledOptimizationReasonBits::update( | 6078 set_opt_count_and_bailout_reason(DisabledOptimizationReasonBits::update( |
6094 opt_count_and_bailout_reason(), reason)); | 6079 opt_count_and_bailout_reason(), reason)); |
6095 } | 6080 } |
6096 | 6081 |
6097 | 6082 |
6098 bool SharedFunctionInfo::IsBuiltin() { | 6083 bool SharedFunctionInfo::IsBuiltin() { |
6099 Object* script_obj = script(); | 6084 Object* script_obj = script(); |
6100 if (script_obj->IsUndefined()) return true; | 6085 if (script_obj->IsUndefined()) return true; |
6101 Script* script = Script::cast(script_obj); | 6086 Script* script = Script::cast(script_obj); |
6102 Script::Type type = static_cast<Script::Type>(script->type()->value()); | 6087 Script::Type type = static_cast<Script::Type>(script->type()); |
6103 return type != Script::TYPE_NORMAL; | 6088 return type != Script::TYPE_NORMAL; |
6104 } | 6089 } |
6105 | 6090 |
6106 | 6091 |
6107 bool SharedFunctionInfo::IsSubjectToDebugging() { return !IsBuiltin(); } | 6092 bool SharedFunctionInfo::IsSubjectToDebugging() { return !IsBuiltin(); } |
6108 | 6093 |
6109 | 6094 |
6110 bool JSFunction::IsBuiltin() { return shared()->IsBuiltin(); } | 6095 bool JSFunction::IsBuiltin() { return shared()->IsBuiltin(); } |
6111 | 6096 |
6112 | 6097 |
(...skipping 1172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7285 return BooleanBit::get(flag(), kSpecialDataProperty); | 7270 return BooleanBit::get(flag(), kSpecialDataProperty); |
7286 } | 7271 } |
7287 | 7272 |
7288 | 7273 |
7289 void AccessorInfo::set_is_special_data_property(bool value) { | 7274 void AccessorInfo::set_is_special_data_property(bool value) { |
7290 set_flag(BooleanBit::set(flag(), kSpecialDataProperty, value)); | 7275 set_flag(BooleanBit::set(flag(), kSpecialDataProperty, value)); |
7291 } | 7276 } |
7292 | 7277 |
7293 | 7278 |
7294 PropertyAttributes AccessorInfo::property_attributes() { | 7279 PropertyAttributes AccessorInfo::property_attributes() { |
7295 return AttributesField::decode(static_cast<uint32_t>(flag()->value())); | 7280 return AttributesField::decode(static_cast<uint32_t>(flag())); |
7296 } | 7281 } |
7297 | 7282 |
7298 | 7283 |
7299 void AccessorInfo::set_property_attributes(PropertyAttributes attributes) { | 7284 void AccessorInfo::set_property_attributes(PropertyAttributes attributes) { |
7300 set_flag(Smi::FromInt(AttributesField::update(flag()->value(), attributes))); | 7285 set_flag(AttributesField::update(flag(), attributes)); |
7301 } | 7286 } |
7302 | 7287 |
7303 | 7288 |
7304 bool AccessorInfo::IsCompatibleReceiver(Object* receiver) { | 7289 bool AccessorInfo::IsCompatibleReceiver(Object* receiver) { |
7305 if (!HasExpectedReceiverType()) return true; | 7290 if (!HasExpectedReceiverType()) return true; |
7306 if (!receiver->IsJSObject()) return false; | 7291 if (!receiver->IsJSObject()) return false; |
7307 return FunctionTemplateInfo::cast(expected_receiver_type()) | 7292 return FunctionTemplateInfo::cast(expected_receiver_type()) |
7308 ->IsTemplateFor(JSObject::cast(receiver)->map()); | 7293 ->IsTemplateFor(JSObject::cast(receiver)->map()); |
7309 } | 7294 } |
7310 | 7295 |
(...skipping 649 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7960 | 7945 |
7961 String::SubStringRange::iterator String::SubStringRange::end() { | 7946 String::SubStringRange::iterator String::SubStringRange::end() { |
7962 return String::SubStringRange::iterator(string_, first_ + length_); | 7947 return String::SubStringRange::iterator(string_, first_ + length_); |
7963 } | 7948 } |
7964 | 7949 |
7965 | 7950 |
7966 #undef TYPE_CHECKER | 7951 #undef TYPE_CHECKER |
7967 #undef CAST_ACCESSOR | 7952 #undef CAST_ACCESSOR |
7968 #undef INT_ACCESSORS | 7953 #undef INT_ACCESSORS |
7969 #undef ACCESSORS | 7954 #undef ACCESSORS |
7970 #undef ACCESSORS_TO_SMI | |
7971 #undef SMI_ACCESSORS | 7955 #undef SMI_ACCESSORS |
7972 #undef SYNCHRONIZED_SMI_ACCESSORS | 7956 #undef SYNCHRONIZED_SMI_ACCESSORS |
7973 #undef NOBARRIER_SMI_ACCESSORS | 7957 #undef NOBARRIER_SMI_ACCESSORS |
7974 #undef BOOL_GETTER | 7958 #undef BOOL_GETTER |
7975 #undef BOOL_ACCESSORS | 7959 #undef BOOL_ACCESSORS |
7976 #undef FIELD_ADDR | 7960 #undef FIELD_ADDR |
7977 #undef FIELD_ADDR_CONST | 7961 #undef FIELD_ADDR_CONST |
7978 #undef READ_FIELD | 7962 #undef READ_FIELD |
7979 #undef NOBARRIER_READ_FIELD | 7963 #undef NOBARRIER_READ_FIELD |
7980 #undef WRITE_FIELD | 7964 #undef WRITE_FIELD |
(...skipping 25 matching lines...) Expand all Loading... |
8006 #undef READ_INT64_FIELD | 7990 #undef READ_INT64_FIELD |
8007 #undef WRITE_INT64_FIELD | 7991 #undef WRITE_INT64_FIELD |
8008 #undef READ_BYTE_FIELD | 7992 #undef READ_BYTE_FIELD |
8009 #undef WRITE_BYTE_FIELD | 7993 #undef WRITE_BYTE_FIELD |
8010 #undef NOBARRIER_READ_BYTE_FIELD | 7994 #undef NOBARRIER_READ_BYTE_FIELD |
8011 #undef NOBARRIER_WRITE_BYTE_FIELD | 7995 #undef NOBARRIER_WRITE_BYTE_FIELD |
8012 | 7996 |
8013 } } // namespace v8::internal | 7997 } } // namespace v8::internal |
8014 | 7998 |
8015 #endif // V8_OBJECTS_INL_H_ | 7999 #endif // V8_OBJECTS_INL_H_ |
OLD | NEW |