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 1107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1118 return obj; | 1118 return obj; |
1119 } | 1119 } |
1120 | 1120 |
1121 | 1121 |
1122 template <typename Getter, typename Setter> | 1122 template <typename Getter, typename Setter> |
1123 static i::Handle<i::AccessorInfo> MakeAccessorInfo( | 1123 static i::Handle<i::AccessorInfo> MakeAccessorInfo( |
1124 v8::Local<Name> name, Getter getter, Setter setter, v8::Local<Value> data, | 1124 v8::Local<Name> name, Getter getter, Setter setter, v8::Local<Value> data, |
1125 v8::AccessControl settings, v8::PropertyAttribute attributes, | 1125 v8::AccessControl settings, v8::PropertyAttribute attributes, |
1126 v8::Local<AccessorSignature> signature) { | 1126 v8::Local<AccessorSignature> signature) { |
1127 i::Isolate* isolate = Utils::OpenHandle(*name)->GetIsolate(); | 1127 i::Isolate* isolate = Utils::OpenHandle(*name)->GetIsolate(); |
1128 i::Handle<i::ExecutableAccessorInfo> obj = | 1128 i::Handle<i::AccessorInfo> obj = isolate->factory()->NewAccessorInfo(); |
1129 isolate->factory()->NewExecutableAccessorInfo(); | |
1130 SET_FIELD_WRAPPED(obj, set_getter, getter); | 1129 SET_FIELD_WRAPPED(obj, set_getter, getter); |
1131 SET_FIELD_WRAPPED(obj, set_setter, setter); | 1130 SET_FIELD_WRAPPED(obj, set_setter, setter); |
1132 if (data.IsEmpty()) { | 1131 if (data.IsEmpty()) { |
1133 data = v8::Undefined(reinterpret_cast<v8::Isolate*>(isolate)); | 1132 data = v8::Undefined(reinterpret_cast<v8::Isolate*>(isolate)); |
1134 } | 1133 } |
1135 obj->set_data(*Utils::OpenHandle(*data)); | 1134 obj->set_data(*Utils::OpenHandle(*data)); |
1136 return SetAccessorInfoProperties(obj, name, settings, attributes, signature); | 1135 return SetAccessorInfoProperties(obj, name, settings, attributes, signature); |
1137 } | 1136 } |
1138 | 1137 |
1139 | 1138 |
(...skipping 7394 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8534 Address callback_address = | 8533 Address callback_address = |
8535 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); | 8534 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); |
8536 VMState<EXTERNAL> state(isolate); | 8535 VMState<EXTERNAL> state(isolate); |
8537 ExternalCallbackScope call_scope(isolate, callback_address); | 8536 ExternalCallbackScope call_scope(isolate, callback_address); |
8538 callback(info); | 8537 callback(info); |
8539 } | 8538 } |
8540 | 8539 |
8541 | 8540 |
8542 } // namespace internal | 8541 } // namespace internal |
8543 } // namespace v8 | 8542 } // namespace v8 |
OLD | NEW |