Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit a54e4d4

Browse filesBrowse files
kvakilruyadorno
authored andcommitted
src: remove usages of GetBackingStore in WASI
This removes all usages of GetBackingStore in WASI. See the linked issue for an explanation. Refs: #32226 Refs: #43921 PR-URL: #44077 Reviewed-By: Jiawen Geng <technicalcute@gmail.com> Reviewed-By: Darshan Sen <raisinten@gmail.com> Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Feng Yu <F3n67u@outlook.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
1 parent 38cdb1f commit a54e4d4
Copy full SHA for a54e4d4

File tree

Expand file treeCollapse file tree

2 files changed

+5
-7
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

2 files changed

+5
-7
lines changed
Open diff view settings
Collapse file

‎src/node_wasi.cc‎

Copy file name to clipboardExpand all lines: src/node_wasi.cc
+3-5Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,6 @@ inline void Debug(WASI* wasi, Args&&... args) {
7373
} while (0)
7474

7575
using v8::Array;
76-
using v8::BackingStore;
7776
using v8::BigInt;
7877
using v8::Context;
7978
using v8::Exception;
@@ -1654,10 +1653,9 @@ void WASI::_SetMemory(const FunctionCallbackInfo<Value>& args) {
16541653

16551654
uvwasi_errno_t WASI::backingStore(char** store, size_t* byte_length) {
16561655
Local<WasmMemoryObject> memory = PersistentToLocal::Strong(this->memory_);
1657-
std::shared_ptr<BackingStore> backing_store =
1658-
memory->Buffer()->GetBackingStore();
1659-
*byte_length = backing_store->ByteLength();
1660-
*store = static_cast<char*>(backing_store->Data());
1656+
Local<v8::ArrayBuffer> ab = memory->Buffer();
1657+
*byte_length = ab->ByteLength();
1658+
*store = static_cast<char*>(ab->Data());
16611659
CHECK_NOT_NULL(*store);
16621660
return UVWASI_ESUCCESS;
16631661
}
Collapse file

‎src/node_wasm_web_api.cc‎

Copy file name to clipboardExpand all lines: src/node_wasm_web_api.cc
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,12 +107,12 @@ void WasmStreamingObject::Push(const FunctionCallbackInfo<Value>& args) {
107107

108108
if (LIKELY(chunk->IsArrayBufferView())) {
109109
Local<ArrayBufferView> view = chunk.As<ArrayBufferView>();
110-
bytes = view->Buffer()->GetBackingStore()->Data();
110+
bytes = view->Buffer()->Data();
111111
offset = view->ByteOffset();
112112
size = view->ByteLength();
113113
} else if (LIKELY(chunk->IsArrayBuffer())) {
114114
Local<ArrayBuffer> buffer = chunk.As<ArrayBuffer>();
115-
bytes = buffer->GetBackingStore()->Data();
115+
bytes = buffer->Data();
116116
offset = 0;
117117
size = buffer->ByteLength();
118118
} else {

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.