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

Side by Side Diff: src/objects.h

Issue 2152693002: [stubs] Introduce NonPrimitiveToPrimitive builtin. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Address comments. Created 4 years, 5 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/globals.h ('k') | src/objects.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 2015 the V8 project authors. All rights reserved. 1 // Copyright 2015 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 #ifndef V8_OBJECTS_H_ 5 #ifndef V8_OBJECTS_H_
6 #define V8_OBJECTS_H_ 6 #define V8_OBJECTS_H_
7 7
8 #include <iosfwd> 8 #include <iosfwd>
9 9
10 #include "src/assert-scope.h" 10 #include "src/assert-scope.h"
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
162 STORE_TRANSITION_TO_OBJECT, 162 STORE_TRANSITION_TO_OBJECT,
163 STORE_TRANSITION_TO_DOUBLE, 163 STORE_TRANSITION_TO_DOUBLE,
164 STORE_AND_GROW_NO_TRANSITION, 164 STORE_AND_GROW_NO_TRANSITION,
165 STORE_AND_GROW_TRANSITION_TO_OBJECT, 165 STORE_AND_GROW_TRANSITION_TO_OBJECT,
166 STORE_AND_GROW_TRANSITION_TO_DOUBLE, 166 STORE_AND_GROW_TRANSITION_TO_DOUBLE,
167 STORE_NO_TRANSITION_IGNORE_OUT_OF_BOUNDS, 167 STORE_NO_TRANSITION_IGNORE_OUT_OF_BOUNDS,
168 STORE_NO_TRANSITION_HANDLE_COW 168 STORE_NO_TRANSITION_HANDLE_COW
169 }; 169 };
170 170
171 171
172 // Valid hints for the abstract operation ToPrimitive,
173 // implemented according to ES6, section 7.1.1.
174 enum class ToPrimitiveHint { kDefault, kNumber, kString };
175
176
177 // Valid hints for the abstract operation OrdinaryToPrimitive,
178 // implemented according to ES6, section 7.1.1.
179 enum class OrdinaryToPrimitiveHint { kNumber, kString };
180
181
182 enum TypeofMode : int { INSIDE_TYPEOF, NOT_INSIDE_TYPEOF }; 172 enum TypeofMode : int { INSIDE_TYPEOF, NOT_INSIDE_TYPEOF };
183 173
184 174
185 enum MutableMode { 175 enum MutableMode {
186 MUTABLE, 176 MUTABLE,
187 IMMUTABLE 177 IMMUTABLE
188 }; 178 };
189 179
190 180
191 enum ExternalArrayType { 181 enum ExternalArrayType {
(...skipping 1646 matching lines...) Expand 10 before | Expand all | Expand 10 after
1838 // Deletes an existing named property in a normalized object. 1828 // Deletes an existing named property in a normalized object.
1839 static void DeleteNormalizedProperty(Handle<JSReceiver> object, 1829 static void DeleteNormalizedProperty(Handle<JSReceiver> object,
1840 Handle<Name> name, int entry); 1830 Handle<Name> name, int entry);
1841 1831
1842 DECLARE_CAST(JSReceiver) 1832 DECLARE_CAST(JSReceiver)
1843 1833
1844 // ES6 section 7.1.1 ToPrimitive 1834 // ES6 section 7.1.1 ToPrimitive
1845 MUST_USE_RESULT static MaybeHandle<Object> ToPrimitive( 1835 MUST_USE_RESULT static MaybeHandle<Object> ToPrimitive(
1846 Handle<JSReceiver> receiver, 1836 Handle<JSReceiver> receiver,
1847 ToPrimitiveHint hint = ToPrimitiveHint::kDefault); 1837 ToPrimitiveHint hint = ToPrimitiveHint::kDefault);
1838
1839 // ES6 section 7.1.1.1 OrdinaryToPrimitive
1848 MUST_USE_RESULT static MaybeHandle<Object> OrdinaryToPrimitive( 1840 MUST_USE_RESULT static MaybeHandle<Object> OrdinaryToPrimitive(
1849 Handle<JSReceiver> receiver, OrdinaryToPrimitiveHint hint); 1841 Handle<JSReceiver> receiver, OrdinaryToPrimitiveHint hint);
1850 1842
1851 static MaybeHandle<Context> GetFunctionRealm(Handle<JSReceiver> receiver); 1843 static MaybeHandle<Context> GetFunctionRealm(Handle<JSReceiver> receiver);
1852 1844
1853 // Get the first non-hidden prototype. 1845 // Get the first non-hidden prototype.
1854 static inline MaybeHandle<Object> GetPrototype(Isolate* isolate, 1846 static inline MaybeHandle<Object> GetPrototype(Isolate* isolate,
1855 Handle<JSReceiver> receiver); 1847 Handle<JSReceiver> receiver);
1856 1848
1857 MUST_USE_RESULT static Maybe<bool> HasInPrototypeChain( 1849 MUST_USE_RESULT static Maybe<bool> HasInPrototypeChain(
(...skipping 9134 matching lines...) Expand 10 before | Expand all | Expand 10 after
10992 } 10984 }
10993 return value; 10985 return value;
10994 } 10986 }
10995 }; 10987 };
10996 10988
10997 10989
10998 } // NOLINT, false-positive due to second-order macros. 10990 } // NOLINT, false-positive due to second-order macros.
10999 } // NOLINT, false-positive due to second-order macros. 10991 } // NOLINT, false-positive due to second-order macros.
11000 10992
11001 #endif // V8_OBJECTS_H_ 10993 #endif // V8_OBJECTS_H_
OLDNEW
« no previous file with comments | « src/globals.h ('k') | src/objects.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698