From e66a2acc4cb9fc09fc32d1833b89ae56468a0931 Mon Sep 17 00:00:00 2001 From: Anna Henningsen Date: Fri, 8 Nov 2019 20:40:46 +0200 Subject: src: migrate off ArrayBuffer::GetContents MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-By: Michaƫl Zasso Reviewed-By: Colin Ihrig Reviewed-By: Jiawen Geng Reviewed-By: David Carlier --- src/node_process_methods.cc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/node_process_methods.cc') 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& args) { Local array = args[0].As(); CHECK_EQ(array->Length(), 2); Local ab = array->Buffer(); - double* fields = static_cast(ab->GetContents().Data()); + double* fields = static_cast(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& args) { uint64_t t = uv_hrtime(); Local ab = args[0].As()->Buffer(); - uint32_t* fields = static_cast(ab->GetContents().Data()); + uint32_t* fields = static_cast(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& args) { static void HrtimeBigInt(const FunctionCallbackInfo& args) { Local ab = args[0].As()->Buffer(); - uint64_t* fields = static_cast(ab->GetContents().Data()); + uint64_t* fields = static_cast(ab->GetBackingStore()->Data()); fields[0] = uv_hrtime(); } @@ -204,7 +204,7 @@ static void MemoryUsage(const FunctionCallbackInfo& args) { Local array = args[0].As(); CHECK_EQ(array->Length(), 4); Local ab = array->Buffer(); - double* fields = static_cast(ab->GetContents().Data()); + double* fields = static_cast(ab->GetBackingStore()->Data()); fields[0] = rss; fields[1] = v8_heap_stats.total_heap_size(); @@ -301,7 +301,7 @@ static void ResourceUsage(const FunctionCallbackInfo& args) { Local array = args[0].As(); CHECK_EQ(array->Length(), 16); Local ab = array->Buffer(); - double* fields = static_cast(ab->GetContents().Data()); + double* fields = static_cast(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; -- cgit v1.2.3