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

Unified Diff: src/wasm/managed.h

Issue 2629823003: [wasm] Implement frame inspection for interpreted frames (Closed)
Patch Set: Rebase after Yangs revert ಠ益ಠ Created 3 years, 11 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/runtime/runtime-wasm.cc ('k') | src/wasm/wasm-debug.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/wasm/managed.h
diff --git a/src/wasm/managed.h b/src/wasm/managed.h
index 785d5d32c0ac314349d8f0b5a1ad2ed318a78d06..5e2a9c82d561b858223af982533cbfc46e58539c 100644
--- a/src/wasm/managed.h
+++ b/src/wasm/managed.h
@@ -22,12 +22,15 @@ class Managed : public Foreign {
return reinterpret_cast<CppType*>(foreign_address());
}
+ static Managed<CppType>* cast(Object* obj) {
+ SLOW_DCHECK(obj->IsForeign());
+ return reinterpret_cast<Managed<CppType>*>(obj);
+ }
+
static Handle<Managed<CppType>> New(Isolate* isolate, CppType* ptr,
bool delete_on_gc = true) {
- Handle<Foreign> foreign =
- isolate->factory()->NewForeign(reinterpret_cast<Address>(ptr));
- Handle<Managed<CppType>> handle(
- reinterpret_cast<Managed<CppType>*>(*foreign), isolate);
+ Handle<Managed<CppType>> handle = Handle<Managed<CppType>>::cast(
+ isolate->factory()->NewForeign(reinterpret_cast<Address>(ptr)));
if (delete_on_gc) {
RegisterWeakCallbackForDelete(isolate, handle);
}
« no previous file with comments | « src/runtime/runtime-wasm.cc ('k') | src/wasm/wasm-debug.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698