8000 bpo-44337: Port LOAD_ATTR to PEP 659 adaptive interpreter by markshannon · Pull Request #26595 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

bpo-44337: Port LOAD_ATTR to PEP 659 adaptive interpreter #26595

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 17 commits into from
Jun 10, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Move dict-common.h to internal/pycore_dict.h
  • Loading branch information
markshannon committed Jun 8, 2021
commit 35522bcf8c4f443373df34a2038c32142ec80daf
8000 19 changes: 17 additions & 2 deletions Objects/dict-common.h → Include/internal/pycore_dict.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
#ifndef Py_DICT_COMMON_H
#define Py_DICT_COMMON_H

#ifndef Py_INTERNAL_DICT_H
#define Py_INTERNAL_DICT_H
#ifdef __cplusplus
extern "C" {
#endif

#ifndef Py_BUILD_CORE
# error "this header requires Py_BUILD_CORE define"
#endif


typedef struct {
/* Cached hash code of me_key. */
Expand Down Expand Up @@ -62,4 +71,10 @@ struct _dictkeysobject {
see the DK_ENTRIES() macro */
};

#define _PyList_ITEMS(op) (_PyList_CAST(op)->ob_item)


#ifdef __cplusplus
}
#endif
#endif /* !Py_INTERNAL_DICT_H */
4 changes: 2 additions & 2 deletions Makefile.pre.in
Original file line number Diff line number Diff line change
Expand Up @@ -979,8 +979,7 @@ Objects/bytearrayobject.o: $(srcdir)/Objects/bytearrayobject.c $(BYTESTR_DEPS)

Objects/unicodeobject.o: $(srcdir)/Objects/unicodeobject.c $(UNICODE_DEPS)

Objects/odictobject.o: $(srcdir)/Objects/dict-common.h
Objects/dictobject.o: $(srcdir)/Objects/stringlib/eq.h $(srcdir)/Objects/dict-common.h
Objects/dictobject.o: $(srcdir)/Objects/stringlib/eq.h
Objects/setobject.o: $(srcdir)/Objects/stringlib/eq.h

.PHONY: regen-opcode-targets
Expand Down Expand Up @@ -1156,6 +1155,7 @@ PYTHON_HEADERS= \
$(srcdir)/Include/internal/pycore_compile.h \
$(srcdir)/Include/internal/pycore_condvar.h \
$(srcdir)/Include/internal/pycore_context.h \
$(srcdir)/Include/internal/pycore_dict.h \
$(srcdir)/Include/internal/pycore_dtoa.h \
$(srcdir)/Include/internal/pycore_fileutils.h \
$(srcdir)/Include/internal/pycore_format.h \
Expand Down
2 changes: 1 addition & 1 deletion Objects/dictobject.c
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ converting the dict to the combined table.
#include "pycore_object.h" // _PyObject_GC_TRACK()
#include "pycore_pyerrors.h" // _PyErr_Fetch()
#include "pycore_pystate.h" // _PyThreadState_GET()
#include "dict-common.h"
#include "pycore_dict.h"
#include "stringlib/eq.h" // unicode_eq()

/*[clinic input]
Expand Down
2 changes: 1 addition & 1 deletion Objects/odictobject.c
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,7 @@ Potential Optimizations
#include "Python.h"
#include "pycore_object.h"
#include <stddef.h> // offsetof()
#include "dict-common.h"
#include "pycore_dict.h"
#include <stddef.h>

#include "clinic/odictobject.c.h"
Expand Down
2 changes: 1 addition & 1 deletion Python/ceval.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
#include "pycore_tuple.h" // _PyTuple_ITEMS()

#include "code.h"
#include "Objects/dict-common.h"
#include "pycore_dict.h"
#include "dictobject.h"
#include "frameobject.h"
#include "pycore_frame.h"
Expand Down
2 changes: 1 addition & 1 deletion Python/specialize.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

#include "Python.h"
#include "pycore_code.h"
#include "Objects/dict-common.h"
#include "pycore_dict.h"
#include "opcode.h"
#include "structmember.h" // struct PyMemberDef, T_OFFSET_EX

Expand Down
0