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

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

Issue 2929853003: Fix use of history timers in background threads. (Closed)
Patch Set: Fix nits. Created 3 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
OLDNEW
1 // Copyright 2017 the V8 project authors. All rights reserved. 1 // Copyright 2017 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/wasm/module-compiler.h> 5 #include <src/wasm/module-compiler.h>
6 6
7 #include <src/counters.h> 7 #include <src/counters.h>
8 #include "src/asmjs/asm-js.h" 8 #include "src/asmjs/asm-js.h"
9 #include "src/assembler-inl.h" 9 #include "src/assembler-inl.h"
10 #include "src/property-descriptor.h" 10 #include "src/property-descriptor.h"
(...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after
315 Handle<FixedArray> function_tables = 315 Handle<FixedArray> function_tables =
316 factory->NewFixedArray(function_table_count, TENURED); 316 factory->NewFixedArray(function_table_count, TENURED);
317 Handle<FixedArray> signature_tables = 317 Handle<FixedArray> signature_tables =
318 factory->NewFixedArray(function_table_count, TENURED); 318 factory->NewFixedArray(function_table_count, TENURED);
319 for (int i = 0; i < function_table_count; ++i) { 319 for (int i = 0; i < function_table_count; ++i) {
320 temp_instance.function_tables[i] = factory->NewFixedArray(1, TENURED); 320 temp_instance.function_tables[i] = factory->NewFixedArray(1, TENURED);
321 temp_instance.signature_tables[i] = factory->NewFixedArray(1, TENURED); 321 temp_instance.signature_tables[i] = factory->NewFixedArray(1, TENURED);
322 function_tables->set(i, *temp_instance.function_tables[i]); 322 function_tables->set(i, *temp_instance.function_tables[i]);
323 signature_tables->set(i, *temp_instance.signature_tables[i]); 323 signature_tables->set(i, *temp_instance.signature_tables[i]);
324 } 324 }
325 325 TimedHistogramScope wasm_compile_module_time_scope(
326 if (is_sync_) { 326 module_->is_wasm()
327 // TODO(karlschimpf): Make this work when asynchronous. 327 ? isolate_->counters()->wasm_compile_wasm_module_time()
jochen (gone - plz use gerrit) 2017/06/08 22:15:36 you can't access isolate_ if !is_sync
kschimpf 2017/06/09 20:03:36 Your right.
328 // https://bugs.chromium.org/p/v8/issues/detail?id=6361 328 : isolate_->counters()->wasm_compile_asm_module_time());
329 HistogramTimerScope wasm_compile_module_time_scope(
330 module_->is_wasm()
331 ? isolate_->counters()->wasm_compile_wasm_module_time()
332 : isolate_->counters()->wasm_compile_asm_module_time());
333 return CompileToModuleObjectInternal(
334 thrower, wire_bytes, asm_js_script, asm_js_offset_table_bytes, factory,
335 &temp_instance, &function_tables, &signature_tables);
336 }
337 return CompileToModuleObjectInternal( 329 return CompileToModuleObjectInternal(
338 thrower, wire_bytes, asm_js_script, asm_js_offset_table_bytes, factory, 330 thrower, wire_bytes, asm_js_script, asm_js_offset_table_bytes, factory,
339 &temp_instance, &function_tables, &signature_tables); 331 &temp_instance, &function_tables, &signature_tables);
340 } 332 }
341 333
342 namespace { 334 namespace {
343 bool compile_lazy(const WasmModule* module) { 335 bool compile_lazy(const WasmModule* module) {
344 return FLAG_wasm_lazy_compilation || 336 return FLAG_wasm_lazy_compilation ||
345 (FLAG_asm_wasm_lazy_compilation && module->is_asm_js()); 337 (FLAG_asm_wasm_lazy_compilation && module->is_asm_js());
346 } 338 }
(...skipping 1960 matching lines...) Expand 10 before | Expand all | Expand 10 after
2307 HandleScope scope(job_->isolate_); 2299 HandleScope scope(job_->isolate_);
2308 Handle<WasmModuleObject> result = 2300 Handle<WasmModuleObject> result =
2309 WasmModuleObject::New(job_->isolate_, job_->compiled_module_); 2301 WasmModuleObject::New(job_->isolate_, job_->compiled_module_);
2310 // {job_} is deleted in AsyncCompileSucceeded, therefore the {return}. 2302 // {job_} is deleted in AsyncCompileSucceeded, therefore the {return}.
2311 return job_->AsyncCompileSucceeded(result); 2303 return job_->AsyncCompileSucceeded(result);
2312 } 2304 }
2313 }; 2305 };
2314 } // namespace wasm 2306 } // namespace wasm
2315 } // namespace internal 2307 } // namespace internal
2316 } // namespace v8 2308 } // namespace v8
OLDNEW
« no previous file with comments | « src/counters.cc ('k') | src/wasm/module-decoder.cc » ('j') | src/wasm/module-decoder.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698