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 6020 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6031 i::Handle<i::Symbol> key = isolate->factory()->promise_has_handler_symbol(); | 6031 i::Handle<i::Symbol> key = isolate->factory()->promise_has_handler_symbol(); |
6032 return i::JSObject::GetDataProperty(promise, key)->IsTrue(); | 6032 return i::JSObject::GetDataProperty(promise, key)->IsTrue(); |
6033 } | 6033 } |
6034 | 6034 |
6035 | 6035 |
6036 bool v8::ArrayBuffer::IsExternal() const { | 6036 bool v8::ArrayBuffer::IsExternal() const { |
6037 return Utils::OpenHandle(this)->is_external(); | 6037 return Utils::OpenHandle(this)->is_external(); |
6038 } | 6038 } |
6039 | 6039 |
6040 | 6040 |
| 6041 bool v8::ArrayBuffer::IsNeuterable() const { |
| 6042 return Utils::OpenHandle(this)->is_neuterable(); |
| 6043 } |
| 6044 |
| 6045 |
6041 v8::ArrayBuffer::Contents v8::ArrayBuffer::Externalize() { | 6046 v8::ArrayBuffer::Contents v8::ArrayBuffer::Externalize() { |
6042 i::Handle<i::JSArrayBuffer> obj = Utils::OpenHandle(this); | 6047 i::Handle<i::JSArrayBuffer> obj = Utils::OpenHandle(this); |
6043 Utils::ApiCheck(!obj->is_external(), | 6048 Utils::ApiCheck(!obj->is_external(), |
6044 "v8::ArrayBuffer::Externalize", | 6049 "v8::ArrayBuffer::Externalize", |
6045 "ArrayBuffer already externalized"); | 6050 "ArrayBuffer already externalized"); |
6046 obj->set_is_external(true); | 6051 obj->set_is_external(true); |
6047 size_t byte_length = static_cast<size_t>(obj->byte_length()->Number()); | 6052 size_t byte_length = static_cast<size_t>(obj->byte_length()->Number()); |
6048 Contents contents; | 6053 Contents contents; |
6049 contents.data_ = obj->backing_store(); | 6054 contents.data_ = obj->backing_store(); |
6050 contents.byte_length_ = byte_length; | 6055 contents.byte_length_ = byte_length; |
(...skipping 1680 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7731 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate()); | 7736 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate()); |
7732 Address callback_address = | 7737 Address callback_address = |
7733 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); | 7738 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); |
7734 VMState<EXTERNAL> state(isolate); | 7739 VMState<EXTERNAL> state(isolate); |
7735 ExternalCallbackScope call_scope(isolate, callback_address); | 7740 ExternalCallbackScope call_scope(isolate, callback_address); |
7736 callback(info); | 7741 callback(info); |
7737 } | 7742 } |
7738 | 7743 |
7739 | 7744 |
7740 } } // namespace v8::internal | 7745 } } // namespace v8::internal |
OLD | NEW |