blueloveTH 3 лет назад
Родитель
Сommit
90ae5edac2
4 измененных файлов с 7 добавлено и 3 удалено
  1. 1 1
      plugins/flutter/src/pocketpy.h
  2. 4 0
      src/codeobject.h
  3. 1 1
      src/obj.h
  4. 1 1
      src/vm.h

+ 1 - 1
plugins/flutter/src/pocketpy.h

@@ -3080,7 +3080,7 @@ struct PyObject {
     // currently __name__ is only used for 'type'
     PyVar _typeName(){ return _type->attribs[__name__]; }
 
-    PyObject(PyVar type) : _type(type) {}
+    PyObject(const PyVar& type) : _type(type) {}
     virtual ~PyObject() = default;
 };
 

+ 4 - 0
src/codeobject.h

@@ -144,6 +144,10 @@ struct CodeObject {
         co_consts.push_back(v);
         return co_consts.size() - 1;
     }
+
+    void optimize_level_1(){
+        
+    }
 };
 
 class Frame {

+ 1 - 1
src/obj.h

@@ -77,7 +77,7 @@ struct PyObject {
     // currently __name__ is only used for 'type'
     PyVar _typeName(){ return _type->attribs[__name__]; }
 
-    PyObject(PyVar type) : _type(type) {}
+    PyObject(const PyVar& type) : _type(type) {}
     virtual ~PyObject() = default;
 };
 

+ 1 - 1
src/vm.h

@@ -555,7 +555,7 @@ public:
         if(_module == nullptr) _module = _main;
         try {
             _Code code = compile(source, filename, mode);
-            // if(filename != "<builtins>") std::cout << disassemble(code) << std::endl;
+            if(filename != "<builtins>") std::cout << disassemble(code) << std::endl;
             return _exec(code, _module, {});
         }catch (const _Error& e){
             *_stderr << e.what() << '\n';