aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Python/generated_cases.c.h
diff options
context:
space:
mode:
Diffstat (limited to 'Python/generated_cases.c.h')
-rw-r--r--Python/generated_cases.c.h96
1 files changed, 96 insertions, 0 deletions
diff --git a/Python/generated_cases.c.h b/Python/generated_cases.c.h
index 88ab86a774f..89bfc069080 100644
--- a/Python/generated_cases.c.h
+++ b/Python/generated_cases.c.h
@@ -1088,6 +1088,64 @@
DISPATCH();
}
+ TARGET(BUILD_INTERPOLATION) {
+ #if Py_TAIL_CALL_INTERP
+ int opcode = BUILD_INTERPOLATION;
+ (void)(opcode);
+ #endif
+ frame->instr_ptr = next_instr;
+ next_instr += 1;
+ INSTRUCTION_STATS(BUILD_INTERPOLATION);
+ _PyStackRef value;
+ _PyStackRef str;
+ _PyStackRef *format;
+ _PyStackRef interpolation;
+ format = &stack_pointer[-(oparg & 1)];
+ str = stack_pointer[-1 - (oparg & 1)];
+ value = stack_pointer[-2 - (oparg & 1)];
+ PyObject *value_o = PyStackRef_AsPyObjectBorrow(value);
+ PyObject *str_o = PyStackRef_AsPyObjectBorrow(str);
+ int conversion = oparg >> 2;
+ PyObject *format_o;
+ if (oparg & 1) {
+ format_o = PyStackRef_AsPyObjectBorrow(format[0]);
+ }
+ else {
+ format_o = &_Py_STR(empty);
+ }
+ _PyFrame_SetStackPointer(frame, stack_pointer);
+ PyObject *interpolation_o = _PyInterpolation_Build(value_o, str_o, conversion, format_o);
+ stack_pointer = _PyFrame_GetStackPointer(frame);
+ if (oparg & 1) {
+ stack_pointer += -(oparg & 1);
+ assert(WITHIN_STACK_BOUNDS());
+ _PyFrame_SetStackPointer(frame, stack_pointer);
+ PyStackRef_CLOSE(format[0]);
+ stack_pointer = _PyFrame_GetStackPointer(frame);
+ }
+ else {
+ stack_pointer += -(oparg & 1);
+ }
+ stack_pointer += -1;
+ assert(WITHIN_STACK_BOUNDS());
+ _PyFrame_SetStackPointer(frame, stack_pointer);
+ PyStackRef_CLOSE(str);
+ stack_pointer = _PyFrame_GetStackPointer(frame);
+ stack_pointer += -1;
+ assert(WITHIN_STACK_BOUNDS());
+ _PyFrame_SetStackPointer(frame, stack_pointer);
+ PyStackRef_CLOSE(value);
+ stack_pointer = _PyFrame_GetStackPointer(frame);
+ if (interpolation_o == NULL) {
+ JUMP_TO_LABEL(error);
+ }
+ interpolation = PyStackRef_FromPyObjectSteal(interpolation_o);
+ stack_pointer[0] = interpolation;
+ stack_pointer += 1;
+ assert(WITHIN_STACK_BOUNDS());
+ DISPATCH();
+ }
+
TARGET(BUILD_LIST) {
#if Py_TAIL_CALL_INTERP
int opcode = BUILD_LIST;
@@ -1303,6 +1361,44 @@
DISPATCH();
}
+ TARGET(BUILD_TEMPLATE) {
+ #if Py_TAIL_CALL_INTERP
+ int opcode = BUILD_TEMPLATE;
+ (void)(opcode);
+ #endif
+ frame->instr_ptr = next_instr;
+ next_instr += 1;
+ INSTRUCTION_STATS(BUILD_TEMPLATE);
+ _PyStackRef strings;
+ _PyStackRef interpolations;
+ _PyStackRef template;
+ interpolations = stack_pointer[-1];
+ strings = stack_pointer[-2];
+ PyObject *strings_o = PyStackRef_AsPyObjectBorrow(strings);
+ PyObject *interpolations_o = PyStackRef_AsPyObjectBorrow(interpolations);
+ _PyFrame_SetStackPointer(frame, stack_pointer);
+ PyObject *template_o = _PyTemplate_Build(strings_o, interpolations_o);
+ stack_pointer = _PyFrame_GetStackPointer(frame);
+ stack_pointer += -1;
+ assert(WITHIN_STACK_BOUNDS());
+ _PyFrame_SetStackPointer(frame, stack_pointer);
+ PyStackRef_CLOSE(interpolations);
+ stack_pointer = _PyFrame_GetStackPointer(frame);
+ stack_pointer += -1;
+ assert(WITHIN_STACK_BOUNDS());
+ _PyFrame_SetStackPointer(frame, stack_pointer);
+ PyStackRef_CLOSE(strings);
+ stack_pointer = _PyFrame_GetStackPointer(frame);
+ if (template_o == NULL) {
+ JUMP_TO_LABEL(error);
+ }
+ template = PyStackRef_FromPyObjectSteal(template_o);
+ stack_pointer[0] = template;
+ stack_pointer += 1;
+ assert(WITHIN_STACK_BOUNDS());
+ DISPATCH();
+ }
+
TARGET(BUILD_TUPLE) {
#if Py_TAIL_CALL_INTERP
int opcode = BUILD_TUPLE;