| 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 1296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1307 TRACK_ALLOCATION_SITE; | 1307 TRACK_ALLOCATION_SITE; |
| 1308 } | 1308 } |
| 1309 return false; | 1309 return false; |
| 1310 } | 1310 } |
| 1311 | 1311 |
| 1312 | 1312 |
| 1313 void AllocationSite::Initialize() { | 1313 void AllocationSite::Initialize() { |
| 1314 set_transition_info(Smi::FromInt(0)); | 1314 set_transition_info(Smi::FromInt(0)); |
| 1315 SetElementsKind(GetInitialFastElementsKind()); | 1315 SetElementsKind(GetInitialFastElementsKind()); |
| 1316 set_nested_site(Smi::FromInt(0)); | 1316 set_nested_site(Smi::FromInt(0)); |
| 1317 set_memento_create_count(Smi::FromInt(0)); |
| 1318 set_memento_found_count(Smi::FromInt(0)); |
| 1319 set_pretenure_decision(Smi::FromInt(0)); |
| 1317 set_dependent_code(DependentCode::cast(GetHeap()->empty_fixed_array()), | 1320 set_dependent_code(DependentCode::cast(GetHeap()->empty_fixed_array()), |
| 1318 SKIP_WRITE_BARRIER); | 1321 SKIP_WRITE_BARRIER); |
| 1319 } | 1322 } |
| 1320 | 1323 |
| 1321 | 1324 |
| 1322 // Heuristic: We only need to create allocation site info if the boilerplate | 1325 // Heuristic: We only need to create allocation site info if the boilerplate |
| 1323 // elements kind is the initial elements kind. | 1326 // elements kind is the initial elements kind. |
| 1324 AllocationSiteMode AllocationSite::GetMode( | 1327 AllocationSiteMode AllocationSite::GetMode( |
| 1325 ElementsKind boilerplate_elements_kind) { | 1328 ElementsKind boilerplate_elements_kind) { |
| 1326 if (FLAG_track_allocation_sites && | 1329 if (FLAG_track_allocation_sites && |
| (...skipping 2540 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3867 | 3870 |
| 3868 | 3871 |
| 3869 inline void Code::set_is_crankshafted(bool value) { | 3872 inline void Code::set_is_crankshafted(bool value) { |
| 3870 int previous = READ_UINT32_FIELD(this, kKindSpecificFlags2Offset); | 3873 int previous = READ_UINT32_FIELD(this, kKindSpecificFlags2Offset); |
| 3871 int updated = IsCrankshaftedField::update(previous, value); | 3874 int updated = IsCrankshaftedField::update(previous, value); |
| 3872 WRITE_UINT32_FIELD(this, kKindSpecificFlags2Offset, updated); | 3875 WRITE_UINT32_FIELD(this, kKindSpecificFlags2Offset, updated); |
| 3873 } | 3876 } |
| 3874 | 3877 |
| 3875 | 3878 |
| 3876 int Code::major_key() { | 3879 int Code::major_key() { |
| 3877 ASSERT(kind() == STUB || | 3880 ASSERT(has_major_key()); |
| 3878 kind() == HANDLER || | |
| 3879 kind() == BINARY_OP_IC || | |
| 3880 kind() == COMPARE_IC || | |
| 3881 kind() == COMPARE_NIL_IC || | |
| 3882 kind() == STORE_IC || | |
| 3883 kind() == LOAD_IC || | |
| 3884 kind() == KEYED_LOAD_IC || | |
| 3885 kind() == KEYED_CALL_IC || | |
| 3886 kind() == TO_BOOLEAN_IC); | |
| 3887 return StubMajorKeyField::decode( | 3881 return StubMajorKeyField::decode( |
| 3888 READ_UINT32_FIELD(this, kKindSpecificFlags2Offset)); | 3882 READ_UINT32_FIELD(this, kKindSpecificFlags2Offset)); |
| 3889 } | 3883 } |
| 3890 | 3884 |
| 3891 | 3885 |
| 3892 void Code::set_major_key(int major) { | 3886 void Code::set_major_key(int major) { |
| 3893 ASSERT(kind() == STUB || | 3887 ASSERT(has_major_key()); |
| 3894 kind() == HANDLER || | |
| 3895 kind() == BINARY_OP_IC || | |
| 3896 kind() == COMPARE_IC || | |
| 3897 kind() == COMPARE_NIL_IC || | |
| 3898 kind() == LOAD_IC || | |
| 3899 kind() == KEYED_LOAD_IC || | |
| 3900 kind() == STORE_IC || | |
| 3901 kind() == KEYED_STORE_IC || | |
| 3902 kind() == KEYED_CALL_IC || | |
| 3903 kind() == TO_BOOLEAN_IC); | |
| 3904 ASSERT(0 <= major && major < 256); | 3888 ASSERT(0 <= major && major < 256); |
| 3905 int previous = READ_UINT32_FIELD(this, kKindSpecificFlags2Offset); | 3889 int previous = READ_UINT32_FIELD(this, kKindSpecificFlags2Offset); |
| 3906 int updated = StubMajorKeyField::update(previous, major); | 3890 int updated = StubMajorKeyField::update(previous, major); |
| 3907 WRITE_UINT32_FIELD(this, kKindSpecificFlags2Offset, updated); | 3891 WRITE_UINT32_FIELD(this, kKindSpecificFlags2Offset, updated); |
| 3908 } | 3892 } |
| 3909 | 3893 |
| 3910 | 3894 |
| 3895 bool Code::has_major_key() { |
| 3896 return kind() == STUB || |
| 3897 kind() == HANDLER || |
| 3898 kind() == BINARY_OP_IC || |
| 3899 kind() == COMPARE_IC || |
| 3900 kind() == COMPARE_NIL_IC || |
| 3901 kind() == LOAD_IC || |
| 3902 kind() == KEYED_LOAD_IC || |
| 3903 kind() == STORE_IC || |
| 3904 kind() == KEYED_STORE_IC || |
| 3905 kind() == KEYED_CALL_IC || |
| 3906 kind() == TO_BOOLEAN_IC; |
| 3907 } |
| 3908 |
| 3909 |
| 3911 bool Code::is_pregenerated() { | 3910 bool Code::is_pregenerated() { |
| 3912 return (kind() == STUB && IsPregeneratedField::decode(flags())); | 3911 return (kind() == STUB && IsPregeneratedField::decode(flags())); |
| 3913 } | 3912 } |
| 3914 | 3913 |
| 3915 | 3914 |
| 3916 void Code::set_is_pregenerated(bool value) { | 3915 void Code::set_is_pregenerated(bool value) { |
| 3917 ASSERT(kind() == STUB); | 3916 ASSERT(kind() == STUB); |
| 3918 Flags f = flags(); | 3917 Flags f = flags(); |
| 3919 f = static_cast<Flags>(IsPregeneratedField::update(f, value)); | 3918 f = static_cast<Flags>(IsPregeneratedField::update(f, value)); |
| 3920 set_flags(f); | 3919 set_flags(f); |
| (...skipping 624 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4545 ACCESSORS(ObjectTemplateInfo, internal_field_count, Object, | 4544 ACCESSORS(ObjectTemplateInfo, internal_field_count, Object, |
| 4546 kInternalFieldCountOffset) | 4545 kInternalFieldCountOffset) |
| 4547 | 4546 |
| 4548 ACCESSORS(SignatureInfo, receiver, Object, kReceiverOffset) | 4547 ACCESSORS(SignatureInfo, receiver, Object, kReceiverOffset) |
| 4549 ACCESSORS(SignatureInfo, args, Object, kArgsOffset) | 4548 ACCESSORS(SignatureInfo, args, Object, kArgsOffset) |
| 4550 | 4549 |
| 4551 ACCESSORS(TypeSwitchInfo, types, Object, kTypesOffset) | 4550 ACCESSORS(TypeSwitchInfo, types, Object, kTypesOffset) |
| 4552 | 4551 |
| 4553 ACCESSORS(AllocationSite, transition_info, Object, kTransitionInfoOffset) | 4552 ACCESSORS(AllocationSite, transition_info, Object, kTransitionInfoOffset) |
| 4554 ACCESSORS(AllocationSite, nested_site, Object, kNestedSiteOffset) | 4553 ACCESSORS(AllocationSite, nested_site, Object, kNestedSiteOffset) |
| 4554 ACCESSORS_TO_SMI(AllocationSite, memento_found_count, kMementoFoundCountOffset) |
| 4555 ACCESSORS_TO_SMI(AllocationSite, memento_create_count, |
| 4556 kMementoCreateCountOffset) |
| 4557 ACCESSORS_TO_SMI(AllocationSite, pretenure_decision, kPretenureDecisionOffset) |
| 4555 ACCESSORS(AllocationSite, dependent_code, DependentCode, | 4558 ACCESSORS(AllocationSite, dependent_code, DependentCode, |
| 4556 kDependentCodeOffset) | 4559 kDependentCodeOffset) |
| 4557 ACCESSORS(AllocationSite, weak_next, Object, kWeakNextOffset) | 4560 ACCESSORS(AllocationSite, weak_next, Object, kWeakNextOffset) |
| 4558 ACCESSORS(AllocationMemento, allocation_site, Object, kAllocationSiteOffset) | 4561 ACCESSORS(AllocationMemento, allocation_site, Object, kAllocationSiteOffset) |
| 4559 | 4562 |
| 4560 ACCESSORS(Script, source, Object, kSourceOffset) | 4563 ACCESSORS(Script, source, Object, kSourceOffset) |
| 4561 ACCESSORS(Script, name, Object, kNameOffset) | 4564 ACCESSORS(Script, name, Object, kNameOffset) |
| 4562 ACCESSORS(Script, id, Smi, kIdOffset) | 4565 ACCESSORS(Script, id, Smi, kIdOffset) |
| 4563 ACCESSORS_TO_SMI(Script, line_offset, kLineOffsetOffset) | 4566 ACCESSORS_TO_SMI(Script, line_offset, kLineOffsetOffset) |
| 4564 ACCESSORS_TO_SMI(Script, column_offset, kColumnOffsetOffset) | 4567 ACCESSORS_TO_SMI(Script, column_offset, kColumnOffsetOffset) |
| (...skipping 884 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5449 bool JSArrayBuffer::is_external() { | 5452 bool JSArrayBuffer::is_external() { |
| 5450 return BooleanBit::get(flag(), kIsExternalBit); | 5453 return BooleanBit::get(flag(), kIsExternalBit); |
| 5451 } | 5454 } |
| 5452 | 5455 |
| 5453 | 5456 |
| 5454 void JSArrayBuffer::set_is_external(bool value) { | 5457 void JSArrayBuffer::set_is_external(bool value) { |
| 5455 set_flag(BooleanBit::set(flag(), kIsExternalBit, value)); | 5458 set_flag(BooleanBit::set(flag(), kIsExternalBit, value)); |
| 5456 } | 5459 } |
| 5457 | 5460 |
| 5458 | 5461 |
| 5462 bool JSArrayBuffer::should_be_freed() { |
| 5463 return BooleanBit::get(flag(), kShouldBeFreed); |
| 5464 } |
| 5465 |
| 5466 |
| 5467 void JSArrayBuffer::set_should_be_freed(bool value) { |
| 5468 set_flag(BooleanBit::set(flag(), kShouldBeFreed, value)); |
| 5469 } |
| 5470 |
| 5471 |
| 5459 ACCESSORS(JSArrayBuffer, weak_next, Object, kWeakNextOffset) | 5472 ACCESSORS(JSArrayBuffer, weak_next, Object, kWeakNextOffset) |
| 5460 ACCESSORS(JSArrayBuffer, weak_first_view, Object, kWeakFirstViewOffset) | 5473 ACCESSORS(JSArrayBuffer, weak_first_view, Object, kWeakFirstViewOffset) |
| 5461 | 5474 |
| 5462 | 5475 |
| 5463 ACCESSORS(JSArrayBufferView, buffer, Object, kBufferOffset) | 5476 ACCESSORS(JSArrayBufferView, buffer, Object, kBufferOffset) |
| 5464 ACCESSORS(JSArrayBufferView, byte_offset, Object, kByteOffsetOffset) | 5477 ACCESSORS(JSArrayBufferView, byte_offset, Object, kByteOffsetOffset) |
| 5465 ACCESSORS(JSArrayBufferView, byte_length, Object, kByteLengthOffset) | 5478 ACCESSORS(JSArrayBufferView, byte_length, Object, kByteLengthOffset) |
| 5466 ACCESSORS(JSArrayBufferView, weak_next, Object, kWeakNextOffset) | 5479 ACCESSORS(JSArrayBufferView, weak_next, Object, kWeakNextOffset) |
| 5467 ACCESSORS(JSTypedArray, length, Object, kLengthOffset) | 5480 ACCESSORS(JSTypedArray, length, Object, kLengthOffset) |
| 5468 | 5481 |
| (...skipping 942 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6411 #undef WRITE_UINT32_FIELD | 6424 #undef WRITE_UINT32_FIELD |
| 6412 #undef READ_SHORT_FIELD | 6425 #undef READ_SHORT_FIELD |
| 6413 #undef WRITE_SHORT_FIELD | 6426 #undef WRITE_SHORT_FIELD |
| 6414 #undef READ_BYTE_FIELD | 6427 #undef READ_BYTE_FIELD |
| 6415 #undef WRITE_BYTE_FIELD | 6428 #undef WRITE_BYTE_FIELD |
| 6416 | 6429 |
| 6417 | 6430 |
| 6418 } } // namespace v8::internal | 6431 } } // namespace v8::internal |
| 6419 | 6432 |
| 6420 #endif // V8_OBJECTS_INL_H_ | 6433 #endif // V8_OBJECTS_INL_H_ |
| OLD | NEW |