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

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

Issue 2080243003: Use instance type in Object.prototype.toString(). (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Add TODO comment about checking IsArray() before reading toStringTag. 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-debug.cc ('k') | src/types.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 2050 matching lines...) Expand 10 before | Expand all | Expand 10 after
2061 case JS_WEAK_SET_TYPE: 2061 case JS_WEAK_SET_TYPE:
2062 return JSWeakSet::kSize; 2062 return JSWeakSet::kSize;
2063 case JS_PROMISE_TYPE: 2063 case JS_PROMISE_TYPE:
2064 return JSObject::kHeaderSize; 2064 return JSObject::kHeaderSize;
2065 case JS_REGEXP_TYPE: 2065 case JS_REGEXP_TYPE:
2066 return JSRegExp::kSize; 2066 return JSRegExp::kSize;
2067 case JS_CONTEXT_EXTENSION_OBJECT_TYPE: 2067 case JS_CONTEXT_EXTENSION_OBJECT_TYPE:
2068 return JSObject::kHeaderSize; 2068 return JSObject::kHeaderSize;
2069 case JS_MESSAGE_OBJECT_TYPE: 2069 case JS_MESSAGE_OBJECT_TYPE:
2070 return JSMessageObject::kSize; 2070 return JSMessageObject::kSize;
2071 case JS_ARGUMENTS_TYPE:
2072 return JSArgumentsObject::kHeaderSize;
2073 case JS_ERROR_TYPE:
2074 return JSObject::kHeaderSize;
2071 default: 2075 default:
2072 UNREACHABLE(); 2076 UNREACHABLE();
2073 return 0; 2077 return 0;
2074 } 2078 }
2075 } 2079 }
2076 2080
2077 2081
2078 int JSObject::GetInternalFieldCount(Map* map) { 2082 int JSObject::GetInternalFieldCount(Map* map) {
2079 int instance_size = map->instance_size(); 2083 int instance_size = map->instance_size();
2080 if (instance_size == kVariableSizeSentinel) return 0; 2084 if (instance_size == kVariableSizeSentinel) return 0;
(...skipping 5849 matching lines...) Expand 10 before | Expand all | Expand 10 after
7930 #undef WRITE_INT64_FIELD 7934 #undef WRITE_INT64_FIELD
7931 #undef READ_BYTE_FIELD 7935 #undef READ_BYTE_FIELD
7932 #undef WRITE_BYTE_FIELD 7936 #undef WRITE_BYTE_FIELD
7933 #undef NOBARRIER_READ_BYTE_FIELD 7937 #undef NOBARRIER_READ_BYTE_FIELD
7934 #undef NOBARRIER_WRITE_BYTE_FIELD 7938 #undef NOBARRIER_WRITE_BYTE_FIELD
7935 7939
7936 } // namespace internal 7940 } // namespace internal
7937 } // namespace v8 7941 } // namespace v8
7938 7942
7939 #endif // V8_OBJECTS_INL_H_ 7943 #endif // V8_OBJECTS_INL_H_
OLDNEW
« no previous file with comments | « src/objects-debug.cc ('k') | src/types.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698