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

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

Issue 2260583002: Revert of [Interpreter] Introduce InterpreterCompilationJob (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@offheap_peekhole
Patch Set: Created 4 years, 4 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 | « src/compiler/pipeline.cc ('k') | src/crankshaft/hydrogen.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 <memory> 7 #include <memory>
8 8
9 #include "src/isolate-inl.h" 9 #include "src/isolate-inl.h"
10 10
(...skipping 3156 matching lines...) Expand 10 before | Expand all | Expand 10 after
3167 3167
3168 // Run the compiler pipeline to generate machine code. 3168 // Run the compiler pipeline to generate machine code.
3169 CallDescriptor* descriptor = wasm::ModuleEnv::GetWasmCallDescriptor( 3169 CallDescriptor* descriptor = wasm::ModuleEnv::GetWasmCallDescriptor(
3170 &compilation_zone_, function_->sig); 3170 &compilation_zone_, function_->sig);
3171 if (jsgraph_->machine()->Is32()) { 3171 if (jsgraph_->machine()->Is32()) {
3172 descriptor = 3172 descriptor =
3173 module_env_->GetI32WasmCallDescriptor(&compilation_zone_, descriptor); 3173 module_env_->GetI32WasmCallDescriptor(&compilation_zone_, descriptor);
3174 } 3174 }
3175 job_.reset(Pipeline::NewWasmCompilationJob(&info_, jsgraph_->graph(), 3175 job_.reset(Pipeline::NewWasmCompilationJob(&info_, jsgraph_->graph(),
3176 descriptor, source_positions)); 3176 descriptor, source_positions));
3177 ok_ = job_->ExecuteJob() == CompilationJob::SUCCEEDED; 3177
3178 // The function name {OptimizeGraph()} is misleading but necessary because we
3179 // want to use the CompilationJob interface. A better name would be
3180 // ScheduleGraphAndSelectInstructions.
3181 ok_ = job_->OptimizeGraph() == CompilationJob::SUCCEEDED;
3178 // TODO(bradnelson): Improve histogram handling of size_t. 3182 // TODO(bradnelson): Improve histogram handling of size_t.
3179 // TODO(ahaas): The counters are not thread-safe at the moment. 3183 // TODO(ahaas): The counters are not thread-safe at the moment.
3180 // isolate_->counters()->wasm_compile_function_peak_memory_bytes() 3184 // isolate_->counters()->wasm_compile_function_peak_memory_bytes()
3181 // ->AddSample( 3185 // ->AddSample(
3182 // static_cast<int>(jsgraph->graph()->zone()->allocation_size())); 3186 // static_cast<int>(jsgraph->graph()->zone()->allocation_size()));
3183 3187
3184 if (FLAG_trace_wasm_decode_time) { 3188 if (FLAG_trace_wasm_decode_time) {
3185 double pipeline_ms = pipeline_timer.Elapsed().InMillisecondsF(); 3189 double pipeline_ms = pipeline_timer.Elapsed().InMillisecondsF();
3186 PrintF( 3190 PrintF(
3187 "wasm-compilation phase 1 ok: %d bytes, %0.3f ms decode, %zu nodes, " 3191 "wasm-compilation phase 1 ok: %d bytes, %0.3f ms decode, %zu nodes, "
(...skipping 11 matching lines...) Expand all
3199 ScopedVector<char> buffer(128); 3203 ScopedVector<char> buffer(128);
3200 wasm::WasmName name = module_env_->module->GetName( 3204 wasm::WasmName name = module_env_->module->GetName(
3201 function_->name_offset, function_->name_length); 3205 function_->name_offset, function_->name_length);
3202 SNPrintF(buffer, "Compiling WASM function #%d:%.*s failed:", 3206 SNPrintF(buffer, "Compiling WASM function #%d:%.*s failed:",
3203 function_->func_index, name.length(), name.start()); 3207 function_->func_index, name.length(), name.start());
3204 thrower_->Failed(buffer.start(), graph_construction_result_); 3208 thrower_->Failed(buffer.start(), graph_construction_result_);
3205 } 3209 }
3206 3210
3207 return Handle<Code>::null(); 3211 return Handle<Code>::null();
3208 } 3212 }
3209 if (job_->FinalizeJob() != CompilationJob::SUCCEEDED) { 3213 if (job_->GenerateCode() != CompilationJob::SUCCEEDED) {
3210 return Handle<Code>::null(); 3214 return Handle<Code>::null();
3211 } 3215 }
3212 base::ElapsedTimer compile_timer; 3216 base::ElapsedTimer compile_timer;
3213 if (FLAG_trace_wasm_decode_time) { 3217 if (FLAG_trace_wasm_decode_time) {
3214 compile_timer.Start(); 3218 compile_timer.Start();
3215 } 3219 }
3216 Handle<Code> code = info_.code(); 3220 Handle<Code> code = info_.code();
3217 DCHECK(!code.is_null()); 3221 DCHECK(!code.is_null());
3218 3222
3219 if (isolate_->logger()->is_logging_code_events() || 3223 if (isolate_->logger()->is_logging_code_events() ||
(...skipping 12 matching lines...) Expand all
3232 function_->code_start_offset), 3236 function_->code_start_offset),
3233 compile_ms); 3237 compile_ms);
3234 } 3238 }
3235 3239
3236 return code; 3240 return code;
3237 } 3241 }
3238 3242
3239 } // namespace compiler 3243 } // namespace compiler
3240 } // namespace internal 3244 } // namespace internal
3241 } // namespace v8 3245 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/pipeline.cc ('k') | src/crankshaft/hydrogen.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698