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

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

Issue 2622723003: [compiler] Support Object.create(null) inlining in TF (Closed)
Patch Set: initializing all object fields Created 3 years, 11 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') | src/runtime/runtime-array.cc » ('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 2201 matching lines...) Expand 10 before | Expand all | Expand 10 after
2212 default: 2212 default:
2213 if (type >= FIRST_ARRAY_ITERATOR_TYPE && 2213 if (type >= FIRST_ARRAY_ITERATOR_TYPE &&
2214 type <= LAST_ARRAY_ITERATOR_TYPE) { 2214 type <= LAST_ARRAY_ITERATOR_TYPE) {
2215 return JSArrayIterator::kSize; 2215 return JSArrayIterator::kSize;
2216 } 2216 }
2217 UNREACHABLE(); 2217 UNREACHABLE();
2218 return 0; 2218 return 0;
2219 } 2219 }
2220 } 2220 }
2221 2221
2222 inline bool IsSpecialReceiverInstanceType(InstanceType instance_type) {
2223 return instance_type <= LAST_SPECIAL_RECEIVER_TYPE;
2224 }
2222 2225
2223 int JSObject::GetInternalFieldCount(Map* map) { 2226 int JSObject::GetInternalFieldCount(Map* map) {
2224 int instance_size = map->instance_size(); 2227 int instance_size = map->instance_size();
2225 if (instance_size == kVariableSizeSentinel) return 0; 2228 if (instance_size == kVariableSizeSentinel) return 0;
2226 InstanceType instance_type = map->instance_type(); 2229 InstanceType instance_type = map->instance_type();
2227 return ((instance_size - GetHeaderSize(instance_type)) >> kPointerSizeLog2) - 2230 return ((instance_size - GetHeaderSize(instance_type)) >> kPointerSizeLog2) -
2228 map->GetInObjectProperties(); 2231 map->GetInObjectProperties();
2229 } 2232 }
2230 2233
2231 2234
(...skipping 2707 matching lines...) Expand 10 before | Expand all | Expand 10 after
4939 bool Map::IsJSProxyMap() { return instance_type() == JS_PROXY_TYPE; } 4942 bool Map::IsJSProxyMap() { return instance_type() == JS_PROXY_TYPE; }
4940 bool Map::IsJSGlobalProxyMap() { 4943 bool Map::IsJSGlobalProxyMap() {
4941 return instance_type() == JS_GLOBAL_PROXY_TYPE; 4944 return instance_type() == JS_GLOBAL_PROXY_TYPE;
4942 } 4945 }
4943 bool Map::IsJSGlobalObjectMap() { 4946 bool Map::IsJSGlobalObjectMap() {
4944 return instance_type() == JS_GLOBAL_OBJECT_TYPE; 4947 return instance_type() == JS_GLOBAL_OBJECT_TYPE;
4945 } 4948 }
4946 bool Map::IsJSTypedArrayMap() { return instance_type() == JS_TYPED_ARRAY_TYPE; } 4949 bool Map::IsJSTypedArrayMap() { return instance_type() == JS_TYPED_ARRAY_TYPE; }
4947 bool Map::IsJSDataViewMap() { return instance_type() == JS_DATA_VIEW_TYPE; } 4950 bool Map::IsJSDataViewMap() { return instance_type() == JS_DATA_VIEW_TYPE; }
4948 4951
4952 bool Map::IsSpecialReceiverMap() {
4953 bool result = IsSpecialReceiverInstanceType(instance_type());
4954 DCHECK_IMPLIES(!result,
4955 !has_named_interceptor() && !is_access_check_needed());
4956 return result;
4957 }
4949 4958
4950 bool Map::CanOmitMapChecks() { 4959 bool Map::CanOmitMapChecks() {
4951 return is_stable() && FLAG_omit_map_checks_for_leaf_maps; 4960 return is_stable() && FLAG_omit_map_checks_for_leaf_maps;
4952 } 4961 }
4953 4962
4954 4963
4955 DependentCode* DependentCode::next_link() { 4964 DependentCode* DependentCode::next_link() {
4956 return DependentCode::cast(get(kNextLinkIndex)); 4965 return DependentCode::cast(get(kNextLinkIndex));
4957 } 4966 }
4958 4967
(...skipping 3479 matching lines...) Expand 10 before | Expand all | Expand 10 after
8438 #undef WRITE_INT64_FIELD 8447 #undef WRITE_INT64_FIELD
8439 #undef READ_BYTE_FIELD 8448 #undef READ_BYTE_FIELD
8440 #undef WRITE_BYTE_FIELD 8449 #undef WRITE_BYTE_FIELD
8441 #undef NOBARRIER_READ_BYTE_FIELD 8450 #undef NOBARRIER_READ_BYTE_FIELD
8442 #undef NOBARRIER_WRITE_BYTE_FIELD 8451 #undef NOBARRIER_WRITE_BYTE_FIELD
8443 8452
8444 } // namespace internal 8453 } // namespace internal
8445 } // namespace v8 8454 } // namespace v8
8446 8455
8447 #endif // V8_OBJECTS_INL_H_ 8456 #endif // V8_OBJECTS_INL_H_
OLDNEW
« no previous file with comments | « src/objects.cc ('k') | src/runtime/runtime-array.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698