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

Unified Diff: src/wasm/wasm-module.cc

Issue 2096863003: [wasm] prototype for breakpoint support. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@extend-script-functionality
Patch Set: Created 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/wasm/wasm-module.h ('k') | test/cctest/wasm/test-run-wasm-interpreter.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/wasm/wasm-module.cc
diff --git a/src/wasm/wasm-module.cc b/src/wasm/wasm-module.cc
index d621e8b37e3afb6997aaed0b79fe03c502abc1e3..bd6b6ecd91e4244d64165199ea629282bc7d3074 100644
--- a/src/wasm/wasm-module.cc
+++ b/src/wasm/wasm-module.cc
@@ -292,6 +292,7 @@ bool LinkFunction(Handle<Code> unlinked,
AllowDeferredHandleDereference embedding_raw_address;
for (RelocIterator it(*unlinked, mode_mask); !it.done(); it.next()) {
RelocInfo::Mode mode = it.rinfo()->rmode();
+ DCHECK(RelocInfo::IsCodeTarget(mode));
if (RelocInfo::IsCodeTarget(mode)) {
Code* target =
Code::GetCodeFromTargetAddress(it.rinfo()->target_address());
@@ -1018,10 +1019,10 @@ SeqOneByteString* GetWasmBytes(JSObject* wasm) {
return SeqOneByteString::cast(wasm->GetInternalField(kWasmModuleBytesString));
}
-WasmDebugInfo* GetDebugInfo(JSObject* wasm) {
+WasmDebugInfo* GetDebugInfo(Handle<JSObject> wasm) {
Object* info = wasm->GetInternalField(kWasmDebugInfo);
if (!info->IsUndefined(wasm->GetIsolate())) return WasmDebugInfo::cast(info);
- Handle<WasmDebugInfo> new_info = WasmDebugInfo::New(handle(wasm));
+ Handle<WasmDebugInfo> new_info = WasmDebugInfo::New(wasm);
wasm->SetInternalField(kWasmDebugInfo, *new_info);
return *new_info;
}
@@ -1032,6 +1033,20 @@ int GetNumberOfFunctions(JSObject* wasm) {
return ByteArray::cast(func_names_obj)->get_int(0);
}
+JSArrayBuffer* GetWasmMemoryBuffer(JSObject* wasm) {
+ DCHECK(IsWasmObject(wasm));
+ return JSArrayBuffer::cast(wasm->GetInternalField(kWasmMemArrayBuffer));
+}
+
+Code* GetWasmFunctionCode(JSObject* wasm, uint32_t func_index) {
+ FixedArray* code_table =
+ FixedArray::cast(wasm->GetInternalField(kWasmModuleCodeTable));
+ DCHECK_LE(func_index, static_cast<unsigned>(kMaxInt));
+ int func_index_int = static_cast<int>(func_index);
+ DCHECK_LE(func_index_int, code_table->length());
+ return Code::cast(code_table->get(func_index_int));
+}
+
namespace testing {
int32_t CompileAndRunWasmModule(Isolate* isolate, const byte* module_start,
« no previous file with comments | « src/wasm/wasm-module.h ('k') | test/cctest/wasm/test-run-wasm-interpreter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698