| OLD | NEW |
| 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 #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/allocation.h" | 10 #include "src/allocation.h" |
| (...skipping 1095 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1106 | 1106 |
| 1107 // Convert to a JSObject if needed. | 1107 // Convert to a JSObject if needed. |
| 1108 // native_context is used when creating wrapper object. | 1108 // native_context is used when creating wrapper object. |
| 1109 static inline MaybeHandle<JSReceiver> ToObject(Isolate* isolate, | 1109 static inline MaybeHandle<JSReceiver> ToObject(Isolate* isolate, |
| 1110 Handle<Object> object); | 1110 Handle<Object> object); |
| 1111 static MaybeHandle<JSReceiver> ToObject(Isolate* isolate, | 1111 static MaybeHandle<JSReceiver> ToObject(Isolate* isolate, |
| 1112 Handle<Object> object, | 1112 Handle<Object> object, |
| 1113 Handle<Context> context); | 1113 Handle<Context> context); |
| 1114 | 1114 |
| 1115 // Converts this to a Smi if possible. | 1115 // Converts this to a Smi if possible. |
| 1116 static MUST_USE_RESULT inline MaybeHandle<Smi> ToSmi(Isolate* isolate, | 1116 MUST_USE_RESULT static inline MaybeHandle<Smi> ToSmi(Isolate* isolate, |
| 1117 Handle<Object> object); | 1117 Handle<Object> object); |
| 1118 | 1118 |
| 1119 MUST_USE_RESULT static MaybeHandle<Object> GetProperty(LookupIterator* it); | 1119 MUST_USE_RESULT static MaybeHandle<Object> GetProperty(LookupIterator* it); |
| 1120 | 1120 |
| 1121 // Implementation of [[Put]], ECMA-262 5th edition, section 8.12.5. | 1121 // Implementation of [[Put]], ECMA-262 5th edition, section 8.12.5. |
| 1122 MUST_USE_RESULT static MaybeHandle<Object> SetProperty( | 1122 MUST_USE_RESULT static MaybeHandle<Object> SetProperty( |
| 1123 Handle<Object> object, Handle<Name> key, Handle<Object> value, | 1123 Handle<Object> object, Handle<Name> key, Handle<Object> value, |
| 1124 StrictMode strict_mode, | 1124 StrictMode strict_mode, |
| 1125 StoreFromKeyed store_mode = MAY_BE_STORE_FROM_KEYED); | 1125 StoreFromKeyed store_mode = MAY_BE_STORE_FROM_KEYED); |
| 1126 | 1126 |
| (...skipping 804 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1931 MUST_USE_RESULT static MaybeHandle<AccessorPair> GetOwnElementAccessorPair( | 1931 MUST_USE_RESULT static MaybeHandle<AccessorPair> GetOwnElementAccessorPair( |
| 1932 Handle<JSObject> object, uint32_t index); | 1932 Handle<JSObject> object, uint32_t index); |
| 1933 | 1933 |
| 1934 MUST_USE_RESULT static MaybeHandle<Object> SetFastElement( | 1934 MUST_USE_RESULT static MaybeHandle<Object> SetFastElement( |
| 1935 Handle<JSObject> object, | 1935 Handle<JSObject> object, |
| 1936 uint32_t index, | 1936 uint32_t index, |
| 1937 Handle<Object> value, | 1937 Handle<Object> value, |
| 1938 StrictMode strict_mode, | 1938 StrictMode strict_mode, |
| 1939 bool check_prototype); | 1939 bool check_prototype); |
| 1940 | 1940 |
| 1941 MUST_USE_RESULT static inline MaybeHandle<Object> SetOwnElement( |
| 1942 Handle<JSObject> object, uint32_t index, Handle<Object> value, |
| 1943 StrictMode strict_mode); |
| 1944 |
| 1941 MUST_USE_RESULT static MaybeHandle<Object> SetOwnElement( | 1945 MUST_USE_RESULT static MaybeHandle<Object> SetOwnElement( |
| 1942 Handle<JSObject> object, | 1946 Handle<JSObject> object, uint32_t index, Handle<Object> value, |
| 1943 uint32_t index, | 1947 PropertyAttributes attributes, StrictMode strict_mode); |
| 1944 Handle<Object> value, | |
| 1945 StrictMode strict_mode); | |
| 1946 | 1948 |
| 1947 // Empty handle is returned if the element cannot be set to the given value. | 1949 // Empty handle is returned if the element cannot be set to the given value. |
| 1948 MUST_USE_RESULT static MaybeHandle<Object> SetElement( | 1950 MUST_USE_RESULT static MaybeHandle<Object> SetElement( |
| 1949 Handle<JSObject> object, | 1951 Handle<JSObject> object, |
| 1950 uint32_t index, | 1952 uint32_t index, |
| 1951 Handle<Object> value, | 1953 Handle<Object> value, |
| 1952 PropertyAttributes attributes, | 1954 PropertyAttributes attributes, |
| 1953 StrictMode strict_mode, | 1955 StrictMode strict_mode, |
| 1954 bool check_prototype = true, | 1956 bool check_prototype = true, |
| 1955 SetPropertyMode set_mode = SET_PROPERTY); | 1957 SetPropertyMode set_mode = SET_PROPERTY); |
| (...skipping 9020 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 10976 } else { | 10978 } else { |
| 10977 value &= ~(1 << bit_position); | 10979 value &= ~(1 << bit_position); |
| 10978 } | 10980 } |
| 10979 return value; | 10981 return value; |
| 10980 } | 10982 } |
| 10981 }; | 10983 }; |
| 10982 | 10984 |
| 10983 } } // namespace v8::internal | 10985 } } // namespace v8::internal |
| 10984 | 10986 |
| 10985 #endif // V8_OBJECTS_H_ | 10987 #endif // V8_OBJECTS_H_ |
| OLD | NEW |