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

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

Issue 2021373002: Refactor Maps' code_cache (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: windows don't want no constexpr Created 4 years, 6 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
« no previous file with comments | « src/objects.cc ('k') | test/cctest/BUILD.gn » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 4679 matching lines...) Expand 10 before | Expand all | Expand 10 after
4690 4690
4691 4691
4692 bool Map::is_stable() { 4692 bool Map::is_stable() {
4693 return !IsUnstable::decode(bit_field3()); 4693 return !IsUnstable::decode(bit_field3());
4694 } 4694 }
4695 4695
4696 4696
4697 bool Map::has_code_cache() { 4697 bool Map::has_code_cache() {
4698 // Code caches are always fixed arrays. The empty fixed array is used as a 4698 // Code caches are always fixed arrays. The empty fixed array is used as a
4699 // sentinel for an absent code cache. 4699 // sentinel for an absent code cache.
4700 return FixedArray::cast(code_cache())->length() != 0; 4700 return code_cache()->length() != 0;
4701 } 4701 }
4702 4702
4703 4703
4704 bool Map::CanBeDeprecated() { 4704 bool Map::CanBeDeprecated() {
4705 int descriptor = LastAdded(); 4705 int descriptor = LastAdded();
4706 for (int i = 0; i <= descriptor; i++) { 4706 for (int i = 0; i <= descriptor; i++) {
4707 PropertyDetails details = instance_descriptors()->GetDetails(i); 4707 PropertyDetails details = instance_descriptors()->GetDetails(i);
4708 if (details.representation().IsNone()) return true; 4708 if (details.representation().IsNone()) return true;
4709 if (details.representation().IsSmi()) return true; 4709 if (details.representation().IsSmi()) return true;
4710 if (details.representation().IsDouble()) return true; 4710 if (details.representation().IsDouble()) return true;
(...skipping 713 matching lines...) Expand 10 before | Expand all | Expand 10 after
5424 5424
5425 5425
5426 void Map::SetBackPointer(Object* value, WriteBarrierMode mode) { 5426 void Map::SetBackPointer(Object* value, WriteBarrierMode mode) {
5427 DCHECK(instance_type() >= FIRST_JS_RECEIVER_TYPE); 5427 DCHECK(instance_type() >= FIRST_JS_RECEIVER_TYPE);
5428 DCHECK((value->IsMap() && GetBackPointer()->IsUndefined())); 5428 DCHECK((value->IsMap() && GetBackPointer()->IsUndefined()));
5429 DCHECK(!value->IsMap() || 5429 DCHECK(!value->IsMap() ||
5430 Map::cast(value)->GetConstructor() == constructor_or_backpointer()); 5430 Map::cast(value)->GetConstructor() == constructor_or_backpointer());
5431 set_constructor_or_backpointer(value, mode); 5431 set_constructor_or_backpointer(value, mode);
5432 } 5432 }
5433 5433
5434 5434 ACCESSORS(Map, code_cache, FixedArray, kCodeCacheOffset)
5435 ACCESSORS(Map, code_cache, Object, kCodeCacheOffset)
5436 ACCESSORS(Map, dependent_code, DependentCode, kDependentCodeOffset) 5435 ACCESSORS(Map, dependent_code, DependentCode, kDependentCodeOffset)
5437 ACCESSORS(Map, weak_cell_cache, Object, kWeakCellCacheOffset) 5436 ACCESSORS(Map, weak_cell_cache, Object, kWeakCellCacheOffset)
5438 ACCESSORS(Map, constructor_or_backpointer, Object, 5437 ACCESSORS(Map, constructor_or_backpointer, Object,
5439 kConstructorOrBackPointerOffset) 5438 kConstructorOrBackPointerOffset)
5440 5439
5441 5440
5442 Object* Map::GetConstructor() const { 5441 Object* Map::GetConstructor() const {
5443 Object* maybe_constructor = constructor_or_backpointer(); 5442 Object* maybe_constructor = constructor_or_backpointer();
5444 // Follow any back pointers. 5443 // Follow any back pointers.
5445 while (maybe_constructor->IsMap()) { 5444 while (maybe_constructor->IsMap()) {
(...skipping 2461 matching lines...) Expand 10 before | Expand all | Expand 10 after
7907 #undef WRITE_INT64_FIELD 7906 #undef WRITE_INT64_FIELD
7908 #undef READ_BYTE_FIELD 7907 #undef READ_BYTE_FIELD
7909 #undef WRITE_BYTE_FIELD 7908 #undef WRITE_BYTE_FIELD
7910 #undef NOBARRIER_READ_BYTE_FIELD 7909 #undef NOBARRIER_READ_BYTE_FIELD
7911 #undef NOBARRIER_WRITE_BYTE_FIELD 7910 #undef NOBARRIER_WRITE_BYTE_FIELD
7912 7911
7913 } // namespace internal 7912 } // namespace internal
7914 } // namespace v8 7913 } // namespace v8
7915 7914
7916 #endif // V8_OBJECTS_INL_H_ 7915 #endif // V8_OBJECTS_INL_H_
OLDNEW
« no previous file with comments | « src/objects.cc ('k') | test/cctest/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698