summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorFedor Indutny <fedor.indutny@gmail.com>2013-01-01 16:05:53 +0400
committerFedor Indutny <fedor.indutny@gmail.com>2013-01-02 12:13:46 +0400
commit5e57bcc3cee41a666f05e5e4ffd1b76e18b66282 (patch)
tree40272f5a03eb79530dd5c0210a99d22bdddf1ccd /src
parent7b4d95a976f1b76e6dcefb6ca91dff738c80ab7a (diff)
downloadandroid-node-v8-5e57bcc3cee41a666f05e5e4ffd1b76e18b66282.tar.gz
android-node-v8-5e57bcc3cee41a666f05e5e4ffd1b76e18b66282.tar.bz2
android-node-v8-5e57bcc3cee41a666f05e5e4ffd1b76e18b66282.zip
bindings: update to new v8 apis
GetPointerFromInternalField() is deprecated now, we should use GetAlignedPointerFromInternalField().
Diffstat (limited to 'src')
-rw-r--r--src/fs_event_wrap.cc2
-rw-r--r--src/handle_wrap.cc10
-rw-r--r--src/node_internals.h4
-rw-r--r--src/node_object_wrap.h4
-rw-r--r--src/pipe_wrap.cc4
-rw-r--r--src/stream_wrap.cc6
-rw-r--r--src/tcp_wrap.cc6
-rw-r--r--src/tty_wrap.cc2
-rw-r--r--src/udp_wrap.cc2
-rw-r--r--src/v8_typed_array.cc10
10 files changed, 25 insertions, 25 deletions
diff --git a/src/fs_event_wrap.cc b/src/fs_event_wrap.cc
index bb45733007..0153b31026 100644
--- a/src/fs_event_wrap.cc
+++ b/src/fs_event_wrap.cc
@@ -171,7 +171,7 @@ Handle<Value> FSEventWrap::Close(const Arguments& args) {
// and legal, HandleWrap::Close() deals with them the same way.
assert(!args.Holder().IsEmpty());
assert(args.Holder()->InternalFieldCount() > 0);
- void* ptr = args.Holder()->GetPointerFromInternalField(0);
+ void* ptr = args.Holder()->GetAlignedPointerFromInternalField(0);
FSEventWrap* wrap = static_cast<FSEventWrap*>(ptr);
if (wrap == NULL || wrap->initialized_ == false) return Undefined();
diff --git a/src/handle_wrap.cc b/src/handle_wrap.cc
index 4c43957b82..58d5627275 100644
--- a/src/handle_wrap.cc
+++ b/src/handle_wrap.cc
@@ -26,8 +26,8 @@
#define UNWRAP_NO_ABORT(type) \
assert(!args.Holder().IsEmpty()); \
assert(args.Holder()->InternalFieldCount() > 0); \
- type* wrap = \
- static_cast<type*>(args.Holder()->GetPointerFromInternalField(0));
+ type* wrap = static_cast<type*>( \
+ args.Holder()->GetAlignedPointerFromInternalField(0));
namespace node {
@@ -88,7 +88,7 @@ Handle<Value> HandleWrap::Close(const Arguments& args) {
HandleScope scope;
HandleWrap *wrap = static_cast<HandleWrap*>(
- args.Holder()->GetPointerFromInternalField(0));
+ args.Holder()->GetAlignedPointerFromInternalField(0));
// guard against uninitialized handle or double close
if (wrap && wrap->handle__) {
@@ -112,7 +112,7 @@ HandleWrap::HandleWrap(Handle<Object> object, uv_handle_t* h) {
assert(object_.IsEmpty());
assert(object->InternalFieldCount() > 0);
object_ = v8::Persistent<v8::Object>::New(object);
- object_->SetPointerInInternalField(0, this);
+ object_->SetAlignedPointerInInternalField(0, this);
ngx_queue_insert_tail(&handle_wrap_queue, &handle_wrap_queue_);
}
@@ -138,7 +138,7 @@ void HandleWrap::OnClose(uv_handle_t* handle) {
// But the handle pointer should be gone.
assert(wrap->handle__ == NULL);
- wrap->object_->SetPointerInInternalField(0, NULL);
+ wrap->object_->SetAlignedPointerInInternalField(0, NULL);
wrap->object_.Dispose();
wrap->object_.Clear();
diff --git a/src/node_internals.h b/src/node_internals.h
index 80aa4e5366..49ab316fc9 100644
--- a/src/node_internals.h
+++ b/src/node_internals.h
@@ -86,8 +86,8 @@ inline static v8::Handle<v8::Value> ThrowRangeError(const char* errmsg) {
#define UNWRAP(type) \
assert(!args.Holder().IsEmpty()); \
assert(args.Holder()->InternalFieldCount() > 0); \
- type* wrap = \
- static_cast<type*>(args.Holder()->GetPointerFromInternalField(0)); \
+ type* wrap = static_cast<type*>( \
+ args.Holder()->GetAlignedPointerFromInternalField(0)); \
if (!wrap) { \
fprintf(stderr, #type ": Aborting due to unwrap failure at %s:%d\n", \
__FILE__, __LINE__); \
diff --git a/src/node_object_wrap.h b/src/node_object_wrap.h
index 32d584c849..4e0746891e 100644
--- a/src/node_object_wrap.h
+++ b/src/node_object_wrap.h
@@ -59,7 +59,7 @@ class NODE_EXTERN ObjectWrap {
static inline T* Unwrap (v8::Handle<v8::Object> handle) {
assert(!handle.IsEmpty());
assert(handle->InternalFieldCount() > 0);
- return static_cast<T*>(handle->GetPointerFromInternalField(0));
+ return static_cast<T*>(handle->GetAlignedPointerFromInternalField(0));
}
@@ -70,7 +70,7 @@ class NODE_EXTERN ObjectWrap {
assert(handle_.IsEmpty());
assert(handle->InternalFieldCount() > 0);
handle_ = v8::Persistent<v8::Object>::New(handle);
- handle_->SetPointerInInternalField(0, this);
+ handle_->SetAlignedPointerInInternalField(0, this);
MakeWeak();
}
diff --git a/src/pipe_wrap.cc b/src/pipe_wrap.cc
index 39b21a6fab..0c60b4af4e 100644
--- a/src/pipe_wrap.cc
+++ b/src/pipe_wrap.cc
@@ -68,7 +68,7 @@ Local<Object> PipeWrap::Instantiate() {
PipeWrap* PipeWrap::Unwrap(Local<Object> obj) {
assert(!obj.IsEmpty());
assert(obj->InternalFieldCount() > 0);
- return static_cast<PipeWrap*>(obj->GetPointerFromInternalField(0));
+ return static_cast<PipeWrap*>(obj->GetAlignedPointerFromInternalField(0));
}
@@ -204,7 +204,7 @@ void PipeWrap::OnConnection(uv_stream_t* handle, int status) {
// Unwrap the client javascript object.
assert(client_obj->InternalFieldCount() > 0);
PipeWrap* client_wrap =
- static_cast<PipeWrap*>(client_obj->GetPointerFromInternalField(0));
+ static_cast<PipeWrap*>(client_obj->GetAlignedPointerFromInternalField(0));
if (uv_accept(handle, (uv_stream_t*)&client_wrap->handle_)) return;
diff --git a/src/stream_wrap.cc b/src/stream_wrap.cc
index 825b65aa99..8229db22a2 100644
--- a/src/stream_wrap.cc
+++ b/src/stream_wrap.cc
@@ -220,8 +220,8 @@ void StreamWrap::OnReadCommon(uv_stream_t* handle, ssize_t nread,
if (!pending_obj.IsEmpty()) {
assert(pending_obj->InternalFieldCount() > 0);
- StreamWrap* pending_wrap =
- static_cast<StreamWrap*>(pending_obj->GetPointerFromInternalField(0));
+ StreamWrap* pending_wrap = static_cast<StreamWrap*>(
+ pending_obj->GetAlignedPointerFromInternalField(0));
if (uv_accept(handle, pending_wrap->GetStream())) abort();
argv[3] = pending_obj;
argc++;
@@ -408,7 +408,7 @@ Handle<Value> StreamWrap::WriteStringImpl(const Arguments& args) {
Local<Object> send_stream_obj = args[1]->ToObject();
assert(send_stream_obj->InternalFieldCount() > 0);
StreamWrap* send_stream_wrap = static_cast<StreamWrap*>(
- send_stream_obj->GetPointerFromInternalField(0));
+ send_stream_obj->GetAlignedPointerFromInternalField(0));
send_stream = send_stream_wrap->GetStream();
}
diff --git a/src/tcp_wrap.cc b/src/tcp_wrap.cc
index 778fc71f07..f8eb0d29aa 100644
--- a/src/tcp_wrap.cc
+++ b/src/tcp_wrap.cc
@@ -120,7 +120,7 @@ void TCPWrap::Initialize(Handle<Object> target) {
TCPWrap* TCPWrap::Unwrap(Local<Object> obj) {
assert(!obj.IsEmpty());
assert(obj->InternalFieldCount() > 0);
- return static_cast<TCPWrap*>(obj->GetPointerFromInternalField(0));
+ return static_cast<TCPWrap*>(obj->GetAlignedPointerFromInternalField(0));
}
@@ -316,8 +316,8 @@ void TCPWrap::OnConnection(uv_stream_t* handle, int status) {
// Unwrap the client javascript object.
assert(client_obj->InternalFieldCount() > 0);
- TCPWrap* client_wrap =
- static_cast<TCPWrap*>(client_obj->GetPointerFromInternalField(0));
+ TCPWrap* client_wrap = static_cast<TCPWrap*>(
+ client_obj->GetAlignedPointerFromInternalField(0));
if (uv_accept(handle, (uv_stream_t*)&client_wrap->handle_)) return;
diff --git a/src/tty_wrap.cc b/src/tty_wrap.cc
index fde8717595..605d531999 100644
--- a/src/tty_wrap.cc
+++ b/src/tty_wrap.cc
@@ -78,7 +78,7 @@ void TTYWrap::Initialize(Handle<Object> target) {
TTYWrap* TTYWrap::Unwrap(Local<Object> obj) {
assert(!obj.IsEmpty());
assert(obj->InternalFieldCount() > 0);
- return static_cast<TTYWrap*>(obj->GetPointerFromInternalField(0));
+ return static_cast<TTYWrap*>(obj->GetAlignedPointerFromInternalField(0));
}
diff --git a/src/udp_wrap.cc b/src/udp_wrap.cc
index 34fe33562c..caf1fdc7f0 100644
--- a/src/udp_wrap.cc
+++ b/src/udp_wrap.cc
@@ -388,7 +388,7 @@ void UDPWrap::OnRecv(uv_udp_t* handle,
UDPWrap* UDPWrap::Unwrap(Local<Object> obj) {
assert(!obj.IsEmpty());
assert(obj->InternalFieldCount() > 0);
- return static_cast<UDPWrap*>(obj->GetPointerFromInternalField(0));
+ return static_cast<UDPWrap*>(obj->GetAlignedPointerFromInternalField(0));
}
diff --git a/src/v8_typed_array.cc b/src/v8_typed_array.cc
index f5503a90d5..f7811309ad 100644
--- a/src/v8_typed_array.cc
+++ b/src/v8_typed_array.cc
@@ -106,7 +106,7 @@ class ArrayBuffer {
if (!buf)
return ThrowError("Unable to allocate ArrayBuffer.");
- args.This()->SetPointerInInternalField(0, buf);
+ args.This()->SetAlignedPointerInInternalField(0, buf);
args.This()->Set(v8::String::New("byteLength"),
v8::Integer::NewFromUnsigned(num_bytes),
@@ -157,8 +157,8 @@ class ArrayBuffer {
if (buffer.IsEmpty()) return v8::Undefined(); // constructor failed
- void* src = args.This()->GetPointerFromInternalField(0);
- void* dest = buffer->GetPointerFromInternalField(0);
+ void* src = args.This()->GetAlignedPointerFromInternalField(0);
+ void* dest = buffer->GetAlignedPointerFromInternalField(0);
memcpy(dest, static_cast<char*>(src) + begin, slice_length);
return buffer;
@@ -274,7 +274,7 @@ class TypedArray {
GetFunction()->NewInstance(1, argv);
if (buffer.IsEmpty()) return v8::Undefined(); // constructor failed
- void* buf = buffer->GetPointerFromInternalField(0);
+ void* buf = buffer->GetAlignedPointerFromInternalField(0);
args.This()->SetIndexedPropertiesToExternalArrayData(
buf, TEAType, length);
// TODO(deanm): check for failure.
@@ -303,7 +303,7 @@ class TypedArray {
GetFunction()->NewInstance(1, argv);
if (buffer.IsEmpty()) return v8::Undefined(); // constructor failed
- void* buf = buffer->GetPointerFromInternalField(0);
+ void* buf = buffer->GetAlignedPointerFromInternalField(0);
args.This()->SetIndexedPropertiesToExternalArrayData(
buf, TEAType, length);
// TODO(deanm): check for failure.