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 3414 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3425 i::Handle<i::AccessorInfo> info = MakeAccessorInfo( | 3425 i::Handle<i::AccessorInfo> info = MakeAccessorInfo( |
3426 name, getter, setter, data, settings, attributes, signature); | 3426 name, getter, setter, data, settings, attributes, signature); |
3427 if (info.is_null()) return false; | 3427 if (info.is_null()) return false; |
3428 bool fast = Utils::OpenHandle(obj)->HasFastProperties(); | 3428 bool fast = Utils::OpenHandle(obj)->HasFastProperties(); |
3429 i::Handle<i::Object> result; | 3429 i::Handle<i::Object> result; |
3430 ASSIGN_RETURN_ON_EXCEPTION_VALUE( | 3430 ASSIGN_RETURN_ON_EXCEPTION_VALUE( |
3431 isolate, result, | 3431 isolate, result, |
3432 i::JSObject::SetAccessor(Utils::OpenHandle(obj), info), | 3432 i::JSObject::SetAccessor(Utils::OpenHandle(obj), info), |
3433 false); | 3433 false); |
3434 if (result->IsUndefined()) return false; | 3434 if (result->IsUndefined()) return false; |
3435 if (fast) i::JSObject::TransformToFastProperties(Utils::OpenHandle(obj), 0); | 3435 if (fast) i::JSObject::MigrateSlowToFast(Utils::OpenHandle(obj), 0); |
3436 return true; | 3436 return true; |
3437 } | 3437 } |
3438 | 3438 |
3439 | 3439 |
3440 bool Object::SetAccessor(Handle<String> name, | 3440 bool Object::SetAccessor(Handle<String> name, |
3441 AccessorGetterCallback getter, | 3441 AccessorGetterCallback getter, |
3442 AccessorSetterCallback setter, | 3442 AccessorSetterCallback setter, |
3443 v8::Handle<Value> data, | 3443 v8::Handle<Value> data, |
3444 AccessControl settings, | 3444 AccessControl settings, |
3445 PropertyAttribute attributes) { | 3445 PropertyAttribute attributes) { |
(...skipping 4185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7631 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate()); | 7631 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate()); |
7632 Address callback_address = | 7632 Address callback_address = |
7633 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); | 7633 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); |
7634 VMState<EXTERNAL> state(isolate); | 7634 VMState<EXTERNAL> state(isolate); |
7635 ExternalCallbackScope call_scope(isolate, callback_address); | 7635 ExternalCallbackScope call_scope(isolate, callback_address); |
7636 callback(info); | 7636 callback(info); |
7637 } | 7637 } |
7638 | 7638 |
7639 | 7639 |
7640 } } // namespace v8::internal | 7640 } } // namespace v8::internal |
OLD | NEW |