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

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

Issue 1497483004: [proxies] Make Array.isArray respect proxies. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years 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/mjsunit/array-isarray.js » ('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 161 matching lines...) Expand 10 before | Expand all | Expand 10 after
172 return Object::IsHeapObject() && 172 return Object::IsHeapObject() &&
173 HeapObject::cast(this)->map()->instance_type() <= LAST_NAME_TYPE; 173 HeapObject::cast(this)->map()->instance_type() <= LAST_NAME_TYPE;
174 } 174 }
175 175
176 176
177 bool Object::IsUniqueName() const { 177 bool Object::IsUniqueName() const {
178 return IsInternalizedString() || IsSymbol(); 178 return IsInternalizedString() || IsSymbol();
179 } 179 }
180 180
181 181
182 Maybe<bool> Object::IsArray() const {
Benedikt Meurer 2015/12/03 10:38:53 Mhm, given that this can throw, we probably should
jochen (gone - plz use gerrit) 2015/12/03 10:40:53 there needs to be a way to figure out whether some
183 if (this->IsJSArray()) return Just(true);
184 if (this->IsJSProxy()) {
185 const JSProxy* proxy = JSProxy::cast(this);
186 if (proxy->IsRevoked()) {
187 Isolate* isolate = proxy->GetIsolate();
188 isolate->Throw(*isolate->factory()->NewTypeError(
189 MessageTemplate::kProxyRevoked,
190 isolate->factory()->NewStringFromAsciiChecked("IsArray")));
191 return Nothing<bool>();
192 }
193 return proxy->target()->IsArray();
194 }
195 return Just(false);
196 }
197
198
182 bool Object::IsCallable() const { 199 bool Object::IsCallable() const {
183 return Object::IsHeapObject() && HeapObject::cast(this)->map()->is_callable(); 200 return Object::IsHeapObject() && HeapObject::cast(this)->map()->is_callable();
184 } 201 }
185 202
186 203
187 bool Object::IsConstructor() const { 204 bool Object::IsConstructor() const {
188 return Object::IsHeapObject() && 205 return Object::IsHeapObject() &&
189 HeapObject::cast(this)->map()->is_constructor(); 206 HeapObject::cast(this)->map()->is_constructor();
190 } 207 }
191 208
(...skipping 7657 matching lines...) Expand 10 before | Expand all | Expand 10 after
7849 #undef WRITE_INT64_FIELD 7866 #undef WRITE_INT64_FIELD
7850 #undef READ_BYTE_FIELD 7867 #undef READ_BYTE_FIELD
7851 #undef WRITE_BYTE_FIELD 7868 #undef WRITE_BYTE_FIELD
7852 #undef NOBARRIER_READ_BYTE_FIELD 7869 #undef NOBARRIER_READ_BYTE_FIELD
7853 #undef NOBARRIER_WRITE_BYTE_FIELD 7870 #undef NOBARRIER_WRITE_BYTE_FIELD
7854 7871
7855 } // namespace internal 7872 } // namespace internal
7856 } // namespace v8 7873 } // namespace v8
7857 7874
7858 #endif // V8_OBJECTS_INL_H_ 7875 #endif // V8_OBJECTS_INL_H_
OLDNEW
« no previous file with comments | « src/objects.cc ('k') | test/mjsunit/array-isarray.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698