Commit a01643bc authored by Kevin Modzelewski's avatar Kevin Modzelewski

xxx testing

parent 206b8a24
...@@ -167,6 +167,7 @@ RewriterVar* JitFragmentWriter::emitAugbinop(AST_expr* node, RewriterVar* lhs, R ...@@ -167,6 +167,7 @@ RewriterVar* JitFragmentWriter::emitAugbinop(AST_expr* node, RewriterVar* lhs, R
} }
RewriterVar* JitFragmentWriter::emitBinop(AST_expr* node, RewriterVar* lhs, RewriterVar* rhs, int op_type) { RewriterVar* JitFragmentWriter::emitBinop(AST_expr* node, RewriterVar* lhs, RewriterVar* rhs, int op_type) {
printf("lhs is %p\n", lhs);
/// XXX increase this too much for testing /// XXX increase this too much for testing
return emitPPCall((void*)binop, { lhs, rhs, imm(op_type) }, 2, 640, node)->setType(RefType::OWNED); return emitPPCall((void*)binop, { lhs, rhs, imm(op_type) }, 2, 640, node)->setType(RefType::OWNED);
} }
......
...@@ -26,7 +26,7 @@ int MAX_OPT_ITERATIONS = 1; ...@@ -26,7 +26,7 @@ int MAX_OPT_ITERATIONS = 1;
bool ASSEMBLY_LOGGING = false; bool ASSEMBLY_LOGGING = false;
bool CONTINUE_AFTER_FATAL = false; bool CONTINUE_AFTER_FATAL = false;
bool FORCE_INTERPRETER = false; bool FORCE_INTERPRETER = true;
bool FORCE_OPTIMIZE = false; bool FORCE_OPTIMIZE = false;
bool SHOW_DISASM = false; bool SHOW_DISASM = false;
bool PROFILE = false; bool PROFILE = false;
...@@ -46,8 +46,8 @@ bool ENABLE_TRACEBACKS = true; ...@@ -46,8 +46,8 @@ bool ENABLE_TRACEBACKS = true;
bool FORCE_LLVM_CAPI_CALLS = false; bool FORCE_LLVM_CAPI_CALLS = false;
bool FORCE_LLVM_CAPI_THROWS = false; bool FORCE_LLVM_CAPI_THROWS = false;
int OSR_THRESHOLD_INTERPRETER = 25; // XXX int OSR_THRESHOLD_INTERPRETER = 5; // XXX
int REOPT_THRESHOLD_INTERPRETER = 2; // XXX int REOPT_THRESHOLD_INTERPRETER = 5; // XXX
int OSR_THRESHOLD_BASELINE = 2500; int OSR_THRESHOLD_BASELINE = 2500;
int REOPT_THRESHOLD_BASELINE = 1500; int REOPT_THRESHOLD_BASELINE = 1500;
int OSR_THRESHOLD_T2 = 10000; int OSR_THRESHOLD_T2 = 10000;
...@@ -57,7 +57,7 @@ int SPECULATION_THRESHOLD = 100; ...@@ -57,7 +57,7 @@ int SPECULATION_THRESHOLD = 100;
int MAX_OBJECT_CACHE_ENTRIES = 500; int MAX_OBJECT_CACHE_ENTRIES = 500;
static bool _GLOBAL_ENABLE = 1; static bool _GLOBAL_ENABLE = 1;
bool ENABLE_ICS = 1 && _GLOBAL_ENABLE; bool ENABLE_ICS = 0 && _GLOBAL_ENABLE;
bool ENABLE_ICGENERICS = 1 && ENABLE_ICS; bool ENABLE_ICGENERICS = 1 && ENABLE_ICS;
bool ENABLE_ICGETITEMS = 1 && ENABLE_ICS; bool ENABLE_ICGETITEMS = 1 && ENABLE_ICS;
bool ENABLE_ICSETITEMS = 1 && ENABLE_ICS; bool ENABLE_ICSETITEMS = 1 && ENABLE_ICS;
......
...@@ -88,14 +88,15 @@ PyIntObject* BoxedInt::fill_free_list(void) { ...@@ -88,14 +88,15 @@ PyIntObject* BoxedInt::fill_free_list(void) {
} }
void BoxedInt::tp_dealloc(Box* v) { void BoxedInt::tp_dealloc(Box* v) {
if (PyInt_CheckExact(v)) { //if (PyInt_CheckExact(v)) {
BoxedInt::tp_free(v); //BoxedInt::tp_free(v);
} else { //} else {
v->cls->tp_free(v); v->cls->tp_free(v);
} //}
} }
void BoxedInt::tp_free(void* b) { void BoxedInt::tp_free(void* b) {
assert(0);
PyIntObject* v = static_cast<PyIntObject*>(b); PyIntObject* v = static_cast<PyIntObject*>(b);
v->ob_type = (struct _typeobject *)free_list; v->ob_type = (struct _typeobject *)free_list;
free_list = v; free_list = v;
......
...@@ -3761,7 +3761,7 @@ void setupRuntime() { ...@@ -3761,7 +3761,7 @@ void setupRuntime() {
dict_cls->tp_flags |= Py_TPFLAGS_DICT_SUBCLASS; dict_cls->tp_flags |= Py_TPFLAGS_DICT_SUBCLASS;
file_cls = new (0) BoxedClass(object_cls, 0, offsetof(BoxedFile, weakreflist), file_cls = new (0) BoxedClass(object_cls, 0, offsetof(BoxedFile, weakreflist),
sizeof(BoxedFile), false, "file", file_dealloc, NULL, false); sizeof(BoxedFile), false, "file", file_dealloc, NULL, false);
int_cls = new (0) BoxedClass(object_cls, 0, 0, sizeof(BoxedInt), false, "int", BoxedInt::tp_dealloc, BoxedInt::tp_free, false); int_cls = new (0) BoxedClass(object_cls, 0, 0, sizeof(BoxedInt), false, "int", BoxedInt::tp_dealloc, /*BoxedInt::tp_free*/NULL, false);
int_cls->tp_flags |= Py_TPFLAGS_INT_SUBCLASS; int_cls->tp_flags |= Py_TPFLAGS_INT_SUBCLASS;
bool_cls = new (0) BoxedClass(int_cls, 0, 0, sizeof(BoxedBool), false, "bool", NULL, NULL, false); bool_cls = new (0) BoxedClass(int_cls, 0, 0, sizeof(BoxedBool), false, "bool", NULL, NULL, false);
complex_cls = new (0) BoxedClass(object_cls, 0, 0, sizeof(BoxedComplex), false, "complex", NULL, NULL, false); complex_cls = new (0) BoxedClass(object_cls, 0, 0, sizeof(BoxedComplex), false, "complex", NULL, NULL, false);
......
...@@ -419,6 +419,8 @@ public: ...@@ -419,6 +419,8 @@ public:
} }
// int uses a customized allocator, so we can't use DEFAULT_CLASS_SIMPLE (which inlines the default allocator) // int uses a customized allocator, so we can't use DEFAULT_CLASS_SIMPLE (which inlines the default allocator)
void* operator new(size_t size) __attribute__((visibility("default"))) { void* operator new(size_t size) __attribute__((visibility("default"))) {
return Box::operator new (size, int_cls);
/*
if (free_list == NULL) { if (free_list == NULL) {
free_list = fill_free_list(); free_list = fill_free_list();
RELEASE_ASSERT(free_list, ""); RELEASE_ASSERT(free_list, "");
...@@ -428,6 +430,7 @@ public: ...@@ -428,6 +430,7 @@ public:
free_list = (PyIntObject*)v->ob_type; free_list = (PyIntObject*)v->ob_type;
PyObject_INIT((BoxedInt*)v, &PyInt_Type); PyObject_INIT((BoxedInt*)v, &PyInt_Type);
return v; return v;
*/
} }
static void tp_dealloc(Box* b); static void tp_dealloc(Box* b);
......
def f():
n = 20
while n:
n = n - 1
f()
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment