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

Unified Diff: src/runtime/runtime-test.cc

Issue 2549463002: [wasm] Cleanup %IsAsmWasmCode testing predicate. (Closed)
Patch Set: Rebased. Created 4 years 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 | test/mjsunit/asm/asm-validation.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/runtime/runtime-test.cc
diff --git a/src/runtime/runtime-test.cc b/src/runtime/runtime-test.cc
index f34045a8294acc8112d7601e9bfcd5ba7d9e7d05..60603aa546d9e46784c8ee2cb665b80735478a5e 100644
--- a/src/runtime/runtime-test.cc
+++ b/src/runtime/runtime-test.cc
@@ -677,7 +677,9 @@ RUNTIME_FUNCTION(Runtime_InNewSpace) {
return isolate->heap()->ToBoolean(isolate->heap()->InNewSpace(obj));
}
-static bool IsAsmWasmCode(Isolate* isolate, Handle<JSFunction> function) {
+namespace {
+
+bool IsAsmWasmCode(Isolate* isolate, Handle<JSFunction> function) {
if (!function->shared()->HasAsmWasmData()) {
// Doesn't have wasm data.
return false;
@@ -690,21 +692,18 @@ static bool IsAsmWasmCode(Isolate* isolate, Handle<JSFunction> function) {
return true;
}
+} // namespace
+
RUNTIME_FUNCTION(Runtime_IsAsmWasmCode) {
SealHandleScope shs(isolate);
- DCHECK(args.length() == 1);
+ DCHECK_EQ(1, args.length());
CONVERT_ARG_HANDLE_CHECKED(JSFunction, function, 0);
- // TODO(mstarzinger): --always-opt should still allow asm.js->wasm,
- // but currently does not. For now, pretend asm.js->wasm is on for
- // this case. Be more accurate once this is corrected.
- return isolate->heap()->ToBoolean(
- ((FLAG_always_opt || FLAG_prepare_always_opt) && FLAG_validate_asm) ||
- IsAsmWasmCode(isolate, function));
+ return isolate->heap()->ToBoolean(IsAsmWasmCode(isolate, function));
}
RUNTIME_FUNCTION(Runtime_IsNotAsmWasmCode) {
SealHandleScope shs(isolate);
- DCHECK(args.length() == 1);
+ DCHECK_EQ(1, args.length());
CONVERT_ARG_HANDLE_CHECKED(JSFunction, function, 0);
return isolate->heap()->ToBoolean(!IsAsmWasmCode(isolate, function));
}
« no previous file with comments | « no previous file | test/mjsunit/asm/asm-validation.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698