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

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

Issue 2395133002: Revert of [wasm] Refactor import handling for 0xC. (Closed)
Patch Set: Created 4 years, 2 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/wasm-compiler.h ('k') | src/wasm/module-decoder.cc » ('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 3133 matching lines...) Expand 10 before | Expand all | Expand 10 after
3144 RecordFunctionCompilation( 3144 RecordFunctionCompilation(
3145 CodeEventListener::FUNCTION_TAG, isolate, code, "js-to-wasm", index, 3145 CodeEventListener::FUNCTION_TAG, isolate, code, "js-to-wasm", index,
3146 wasm::WasmName("export"), 3146 wasm::WasmName("export"),
3147 module->module->GetName(func->name_offset, func->name_length)); 3147 module->module->GetName(func->name_offset, func->name_length));
3148 } 3148 }
3149 return code; 3149 return code;
3150 } 3150 }
3151 3151
3152 Handle<Code> CompileWasmToJSWrapper(Isolate* isolate, Handle<JSReceiver> target, 3152 Handle<Code> CompileWasmToJSWrapper(Isolate* isolate, Handle<JSReceiver> target,
3153 wasm::FunctionSig* sig, uint32_t index, 3153 wasm::FunctionSig* sig, uint32_t index,
3154 Handle<String> module_name, 3154 Handle<String> import_module,
3155 MaybeHandle<String> import_name) { 3155 MaybeHandle<String> import_function) {
3156 //---------------------------------------------------------------------------- 3156 //----------------------------------------------------------------------------
3157 // Create the Graph 3157 // Create the Graph
3158 //---------------------------------------------------------------------------- 3158 //----------------------------------------------------------------------------
3159 Zone zone(isolate->allocator()); 3159 Zone zone(isolate->allocator());
3160 Graph graph(&zone); 3160 Graph graph(&zone);
3161 CommonOperatorBuilder common(&zone); 3161 CommonOperatorBuilder common(&zone);
3162 MachineOperatorBuilder machine(&zone); 3162 MachineOperatorBuilder machine(&zone);
3163 JSGraph jsgraph(isolate, &graph, &common, nullptr, nullptr, &machine); 3163 JSGraph jsgraph(isolate, &graph, &common, nullptr, nullptr, &machine);
3164 3164
3165 Node* control = nullptr; 3165 Node* control = nullptr;
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
3208 code->Disassemble(buffer.start(), os); 3208 code->Disassemble(buffer.start(), os);
3209 } 3209 }
3210 #endif 3210 #endif
3211 if (debugging) { 3211 if (debugging) {
3212 buffer.Dispose(); 3212 buffer.Dispose();
3213 } 3213 }
3214 } 3214 }
3215 if (isolate->logger()->is_logging_code_events() || isolate->is_profiling()) { 3215 if (isolate->logger()->is_logging_code_events() || isolate->is_profiling()) {
3216 const char* function_name = nullptr; 3216 const char* function_name = nullptr;
3217 int function_name_size = 0; 3217 int function_name_size = 0;
3218 if (!import_name.is_null()) { 3218 if (!import_function.is_null()) {
3219 Handle<String> handle = import_name.ToHandleChecked(); 3219 Handle<String> handle = import_function.ToHandleChecked();
3220 function_name = handle->ToCString().get(); 3220 function_name = handle->ToCString().get();
3221 function_name_size = handle->length(); 3221 function_name_size = handle->length();
3222 } 3222 }
3223 RecordFunctionCompilation( 3223 RecordFunctionCompilation(
3224 CodeEventListener::FUNCTION_TAG, isolate, code, "wasm-to-js", index, 3224 CodeEventListener::FUNCTION_TAG, isolate, code, "wasm-to-js", index,
3225 {module_name->ToCString().get(), module_name->length()}, 3225 {import_module->ToCString().get(), import_module->length()},
3226 {function_name, function_name_size}); 3226 {function_name, function_name_size});
3227 } 3227 }
3228 3228
3229 return code; 3229 return code;
3230 } 3230 }
3231 3231
3232 SourcePositionTable* WasmCompilationUnit::BuildGraphForWasmFunction( 3232 SourcePositionTable* WasmCompilationUnit::BuildGraphForWasmFunction(
3233 double* decode_ms) { 3233 double* decode_ms) {
3234 base::ElapsedTimer decode_timer; 3234 base::ElapsedTimer decode_timer;
3235 if (FLAG_trace_wasm_decode_time) { 3235 if (FLAG_trace_wasm_decode_time) {
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
3402 function_->code_start_offset), 3402 function_->code_start_offset),
3403 compile_ms); 3403 compile_ms);
3404 } 3404 }
3405 3405
3406 return code; 3406 return code;
3407 } 3407 }
3408 3408
3409 } // namespace compiler 3409 } // namespace compiler
3410 } // namespace internal 3410 } // namespace internal
3411 } // namespace v8 3411 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/wasm-compiler.h ('k') | src/wasm/module-decoder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698