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

Unified Diff: src/asmjs/asm-js.cc

Issue 2264913002: [wasm] asm.js - Remove Wasm.instantiateModuleFromAsm, use asm.js directly. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: fix Created 4 years, 4 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 | « no previous file | src/asmjs/asm-typer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/asmjs/asm-js.cc
diff --git a/src/asmjs/asm-js.cc b/src/asmjs/asm-js.cc
index 182ee151fa27e0ad783cb5df5b005a4e13553190..e94d91730e558b5da3d9db28956c9c9ac706bdc2 100644
--- a/src/asmjs/asm-js.cc
+++ b/src/asmjs/asm-js.cc
@@ -56,6 +56,9 @@ i::MaybeHandle<i::FixedArray> CompileModule(
Handle<i::Object> StdlibMathMember(i::Isolate* isolate,
Handle<JSReceiver> stdlib,
Handle<Name> name) {
+ if (stdlib.is_null()) {
+ return Handle<i::Object>();
+ }
Handle<i::Name> math_name(
isolate->factory()->InternalizeOneByteString(STATIC_CHAR_VECTOR("Math")));
MaybeHandle<i::Object> maybe_math = i::Object::GetProperty(stdlib, math_name);
@@ -89,6 +92,9 @@ bool IsStdlibMemberValid(i::Isolate* isolate, Handle<JSReceiver> stdlib,
return true;
}
case wasm::AsmTyper::StandardMember::kInfinity: {
+ if (stdlib.is_null()) {
+ return false;
+ }
Handle<i::Name> name(isolate->factory()->InternalizeOneByteString(
STATIC_CHAR_VECTOR("Infinity")));
MaybeHandle<i::Object> maybe_value = i::Object::GetProperty(stdlib, name);
@@ -99,6 +105,9 @@ bool IsStdlibMemberValid(i::Isolate* isolate, Handle<JSReceiver> stdlib,
return value->IsNumber() && std::isinf(value->Number());
}
case wasm::AsmTyper::StandardMember::kNaN: {
+ if (stdlib.is_null()) {
+ return false;
+ }
Handle<i::Name> name(isolate->factory()->InternalizeOneByteString(
STATIC_CHAR_VECTOR("NaN")));
MaybeHandle<i::Object> maybe_value = i::Object::GetProperty(stdlib, name);
@@ -257,11 +266,8 @@ MaybeHandle<Object> AsmJs::InstantiateAsmWasm(i::Isolate* isolate,
isolate, init, undefined, foreign_globals->length(), foreign_args_array);
delete[] foreign_args_array;
- if (retval.is_null()) {
- thrower.Error(
- "WASM.instantiateModuleFromAsm(): foreign init function failed");
- return MaybeHandle<Object>();
- }
+ DCHECK(!retval.is_null());
+
return maybe_module_object;
}
« no previous file with comments | « no previous file | src/asmjs/asm-typer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698