Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(43)

Side by Side Diff: src/objects-inl.h

Issue 871253005: Use weak cells in dependent code. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Add comment Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 4702 matching lines...) Expand 10 before | Expand all | Expand 10 after
4713 if (length() == 0) return 0; 4713 if (length() == 0) return 0;
4714 return Smi::cast(get(group))->value(); 4714 return Smi::cast(get(group))->value();
4715 } 4715 }
4716 4716
4717 4717
4718 void DependentCode::set_number_of_entries(DependencyGroup group, int value) { 4718 void DependentCode::set_number_of_entries(DependencyGroup group, int value) {
4719 set(group, Smi::FromInt(value)); 4719 set(group, Smi::FromInt(value));
4720 } 4720 }
4721 4721
4722 4722
4723 bool DependentCode::is_code_at(int i) {
4724 return get(kCodesStartIndex + i)->IsCode();
4725 }
4726
4727 Code* DependentCode::code_at(int i) {
4728 return Code::cast(get(kCodesStartIndex + i));
4729 }
4730
4731
4732 CompilationInfo* DependentCode::compilation_info_at(int i) {
4733 return reinterpret_cast<CompilationInfo*>(
4734 Foreign::cast(get(kCodesStartIndex + i))->foreign_address());
4735 }
4736
4737
4738 void DependentCode::set_object_at(int i, Object* object) { 4723 void DependentCode::set_object_at(int i, Object* object) {
4739 set(kCodesStartIndex + i, object); 4724 set(kCodesStartIndex + i, object);
4740 } 4725 }
4741 4726
4742 4727
4743 Object* DependentCode::object_at(int i) { 4728 Object* DependentCode::object_at(int i) {
4744 return get(kCodesStartIndex + i); 4729 return get(kCodesStartIndex + i);
4745 } 4730 }
4746 4731
4747 4732
4748 Object** DependentCode::slot_at(int i) {
4749 return RawFieldOfElementAt(kCodesStartIndex + i);
4750 }
4751
4752
4753 void DependentCode::clear_at(int i) { 4733 void DependentCode::clear_at(int i) {
4754 set_undefined(kCodesStartIndex + i); 4734 set_undefined(kCodesStartIndex + i);
4755 } 4735 }
4756 4736
4757 4737
4758 void DependentCode::copy(int from, int to) { 4738 void DependentCode::copy(int from, int to) {
4759 set(kCodesStartIndex + to, get(kCodesStartIndex + from)); 4739 set(kCodesStartIndex + to, get(kCodesStartIndex + from));
4760 } 4740 }
4761 4741
4762 4742
(...skipping 2755 matching lines...) Expand 10 before | Expand all | Expand 10 after
7518 #undef READ_SHORT_FIELD 7498 #undef READ_SHORT_FIELD
7519 #undef WRITE_SHORT_FIELD 7499 #undef WRITE_SHORT_FIELD
7520 #undef READ_BYTE_FIELD 7500 #undef READ_BYTE_FIELD
7521 #undef WRITE_BYTE_FIELD 7501 #undef WRITE_BYTE_FIELD
7522 #undef NOBARRIER_READ_BYTE_FIELD 7502 #undef NOBARRIER_READ_BYTE_FIELD
7523 #undef NOBARRIER_WRITE_BYTE_FIELD 7503 #undef NOBARRIER_WRITE_BYTE_FIELD
7524 7504
7525 } } // namespace v8::internal 7505 } } // namespace v8::internal
7526 7506
7527 #endif // V8_OBJECTS_INL_H_ 7507 #endif // V8_OBJECTS_INL_H_
OLDNEW
« src/objects.cc ('K') | « src/objects-debug.cc ('k') | test/cctest/test-heap.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698