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

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

Issue 2963603003: [wasm] Remove some small TODOs and small fixes. (Closed)
Patch Set: Created 3 years, 5 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 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 <functional> 5 #include <functional>
6 #include <memory> 6 #include <memory>
7 7
8 #include "src/code-stubs.h" 8 #include "src/code-stubs.h"
9 #include "src/debug/interface-types.h" 9 #include "src/debug/interface-types.h"
10 #include "src/frames-inl.h" 10 #include "src/frames-inl.h"
(...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after
351 DCHECK_EQ(code->kind() == Code::WASM_INTERPRETER_ENTRY ? 1 : 2, 351 DCHECK_EQ(code->kind() == Code::WASM_INTERPRETER_ENTRY ? 1 : 2,
352 deopt_data->length()); 352 deopt_data->length());
353 Object* weak_link = deopt_data->get(0); 353 Object* weak_link = deopt_data->get(0);
354 DCHECK(weak_link->IsWeakCell()); 354 DCHECK(weak_link->IsWeakCell());
355 WeakCell* cell = WeakCell::cast(weak_link); 355 WeakCell* cell = WeakCell::cast(weak_link);
356 if (cell->cleared()) return nullptr; 356 if (cell->cleared()) return nullptr;
357 return WasmInstanceObject::cast(cell->value()); 357 return WasmInstanceObject::cast(cell->value());
358 } 358 }
359 359
360 WasmModule::WasmModule(std::unique_ptr<Zone> owned) 360 WasmModule::WasmModule(std::unique_ptr<Zone> owned)
361 : signature_zone(std::move(owned)), pending_tasks(new base::Semaphore(0)) {} 361 : signature_zone(std::move(owned)) {}
362 362
363 WasmFunction* wasm::GetWasmFunctionForImportWrapper(Isolate* isolate, 363 WasmFunction* wasm::GetWasmFunctionForImportWrapper(Isolate* isolate,
364 Handle<Object> target) { 364 Handle<Object> target) {
365 if (target->IsJSFunction()) { 365 if (target->IsJSFunction()) {
366 Handle<JSFunction> func = Handle<JSFunction>::cast(target); 366 Handle<JSFunction> func = Handle<JSFunction>::cast(target);
367 if (func->code()->kind() == Code::JS_TO_WASM_FUNCTION) { 367 if (func->code()->kind() == Code::JS_TO_WASM_FUNCTION) {
368 auto exported = Handle<WasmExportedFunction>::cast(func); 368 auto exported = Handle<WasmExportedFunction>::cast(func);
369 Handle<WasmInstanceObject> other_instance(exported->instance(), isolate); 369 Handle<WasmInstanceObject> other_instance(exported->instance(), isolate);
370 int func_index = exported->function_index(); 370 int func_index = exported->function_index();
371 return &other_instance->module()->functions[func_index]; 371 return &other_instance->module()->functions[func_index];
(...skipping 755 matching lines...) Expand 10 before | Expand all | Expand 10 after
1127 callee_compiled->instruction_start()); 1127 callee_compiled->instruction_start());
1128 } 1128 }
1129 DCHECK_EQ(non_compiled_functions.size(), idx); 1129 DCHECK_EQ(non_compiled_functions.size(), idx);
1130 } 1130 }
1131 1131
1132 Code* ret = 1132 Code* ret =
1133 Code::cast(compiled_module->code_table()->get(func_to_return_idx)); 1133 Code::cast(compiled_module->code_table()->get(func_to_return_idx));
1134 DCHECK_EQ(Code::WASM_FUNCTION, ret->kind()); 1134 DCHECK_EQ(Code::WASM_FUNCTION, ret->kind());
1135 return handle(ret, isolate); 1135 return handle(ret, isolate);
1136 } 1136 }
OLDNEW
« src/wasm/wasm-module.h ('K') | « src/wasm/wasm-module.h ('k') | src/wasm/wasm-objects.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698