Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(326)

Unified Diff: src/wasm/wasm-module.cc

Issue 2028983002: Introduce IsUndefined(Isolate*) and IsTheHole(Isolate*) (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: rebase master Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/wasm/wasm-js.cc ('k') | src/x64/code-stubs-x64.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/wasm/wasm-module.cc
diff --git a/src/wasm/wasm-module.cc b/src/wasm/wasm-module.cc
index df63dce97c85dcb3f68cfcd7199419b70ea5a845..07d2ef1113f725ea24bffd1efd64dbd4afa15999 100644
--- a/src/wasm/wasm-module.cc
+++ b/src/wasm/wasm-module.cc
@@ -854,7 +854,7 @@ MaybeHandle<JSObject> WasmModule::Instantiate(
isolate, &module_env, name, code, instance.js_object, index);
// Call the JS function.
- Handle<Object> undefined(isolate->heap()->undefined_value(), isolate);
+ Handle<Object> undefined = isolate->factory()->undefined_value();
MaybeHandle<Object> retval =
Execution::Call(isolate, jsfunc, undefined, 0, nullptr);
@@ -963,7 +963,7 @@ int32_t CompileAndRunWasmModule(Isolate* isolate, const WasmModule* module) {
isolate, &module_env, name, main_code, module_object, main_index);
// Call the JS function.
- Handle<Object> undefined(isolate->heap()->undefined_value(), isolate);
+ Handle<Object> undefined = isolate->factory()->undefined_value();
MaybeHandle<Object> retval =
Execution::Call(isolate, jsfunc, undefined, 0, nullptr);
@@ -987,9 +987,10 @@ MaybeHandle<String> GetWasmFunctionName(Handle<JSObject> wasm,
uint32_t func_index) {
DCHECK(IsWasmObject(wasm));
Object* func_names_arr_obj = wasm->GetInternalField(kWasmFunctionNamesArray);
- if (func_names_arr_obj->IsUndefined()) return Handle<String>::null();
+ Isolate* isolate = wasm->GetIsolate();
+ if (func_names_arr_obj->IsUndefined(isolate)) return Handle<String>::null();
return GetWasmFunctionNameFromTable(
- handle(ByteArray::cast(func_names_arr_obj)), func_index);
+ handle(ByteArray::cast(func_names_arr_obj), isolate), func_index);
}
bool IsWasmObject(Handle<JSObject> object) {
@@ -998,7 +999,8 @@ bool IsWasmObject(Handle<JSObject> object) {
object->GetInternalField(kWasmModuleCodeTable)->IsFixedArray() &&
object->GetInternalField(kWasmMemArrayBuffer)->IsJSArrayBuffer() &&
(object->GetInternalField(kWasmFunctionNamesArray)->IsByteArray() ||
- object->GetInternalField(kWasmFunctionNamesArray)->IsUndefined());
+ object->GetInternalField(kWasmFunctionNamesArray)
+ ->IsUndefined(object->GetIsolate()));
}
} // namespace wasm
« no previous file with comments | « src/wasm/wasm-js.cc ('k') | src/x64/code-stubs-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698