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

Side by Side Diff: src/compiler/wasm-compiler.cc

Issue 2008043006: [wasm] separate snapshot-able stages (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@refactoring
Patch Set: 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 unified diff | Download patch
« no previous file with comments | « no previous file | src/wasm/wasm-module.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 the V8 project authors. All rights reserved. 1 // Copyright 2015 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/compiler/wasm-compiler.h" 5 #include "src/compiler/wasm-compiler.h"
6 6
7 #include "src/isolate-inl.h" 7 #include "src/isolate-inl.h"
8 8
9 #include "src/base/platform/elapsed-timer.h" 9 #include "src/base/platform/elapsed-timer.h"
10 #include "src/base/platform/platform.h" 10 #include "src/base/platform/platform.h"
(...skipping 1890 matching lines...) Expand 10 before | Expand all | Expand 10 after
1901 1901
1902 *effect_ = call; 1902 *effect_ = call;
1903 return call; 1903 return call;
1904 } 1904 }
1905 1905
1906 Node* WasmGraphBuilder::CallDirect(uint32_t index, Node** args, 1906 Node* WasmGraphBuilder::CallDirect(uint32_t index, Node** args,
1907 wasm::WasmCodePosition position) { 1907 wasm::WasmCodePosition position) {
1908 DCHECK_NULL(args[0]); 1908 DCHECK_NULL(args[0]);
1909 1909
1910 // Add code object as constant. 1910 // Add code object as constant.
1911 args[0] = HeapConstant(module_->GetFunctionCode(index)); 1911 args[0] = HeapConstant(module_->GetCodeOrPlaceholder(index));
1912 wasm::FunctionSig* sig = module_->GetFunctionSignature(index); 1912 wasm::FunctionSig* sig = module_->GetFunctionSignature(index);
1913 1913
1914 return BuildWasmCall(sig, args, position); 1914 return BuildWasmCall(sig, args, position);
1915 } 1915 }
1916 1916
1917 Node* WasmGraphBuilder::CallImport(uint32_t index, Node** args, 1917 Node* WasmGraphBuilder::CallImport(uint32_t index, Node** args,
1918 wasm::WasmCodePosition position) { 1918 wasm::WasmCodePosition position) {
1919 DCHECK_NULL(args[0]); 1919 DCHECK_NULL(args[0]);
1920 1920
1921 // Add code object as constant. 1921 // Add code object as constant.
(...skipping 1363 matching lines...) Expand 10 before | Expand all | Expand 10 after
3285 } 3285 }
3286 if (job_->GenerateCode() != CompilationJob::SUCCEEDED) { 3286 if (job_->GenerateCode() != CompilationJob::SUCCEEDED) {
3287 return Handle<Code>::null(); 3287 return Handle<Code>::null();
3288 } 3288 }
3289 base::ElapsedTimer compile_timer; 3289 base::ElapsedTimer compile_timer;
3290 if (FLAG_trace_wasm_decode_time) { 3290 if (FLAG_trace_wasm_decode_time) {
3291 compile_timer.Start(); 3291 compile_timer.Start();
3292 } 3292 }
3293 Handle<Code> code = info_.code(); 3293 Handle<Code> code = info_.code();
3294 DCHECK(!code.is_null()); 3294 DCHECK(!code.is_null());
3295 DCHECK(code->deoptimization_data() == nullptr ||
3296 code->deoptimization_data()->length() == 0);
3297 Handle<FixedArray> deopt_data =
3298 isolate_->factory()->NewFixedArray(2, TENURED);
3299 if (!module_env_->instance->js_object.is_null()) {
3300 deopt_data->set(0, *module_env_->instance->js_object);
3301 }
3302 deopt_data->set(1, Smi::FromInt(function_->func_index));
3303 deopt_data->set_length(2);
3304 code->set_deoptimization_data(*deopt_data);
3305 3295
3306 RecordFunctionCompilation( 3296 RecordFunctionCompilation(
3307 Logger::FUNCTION_TAG, &info_, "WASM_function", function_->func_index, 3297 Logger::FUNCTION_TAG, &info_, "WASM_function", function_->func_index,
3308 module_env_->module->GetName(function_->name_offset, 3298 module_env_->module->GetName(function_->name_offset,
3309 function_->name_length)); 3299 function_->name_length));
3310 3300
3311 if (FLAG_trace_wasm_decode_time) { 3301 if (FLAG_trace_wasm_decode_time) {
3312 double compile_ms = compile_timer.Elapsed().InMillisecondsF(); 3302 double compile_ms = compile_timer.Elapsed().InMillisecondsF();
3313 PrintF("wasm-code-generation ok: %d bytes, %0.3f ms code generation\n", 3303 PrintF("wasm-code-generation ok: %d bytes, %0.3f ms code generation\n",
3314 static_cast<int>(function_->code_end_offset - 3304 static_cast<int>(function_->code_end_offset -
3315 function_->code_start_offset), 3305 function_->code_start_offset),
3316 compile_ms); 3306 compile_ms);
3317 } 3307 }
3318 3308
3319 return code; 3309 return code;
3320 } 3310 }
3321 3311
3322 } // namespace compiler 3312 } // namespace compiler
3323 } // namespace internal 3313 } // namespace internal
3324 } // namespace v8 3314 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | src/wasm/wasm-module.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698