| OLD | NEW |
| 1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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 #include "src/v8.h" | 5 #include "src/v8.h" |
| 6 | 6 |
| 7 #include "src/accessors.h" | 7 #include "src/accessors.h" |
| 8 #include "src/allocation-site-scopes.h" | 8 #include "src/allocation-site-scopes.h" |
| 9 #include "src/api.h" | 9 #include "src/api.h" |
| 10 #include "src/arguments.h" | 10 #include "src/arguments.h" |
| (...skipping 12148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 12159 uint32_t arg_count, | 12159 uint32_t arg_count, |
| 12160 EnsureElementsMode mode) { | 12160 EnsureElementsMode mode) { |
| 12161 // Elements in |Arguments| are ordered backwards (because they're on the | 12161 // Elements in |Arguments| are ordered backwards (because they're on the |
| 12162 // stack), but the method that's called here iterates over them in forward | 12162 // stack), but the method that's called here iterates over them in forward |
| 12163 // direction. | 12163 // direction. |
| 12164 return EnsureCanContainElements( | 12164 return EnsureCanContainElements( |
| 12165 object, args->arguments() - first_arg - (arg_count - 1), arg_count, mode); | 12165 object, args->arguments() - first_arg - (arg_count - 1), arg_count, mode); |
| 12166 } | 12166 } |
| 12167 | 12167 |
| 12168 | 12168 |
| 12169 MaybeHandle<AccessorPair> JSObject::GetOwnPropertyAccessorPair( | |
| 12170 Handle<JSObject> object, | |
| 12171 Handle<Name> name) { | |
| 12172 uint32_t index = 0; | |
| 12173 if (name->AsArrayIndex(&index)) { | |
| 12174 return GetOwnElementAccessorPair(object, index); | |
| 12175 } | |
| 12176 | |
| 12177 Isolate* isolate = object->GetIsolate(); | |
| 12178 LookupResult lookup(isolate); | |
| 12179 object->LookupOwnRealNamedProperty(name, &lookup); | |
| 12180 | |
| 12181 if (lookup.IsPropertyCallbacks() && | |
| 12182 lookup.GetCallbackObject()->IsAccessorPair()) { | |
| 12183 return handle(AccessorPair::cast(lookup.GetCallbackObject()), isolate); | |
| 12184 } | |
| 12185 return MaybeHandle<AccessorPair>(); | |
| 12186 } | |
| 12187 | |
| 12188 | |
| 12189 MaybeHandle<AccessorPair> JSObject::GetOwnElementAccessorPair( | 12169 MaybeHandle<AccessorPair> JSObject::GetOwnElementAccessorPair( |
| 12190 Handle<JSObject> object, | 12170 Handle<JSObject> object, |
| 12191 uint32_t index) { | 12171 uint32_t index) { |
| 12192 if (object->IsJSGlobalProxy()) { | 12172 if (object->IsJSGlobalProxy()) { |
| 12193 Handle<Object> proto(object->GetPrototype(), object->GetIsolate()); | 12173 Handle<Object> proto(object->GetPrototype(), object->GetIsolate()); |
| 12194 if (proto->IsNull()) return MaybeHandle<AccessorPair>(); | 12174 if (proto->IsNull()) return MaybeHandle<AccessorPair>(); |
| 12195 ASSERT(proto->IsJSGlobalObject()); | 12175 ASSERT(proto->IsJSGlobalObject()); |
| 12196 return GetOwnElementAccessorPair(Handle<JSObject>::cast(proto), index); | 12176 return GetOwnElementAccessorPair(Handle<JSObject>::cast(proto), index); |
| 12197 } | 12177 } |
| 12198 | 12178 |
| (...skipping 4744 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 16943 #define ERROR_MESSAGES_TEXTS(C, T) T, | 16923 #define ERROR_MESSAGES_TEXTS(C, T) T, |
| 16944 static const char* error_messages_[] = { | 16924 static const char* error_messages_[] = { |
| 16945 ERROR_MESSAGES_LIST(ERROR_MESSAGES_TEXTS) | 16925 ERROR_MESSAGES_LIST(ERROR_MESSAGES_TEXTS) |
| 16946 }; | 16926 }; |
| 16947 #undef ERROR_MESSAGES_TEXTS | 16927 #undef ERROR_MESSAGES_TEXTS |
| 16948 return error_messages_[reason]; | 16928 return error_messages_[reason]; |
| 16949 } | 16929 } |
| 16950 | 16930 |
| 16951 | 16931 |
| 16952 } } // namespace v8::internal | 16932 } } // namespace v8::internal |
| OLD | NEW |