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
cd73ad20
Commit
cd73ad20
authored
Oct 06, 2014
by
Travis Hance
Committed by
Travis Hance
Oct 29, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
made descr file
parent
26de61ba
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
39 additions
and
12 deletions
+39
-12
src/runtime/descr.cpp
src/runtime/descr.cpp
+34
-0
src/runtime/types.cpp
src/runtime/types.cpp
+3
-12
src/runtime/types.h
src/runtime/types.h
+2
-0
No files found.
src/runtime/descr.cpp
0 → 100644
View file @
cd73ad20
// 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 "codegen/compvars.h"
#include "runtime/types.h"
namespace
pyston
{
static
Box
*
memberGet
(
BoxedMemberDescriptor
*
self
,
Box
*
inst
,
Box
*
owner
)
{
RELEASE_ASSERT
(
self
->
cls
==
member_cls
,
""
);
Py_FatalError
(
"unimplemented"
);
}
void
setupDescr
()
{
member_cls
->
giveAttr
(
"__name__"
,
boxStrConstant
(
"member"
));
member_cls
->
giveAttr
(
"__get__"
,
new
BoxedFunction
(
boxRTFunction
((
void
*
)
memberGet
,
UNKNOWN
,
3
)));
member_cls
->
freeze
();
}
void
teardownDescr
()
{
}
}
src/runtime/types.cpp
View file @
cd73ad20
// 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
// 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
//
...
...
@@ -386,12 +385,6 @@ static Box* functionGet(BoxedFunction* self, Box* inst, Box* owner) {
return
boxInstanceMethod
(
inst
,
self
);
}
static
Box
*
memberGet
(
BoxedMemberDescriptor
*
self
,
Box
*
inst
,
Box
*
owner
)
{
RELEASE_ASSERT
(
self
->
cls
==
member_cls
,
""
);
Py_FatalError
(
"unimplemented"
);
}
static
Box
*
functionCall
(
BoxedFunction
*
self
,
Box
*
args
,
Box
*
kwargs
)
{
RELEASE_ASSERT
(
self
->
cls
==
function_cls
,
"%s"
,
getTypeName
(
self
)
->
c_str
());
...
...
@@ -755,10 +748,6 @@ void setupRuntime() {
module_cls
->
giveAttr
(
"__str__"
,
module_cls
->
getattr
(
"__repr__"
));
module_cls
->
freeze
();
member_cls
->
giveAttr
(
"__name__"
,
boxStrConstant
(
"member"
));
member_cls
->
giveAttr
(
"__get__"
,
new
BoxedFunction
(
boxRTFunction
((
void
*
)
memberGet
,
UNKNOWN
,
3
)));
member_cls
->
freeze
();
closure_cls
->
giveAttr
(
"__name__"
,
boxStrConstant
(
"closure"
));
closure_cls
->
freeze
();
...
...
@@ -778,6 +767,7 @@ void setupRuntime() {
setupClassobj
();
setupSuper
();
setupUnicode
();
setupDescr
();
function_cls
->
giveAttr
(
"__name__"
,
boxStrConstant
(
"function"
));
function_cls
->
giveAttr
(
"__repr__"
,
new
BoxedFunction
(
boxRTFunction
((
void
*
)
functionRepr
,
STR
,
1
)));
...
...
@@ -881,6 +871,7 @@ void teardownRuntime() {
teardownSet
();
teardownTuple
();
teardownFile
();
teardownDescr
();
/*
// clear all the attributes on the base classes before freeing the classes themselves,
...
...
src/runtime/types.h
View file @
cd73ad20
...
...
@@ -63,6 +63,8 @@ void setupCAPI();
void
teardownCAPI
();
void
setupGenerator
();
void
setupUnicode
();
void
setupDescr
();
void
teardownDescr
();
void
setupSys
();
void
setupBuiltins
();
...
...
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