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

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, 7 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') | src/wasm/wasm-module.cc » ('J')
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 3263 matching lines...) Expand 10 before | Expand all | Expand 10 after
3274 } 3274 }
3275 if (job_->GenerateCode() != CompilationJob::SUCCEEDED) { 3275 if (job_->GenerateCode() != CompilationJob::SUCCEEDED) {
3276 return Handle<Code>::null(); 3276 return Handle<Code>::null();
3277 } 3277 }
3278 base::ElapsedTimer compile_timer; 3278 base::ElapsedTimer compile_timer;
3279 if (FLAG_trace_wasm_decode_time) { 3279 if (FLAG_trace_wasm_decode_time) {
3280 compile_timer.Start(); 3280 compile_timer.Start();
3281 } 3281 }
3282 Handle<Code> code = info_.code(); 3282 Handle<Code> code = info_.code();
3283 DCHECK(!code.is_null()); 3283 DCHECK(!code.is_null());
3284 DCHECK(code->deoptimization_data() == nullptr ||
3285 code->deoptimization_data()->length() == 0);
3286 Handle<FixedArray> deopt_data =
3287 isolate_->factory()->NewFixedArray(2, TENURED);
3288 if (!module_env_->instance->js_object().is_null()) {
3289 deopt_data->set(0, *module_env_->instance->js_object());
3290 }
3291 deopt_data->set(1, Smi::FromInt(function_->func_index));
3292 deopt_data->set_length(2);
3293 code->set_deoptimization_data(*deopt_data);
3294 3284
3295 RecordFunctionCompilation( 3285 RecordFunctionCompilation(
3296 Logger::FUNCTION_TAG, &info_, "WASM_function", function_->func_index, 3286 Logger::FUNCTION_TAG, &info_, "WASM_function", function_->func_index,
3297 module_env_->module->GetName(function_->name_offset, 3287 module_env_->module->GetName(function_->name_offset,
3298 function_->name_length)); 3288 function_->name_length));
3299 3289
3300 if (FLAG_trace_wasm_decode_time) { 3290 if (FLAG_trace_wasm_decode_time) {
3301 double compile_ms = compile_timer.Elapsed().InMillisecondsF(); 3291 double compile_ms = compile_timer.Elapsed().InMillisecondsF();
3302 PrintF("wasm-code-generation ok: %d bytes, %0.3f ms code generation\n", 3292 PrintF("wasm-code-generation ok: %d bytes, %0.3f ms code generation\n",
3303 static_cast<int>(function_->code_end_offset - 3293 static_cast<int>(function_->code_end_offset -
3304 function_->code_start_offset), 3294 function_->code_start_offset),
3305 compile_ms); 3295 compile_ms);
3306 } 3296 }
3307 3297
3308 return code; 3298 return code;
3309 } 3299 }
3310 3300
3311 } // namespace compiler 3301 } // namespace compiler
3312 } // namespace internal 3302 } // namespace internal
3313 } // namespace v8 3303 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | src/wasm/wasm-module.h » ('j') | src/wasm/wasm-module.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698