Explorar el Código

LibJS: Add a way to get from a Cell to the VM

Andreas Kling hace 4 años
padre
commit
d74bb87d46
Se han modificado 2 ficheros con 6 adiciones y 0 borrados
  1. 5 0
      Libraries/LibJS/Runtime/Cell.cpp
  2. 1 0
      Libraries/LibJS/Runtime/Cell.h

+ 5 - 0
Libraries/LibJS/Runtime/Cell.cpp

@@ -51,6 +51,11 @@ Heap& Cell::heap() const
     return HeapBlock::from_cell(this)->heap();
 }
 
+VM& Cell::vm() const
+{
+    return heap().vm();
+}
+
 Interpreter& Cell::interpreter()
 {
     return heap().interpreter();

+ 1 - 0
Libraries/LibJS/Runtime/Cell.h

@@ -60,6 +60,7 @@ public:
     virtual void visit_children(Visitor&) { }
 
     Heap& heap() const;
+    VM& vm() const;
     Interpreter& interpreter();
     Interpreter& interpreter() const;