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 #include "src/api.h" | 5 #include "src/api.h" |
6 | 6 |
7 #include <string.h> // For memcpy, strlen. | 7 #include <string.h> // For memcpy, strlen. |
8 #ifdef V8_USE_ADDRESS_SANITIZER | 8 #ifdef V8_USE_ADDRESS_SANITIZER |
9 #include <sanitizer/asan_interface.h> | 9 #include <sanitizer/asan_interface.h> |
10 #endif // V8_USE_ADDRESS_SANITIZER | 10 #endif // V8_USE_ADDRESS_SANITIZER |
(...skipping 4660 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4671 v8::Local<AccessorSignature> signature; | 4671 v8::Local<AccessorSignature> signature; |
4672 auto info = | 4672 auto info = |
4673 MakeAccessorInfo(name, getter, setter, data, settings, attributes, | 4673 MakeAccessorInfo(name, getter, setter, data, settings, attributes, |
4674 signature, i::FLAG_disable_old_api_accessors, false); | 4674 signature, i::FLAG_disable_old_api_accessors, false); |
4675 if (info.is_null()) return Nothing<bool>(); | 4675 if (info.is_null()) return Nothing<bool>(); |
4676 bool fast = obj->HasFastProperties(); | 4676 bool fast = obj->HasFastProperties(); |
4677 i::Handle<i::Object> result; | 4677 i::Handle<i::Object> result; |
4678 has_pending_exception = | 4678 has_pending_exception = |
4679 !i::JSObject::SetAccessor(obj, info).ToHandle(&result); | 4679 !i::JSObject::SetAccessor(obj, info).ToHandle(&result); |
4680 RETURN_ON_FAILED_EXECUTION_PRIMITIVE(bool); | 4680 RETURN_ON_FAILED_EXECUTION_PRIMITIVE(bool); |
4681 if (result->IsUndefined(obj->GetIsolate())) return Nothing<bool>(); | 4681 if (result->IsUndefined(obj->GetIsolate())) return Just(false); |
4682 if (fast) { | 4682 if (fast) { |
4683 i::JSObject::MigrateSlowToFast(obj, 0, "APISetAccessor"); | 4683 i::JSObject::MigrateSlowToFast(obj, 0, "APISetAccessor"); |
4684 } | 4684 } |
4685 return Just(true); | 4685 return Just(true); |
4686 } | 4686 } |
4687 | 4687 |
4688 | 4688 |
4689 Maybe<bool> Object::SetAccessor(Local<Context> context, Local<Name> name, | 4689 Maybe<bool> Object::SetAccessor(Local<Context> context, Local<Name> name, |
4690 AccessorNameGetterCallback getter, | 4690 AccessorNameGetterCallback getter, |
4691 AccessorNameSetterCallback setter, | 4691 AccessorNameSetterCallback setter, |
(...skipping 5460 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10152 Address callback_address = | 10152 Address callback_address = |
10153 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); | 10153 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); |
10154 VMState<EXTERNAL> state(isolate); | 10154 VMState<EXTERNAL> state(isolate); |
10155 ExternalCallbackScope call_scope(isolate, callback_address); | 10155 ExternalCallbackScope call_scope(isolate, callback_address); |
10156 callback(info); | 10156 callback(info); |
10157 } | 10157 } |
10158 | 10158 |
10159 | 10159 |
10160 } // namespace internal | 10160 } // namespace internal |
10161 } // namespace v8 | 10161 } // namespace v8 |
OLD | NEW |