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 6365 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6376 | 6376 |
6377 | 6377 |
6378 size_t v8::ArrayBufferView::ByteLength() { | 6378 size_t v8::ArrayBufferView::ByteLength() { |
6379 i::Handle<i::JSArrayBufferView> obj = Utils::OpenHandle(this); | 6379 i::Handle<i::JSArrayBufferView> obj = Utils::OpenHandle(this); |
6380 return static_cast<size_t>(obj->byte_length()->Number()); | 6380 return static_cast<size_t>(obj->byte_length()->Number()); |
6381 } | 6381 } |
6382 | 6382 |
6383 | 6383 |
6384 size_t v8::TypedArray::Length() { | 6384 size_t v8::TypedArray::Length() { |
6385 i::Handle<i::JSTypedArray> obj = Utils::OpenHandle(this); | 6385 i::Handle<i::JSTypedArray> obj = Utils::OpenHandle(this); |
6386 return static_cast<size_t>(obj->length()->Number()); | 6386 return static_cast<size_t>(obj->length_value()); |
6387 } | 6387 } |
6388 | 6388 |
6389 | 6389 |
6390 #define TYPED_ARRAY_NEW(Type, type, TYPE, ctype, size) \ | 6390 #define TYPED_ARRAY_NEW(Type, type, TYPE, ctype, size) \ |
6391 Local<Type##Array> Type##Array::New(Handle<ArrayBuffer> array_buffer, \ | 6391 Local<Type##Array> Type##Array::New(Handle<ArrayBuffer> array_buffer, \ |
6392 size_t byte_offset, size_t length) { \ | 6392 size_t byte_offset, size_t length) { \ |
6393 i::Isolate* isolate = Utils::OpenHandle(*array_buffer)->GetIsolate(); \ | 6393 i::Isolate* isolate = Utils::OpenHandle(*array_buffer)->GetIsolate(); \ |
6394 LOG_API(isolate, \ | 6394 LOG_API(isolate, \ |
6395 "v8::" #Type "Array::New(Handle<ArrayBuffer>, size_t, size_t)"); \ | 6395 "v8::" #Type "Array::New(Handle<ArrayBuffer>, size_t, size_t)"); \ |
6396 ENTER_V8(isolate); \ | 6396 ENTER_V8(isolate); \ |
(...skipping 1682 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8079 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate()); | 8079 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate()); |
8080 Address callback_address = | 8080 Address callback_address = |
8081 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); | 8081 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); |
8082 VMState<EXTERNAL> state(isolate); | 8082 VMState<EXTERNAL> state(isolate); |
8083 ExternalCallbackScope call_scope(isolate, callback_address); | 8083 ExternalCallbackScope call_scope(isolate, callback_address); |
8084 callback(info); | 8084 callback(info); |
8085 } | 8085 } |
8086 | 8086 |
8087 | 8087 |
8088 } } // namespace v8::internal | 8088 } } // namespace v8::internal |
OLD | NEW |