Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
Pyston
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
Pyston
Commits
79dc30d1
Commit
79dc30d1
authored
Aug 20, 2014
by
Kevin Modzelewski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
The _sre module now compiles and links (but doesn't run yet)
parent
88c308f5
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
29 additions
and
36 deletions
+29
-36
src/Makefile
src/Makefile
+1
-1
src/runtime/builtin_modules/_sre.cpp
src/runtime/builtin_modules/_sre.cpp
+0
-33
src/runtime/capi.cpp
src/runtime/capi.cpp
+26
-0
src/runtime/types.cpp
src/runtime/types.cpp
+2
-1
src/runtime/types.h
src/runtime/types.h
+0
-1
No files found.
src/Makefile
View file @
79dc30d1
...
...
@@ -268,7 +268,7 @@ SRCS := $(MAIN_SRCS) $(STDLIB_SRCS)
STDLIB_OBJS
:=
stdlib.bc.o stdlib.stripped.bc.o
STDLIB_RELEASE_OBJS
:=
stdlib.release.bc.o
STDMODULE_SRCS
:=
errnomodule.c shamodule.c sha256module.c sha512module.c md5.c md5module.c
$(EXTRA_STDMODULE_SRCS)
STDMODULE_SRCS
:=
errnomodule.c shamodule.c sha256module.c sha512module.c md5.c md5module.c
_sre.c
$(EXTRA_STDMODULE_SRCS)
FROM_CPYTHON_SRCS
:=
$(
addprefix
../lib_python/2.7_Modules/,
$(STDMODULE_SRCS)
)
$(
wildcard
capi/
*
.c
)
# The stdlib objects have slightly longer dependency chains,
...
...
src/runtime/builtin_modules/_sre.cpp
deleted
100644 → 0
View file @
88c308f5
// Copyright (c) 2014 Dropbox, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#include <cmath>
#include "core/types.h"
#include "gc/collector.h"
#include "runtime/inline/boxing.h"
#include "runtime/types.h"
#include "runtime/util.h"
namespace
pyston
{
BoxedModule
*
sre_module
;
void
setupSre
()
{
sre_module
=
createModule
(
"_sre"
,
"__builtin__"
);
sre_module
->
giveAttr
(
"MAGIC"
,
boxInt
(
20031017
));
sre_module
->
giveAttr
(
"CODESIZE"
,
boxInt
(
4
));
}
}
src/runtime/capi.cpp
View file @
79dc30d1
...
...
@@ -365,6 +365,25 @@ extern "C" void PyObject_ClearWeakRefs(PyObject* object) {
}
extern
"C"
PyObject
*
PySequence_GetItem
(
PyObject
*
o
,
Py_ssize_t
i
)
{
try
{
// Not sure if this is really the same:
return
getitem
(
o
,
boxInt
(
i
));
}
catch
(
Box
*
b
)
{
abort
();
}
}
extern
"C"
PyObject
*
PySequence_GetSlice
(
PyObject
*
o
,
Py_ssize_t
i1
,
Py_ssize_t
i2
)
{
try
{
// Not sure if this is really the same:
return
getitem
(
o
,
new
BoxedSlice
(
boxInt
(
i1
),
boxInt
(
i2
),
None
));
}
catch
(
Box
*
b
)
{
abort
();
}
}
extern
"C"
int
PyCallable_Check
(
PyObject
*
x
)
{
if
(
x
==
NULL
)
return
0
;
...
...
@@ -419,6 +438,7 @@ extern "C" int PyErr_WarnEx(PyObject* category, const char* text, Py_ssize_t sta
abort
();
}
extern
"C"
PyObject
*
PyImport_Import
(
PyObject
*
module_name
)
{
RELEASE_ASSERT
(
module_name
,
""
);
RELEASE_ASSERT
(
module_name
->
cls
==
str_cls
,
""
);
...
...
@@ -430,6 +450,12 @@ extern "C" PyObject* PyImport_Import(PyObject* module_name) {
}
}
extern
"C"
PyObject
*
PyCallIter_New
(
PyObject
*
callable
,
PyObject
*
sentinel
)
{
abort
();
}
BoxedModule
*
importTestExtension
()
{
const
char
*
pathname
=
"../test/test_extension/test.so"
;
void
*
handle
=
dlopen
(
pathname
,
RTLD_NOW
);
...
...
src/runtime/types.cpp
View file @
79dc30d1
...
...
@@ -36,6 +36,7 @@ extern "C" void init_sha();
extern
"C"
void
init_sha256
();
extern
"C"
void
init_sha512
();
extern
"C"
void
init_md5
();
extern
"C"
void
init_sre
();
namespace
pyston
{
...
...
@@ -758,7 +759,6 @@ void setupRuntime() {
setupTime
();
setupThread
();
setupPosix
();
setupSre
();
setupCAPI
();
...
...
@@ -767,6 +767,7 @@ void setupRuntime() {
init_sha256
();
init_sha512
();
init_md5
();
// init_sre();
setupSysEnd
();
...
...
src/runtime/types.h
View file @
79dc30d1
...
...
@@ -66,7 +66,6 @@ void setupMath();
void
setupTime
();
void
setupThread
();
void
setupPosix
();
void
setupSre
();
void
setupSysEnd
();
BoxedDict
*
getSysModulesDict
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment