diff options
author | Anna Henningsen <anna@addaleax.net> | 2019-11-08 20:40:46 +0200 |
---|---|---|
committer | Daniel Bevenius <daniel.bevenius@gmail.com> | 2019-11-12 06:29:23 +0100 |
commit | e66a2acc4cb9fc09fc32d1833b89ae56468a0931 (patch) | |
tree | 2db9ffe469a2c662eda46cef848a17d39b8a3787 /src/node_process_methods.cc | |
parent | f8c069f5b88a25304ee2fc638c51464b4df196dd (diff) | |
download | android-node-v8-e66a2acc4cb9fc09fc32d1833b89ae56468a0931.tar.gz android-node-v8-e66a2acc4cb9fc09fc32d1833b89ae56468a0931.tar.bz2 android-node-v8-e66a2acc4cb9fc09fc32d1833b89ae56468a0931.zip |
src: migrate off ArrayBuffer::GetContents
V8 deprecates `GetContents()` in favour of `GetBackingStore()`.
Update our code to reflect that.
V8 also deprecates `Externalize()` and `IsExternal()`; we should
be able to remove all usage of this once V8 8.0 is there.
PR-URL: https://github.com/nodejs/node/pull/30339
Refs: https://github.com/v8/v8/commit/bfe3d6bce734e596e312465e207bcfd55a59fe34
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Michaƫl Zasso <targos@protonmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: David Carlier <devnexen@gmail.com>
Diffstat (limited to 'src/node_process_methods.cc')
-rw-r--r-- | src/node_process_methods.cc | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/node_process_methods.cc b/src/node_process_methods.cc index 7e2af37907..7efe8efb9b 100644 --- a/src/node_process_methods.cc +++ b/src/node_process_methods.cc @@ -109,7 +109,7 @@ static void CPUUsage(const FunctionCallbackInfo<Value>& args) { Local<Float64Array> array = args[0].As<Float64Array>(); CHECK_EQ(array->Length(), 2); Local<ArrayBuffer> ab = array->Buffer(); - double* fields = static_cast<double*>(ab->GetContents().Data()); + double* fields = static_cast<double*>(ab->GetBackingStore()->Data()); // Set the Float64Array elements to be user / system values in microseconds. fields[0] = MICROS_PER_SEC * rusage.ru_utime.tv_sec + rusage.ru_utime.tv_usec; @@ -148,7 +148,7 @@ static void Hrtime(const FunctionCallbackInfo<Value>& args) { uint64_t t = uv_hrtime(); Local<ArrayBuffer> ab = args[0].As<Uint32Array>()->Buffer(); - uint32_t* fields = static_cast<uint32_t*>(ab->GetContents().Data()); + uint32_t* fields = static_cast<uint32_t*>(ab->GetBackingStore()->Data()); fields[0] = (t / NANOS_PER_SEC) >> 32; fields[1] = (t / NANOS_PER_SEC) & 0xffffffff; @@ -157,7 +157,7 @@ static void Hrtime(const FunctionCallbackInfo<Value>& args) { static void HrtimeBigInt(const FunctionCallbackInfo<Value>& args) { Local<ArrayBuffer> ab = args[0].As<BigUint64Array>()->Buffer(); - uint64_t* fields = static_cast<uint64_t*>(ab->GetContents().Data()); + uint64_t* fields = static_cast<uint64_t*>(ab->GetBackingStore()->Data()); fields[0] = uv_hrtime(); } @@ -204,7 +204,7 @@ static void MemoryUsage(const FunctionCallbackInfo<Value>& args) { Local<Float64Array> array = args[0].As<Float64Array>(); CHECK_EQ(array->Length(), 4); Local<ArrayBuffer> ab = array->Buffer(); - double* fields = static_cast<double*>(ab->GetContents().Data()); + double* fields = static_cast<double*>(ab->GetBackingStore()->Data()); fields[0] = rss; fields[1] = v8_heap_stats.total_heap_size(); @@ -301,7 +301,7 @@ static void ResourceUsage(const FunctionCallbackInfo<Value>& args) { Local<Float64Array> array = args[0].As<Float64Array>(); CHECK_EQ(array->Length(), 16); Local<ArrayBuffer> ab = array->Buffer(); - double* fields = static_cast<double*>(ab->GetContents().Data()); + double* fields = static_cast<double*>(ab->GetBackingStore()->Data()); fields[0] = MICROS_PER_SEC * rusage.ru_utime.tv_sec + rusage.ru_utime.tv_usec; fields[1] = MICROS_PER_SEC * rusage.ru_stime.tv_sec + rusage.ru_stime.tv_usec; |