Skip to content

Commit

Permalink
src: remove usages of GetBackingStore in modules
Browse files Browse the repository at this point in the history
This removes all usages of GetBackingStore in modules. See the linked
issue for an explanation.

Refs: nodejs#32226
Refs: nodejs#43921
PR-URL: nodejs#44076
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: Feng Yu <F3n67u@outlook.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
  • Loading branch information
kvakil authored and Fyko committed Sep 15, 2022
1 parent f5e432b commit be3bfdc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/module_wrap.cc
Original file line number Diff line number Diff line change
Expand Up @@ -178,8 +178,8 @@ void ModuleWrap::New(const FunctionCallbackInfo<Value>& args) {
if (!args[5]->IsUndefined()) {
CHECK(args[5]->IsArrayBufferView());
Local<ArrayBufferView> cached_data_buf = args[5].As<ArrayBufferView>();
uint8_t* data = static_cast<uint8_t*>(
cached_data_buf->Buffer()->GetBackingStore()->Data());
uint8_t* data =
static_cast<uint8_t*>(cached_data_buf->Buffer()->Data());
cached_data =
new ScriptCompiler::CachedData(data + cached_data_buf->ByteOffset(),
cached_data_buf->ByteLength());
Expand Down
6 changes: 2 additions & 4 deletions src/node_contextify.cc
Original file line number Diff line number Diff line change
Expand Up @@ -746,8 +746,7 @@ void ContextifyScript::New(const FunctionCallbackInfo<Value>& args) {

ScriptCompiler::CachedData* cached_data = nullptr;
if (!cached_data_buf.IsEmpty()) {
uint8_t* data = static_cast<uint8_t*>(
cached_data_buf->Buffer()->GetBackingStore()->Data());
uint8_t* data = static_cast<uint8_t*>(cached_data_buf->Buffer()->Data());
cached_data = new ScriptCompiler::CachedData(
data + cached_data_buf->ByteOffset(), cached_data_buf->ByteLength());
}
Expand Down Expand Up @@ -1068,8 +1067,7 @@ void ContextifyContext::CompileFunction(
// Read cache from cached data buffer
ScriptCompiler::CachedData* cached_data = nullptr;
if (!cached_data_buf.IsEmpty()) {
uint8_t* data = static_cast<uint8_t*>(
cached_data_buf->Buffer()->GetBackingStore()->Data());
uint8_t* data = static_cast<uint8_t*>(cached_data_buf->Buffer()->Data());
cached_data = new ScriptCompiler::CachedData(
data + cached_data_buf->ByteOffset(), cached_data_buf->ByteLength());
}
Expand Down

0 comments on commit be3bfdc

Please sign in to comment.