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

Unified Diff: src/compiler.cc

Issue 2057403003: Hooking up asm-wasm conversion. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: mrege 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
Index: src/compiler.cc
diff --git a/src/compiler.cc b/src/compiler.cc
index 055777af77db2118a08e06d68cb7e798535dc4e6..48167faa6e74c7aecea54e5065d66045244e5a88 100644
--- a/src/compiler.cc
+++ b/src/compiler.cc
@@ -32,6 +32,7 @@
#include "src/snapshot/code-serializer.h"
#include "src/typing-asm.h"
#include "src/vm-state-inl.h"
+#include "src/wasm/wasm-js.h"
namespace v8 {
namespace internal {
@@ -472,14 +473,11 @@ bool GenerateUnoptimizedCode(CompilationInfo* info) {
bool success;
EnsureFeedbackMetadata(info);
if (FLAG_validate_asm && info->scope()->asm_module()) {
- AsmTyper typer(info->isolate(), info->zone(), *(info->script()),
- info->literal());
- if (FLAG_enable_simd_asmjs) {
- typer.set_allow_simd(true);
- }
- if (!typer.Validate()) {
- DCHECK(!info->isolate()->has_pending_exception());
- PrintF("Validation of asm.js module failed: %s", typer.error_message());
+ Handle<FixedArray> wasm_data;
+ if (WasmJs::ConvertAsmToWasm(info->parse_info(), &wasm_data)) {
+ info->shared_info()->set_asm_wasm_data(*wasm_data);
+ info->SetCode(info->isolate()->builtins()->CompileAsmJs());
+ return true;
}
}
if (FLAG_ignition && UseIgnition(info)) {
@@ -728,6 +726,10 @@ MaybeHandle<Code> GetOptimizedCode(Handle<JSFunction> function,
Isolate* isolate = function->GetIsolate();
Handle<SharedFunctionInfo> shared(function->shared(), isolate);
+ if (shared->HasAsmWasmData()) {
+ return MaybeHandle<Code>();
+ }
+
Handle<Code> cached_code;
if (GetCodeFromOptimizedCodeMap(function, osr_ast_id)
.ToHandle(&cached_code)) {

Powered by Google App Engine
This is Rietveld 408576698