Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mruby
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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
mruby
Commits
950204bc
Commit
950204bc
authored
Aug 29, 2012
by
Yukihiro Matsumoto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove flags from irep
parent
4848c1f0
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
8 additions
and
11 deletions
+8
-11
include/mruby/irep.h
include/mruby/irep.h
+0
-4
src/cdump.c
src/cdump.c
+0
-1
src/codegen.c
src/codegen.c
+0
-1
src/gc.c
src/gc.c
+7
-0
src/proc.c
src/proc.c
+0
-1
src/state.c
src/state.c
+1
-4
No files found.
include/mruby/irep.h
View file @
950204bc
...
@@ -14,7 +14,6 @@ extern "C" {
...
@@ -14,7 +14,6 @@ extern "C" {
typedef
struct
mrb_irep
{
typedef
struct
mrb_irep
{
int
idx
;
int
idx
;
int
flags
;
int
nlocals
;
int
nlocals
;
int
nregs
;
int
nregs
;
...
@@ -25,9 +24,6 @@ typedef struct mrb_irep {
...
@@ -25,9 +24,6 @@ typedef struct mrb_irep {
int
ilen
,
plen
,
slen
;
int
ilen
,
plen
,
slen
;
}
mrb_irep
;
}
mrb_irep
;
#define MRB_IREP_NOFREE 3
#define MRB_ISEQ_NOFREE 1
void
mrb_add_irep
(
mrb_state
*
mrb
,
int
n
);
void
mrb_add_irep
(
mrb_state
*
mrb
,
int
n
);
#if defined(__cplusplus)
#if defined(__cplusplus)
...
...
src/cdump.c
View file @
950204bc
...
@@ -114,7 +114,6 @@ make_cdump_irep(mrb_state *mrb, int irep_no, FILE *f)
...
@@ -114,7 +114,6 @@ make_cdump_irep(mrb_state *mrb, int irep_no, FILE *f)
SOURCE_CODE0
(
" ai = mrb->arena_idx;"
);
SOURCE_CODE0
(
" ai = mrb->arena_idx;"
);
SOURCE_CODE0
(
" irep = mrb->irep[idx] = mrb_malloc(mrb, sizeof(mrb_irep));"
);
SOURCE_CODE0
(
" irep = mrb->irep[idx] = mrb_malloc(mrb, sizeof(mrb_irep));"
);
SOURCE_CODE0
(
" irep->idx = idx++;"
);
SOURCE_CODE0
(
" irep->idx = idx++;"
);
SOURCE_CODE
(
" irep->flags = %d | MRB_ISEQ_NOFREE;"
,
irep
->
flags
);
SOURCE_CODE
(
" irep->nlocals = %d;"
,
irep
->
nlocals
);
SOURCE_CODE
(
" irep->nlocals = %d;"
,
irep
->
nlocals
);
SOURCE_CODE
(
" irep->nregs = %d;"
,
irep
->
nregs
);
SOURCE_CODE
(
" irep->nregs = %d;"
,
irep
->
nregs
);
SOURCE_CODE
(
" irep->ilen = %d;"
,
irep
->
ilen
);
SOURCE_CODE
(
" irep->ilen = %d;"
,
irep
->
ilen
);
...
...
src/codegen.c
View file @
950204bc
...
@@ -2055,7 +2055,6 @@ scope_finish(codegen_scope *s, int idx)
...
@@ -2055,7 +2055,6 @@ scope_finish(codegen_scope *s, int idx)
irep
=
mrb
->
irep
[
idx
]
=
(
mrb_irep
*
)
mrb_malloc
(
mrb
,
sizeof
(
mrb_irep
));
irep
=
mrb
->
irep
[
idx
]
=
(
mrb_irep
*
)
mrb_malloc
(
mrb
,
sizeof
(
mrb_irep
));
irep
->
idx
=
idx
;
irep
->
idx
=
idx
;
irep
->
flags
=
0
;
if
(
s
->
iseq
)
{
if
(
s
->
iseq
)
{
irep
->
iseq
=
(
mrb_code
*
)
codegen_realloc
(
s
,
s
->
iseq
,
sizeof
(
mrb_code
)
*
s
->
pc
);
irep
->
iseq
=
(
mrb_code
*
)
codegen_realloc
(
s
,
s
->
iseq
,
sizeof
(
mrb_code
)
*
s
->
pc
);
irep
->
ilen
=
s
->
pc
;
irep
->
ilen
=
s
->
pc
;
...
...
src/gc.c
View file @
950204bc
...
@@ -284,15 +284,22 @@ mrb_init_heap(mrb_state *mrb)
...
@@ -284,15 +284,22 @@ mrb_init_heap(mrb_state *mrb)
#endif
#endif
}
}
static
void
obj_free
(
mrb_state
*
mrb
,
struct
RBasic
*
obj
);
void
void
mrb_free_heap
(
mrb_state
*
mrb
)
mrb_free_heap
(
mrb_state
*
mrb
)
{
{
struct
heap_page
*
page
=
mrb
->
heaps
;
struct
heap_page
*
page
=
mrb
->
heaps
;
struct
heap_page
*
tmp
;
struct
heap_page
*
tmp
;
RVALUE
*
p
,
*
e
;
while
(
page
)
{
while
(
page
)
{
tmp
=
page
;
tmp
=
page
;
page
=
page
->
next
;
page
=
page
->
next
;
for
(
p
=
tmp
->
objects
,
e
=
p
+
MRB_HEAP_PAGE_SIZE
;
p
<
e
;
p
++
)
{
if
(
p
->
as
.
free
.
tt
!=
MRB_TT_FREE
)
obj_free
(
mrb
,
&
p
->
as
.
basic
);
}
mrb_free
(
mrb
,
tmp
);
mrb_free
(
mrb
,
tmp
);
}
}
}
}
...
...
src/proc.c
View file @
950204bc
...
@@ -152,7 +152,6 @@ mrb_init_proc(mrb_state *mrb)
...
@@ -152,7 +152,6 @@ mrb_init_proc(mrb_state *mrb)
*
call_iseq
=
MKOP_A
(
OP_CALL
,
0
);
*
call_iseq
=
MKOP_A
(
OP_CALL
,
0
);
call_irep
->
idx
=
-
1
;
call_irep
->
idx
=
-
1
;
call_irep
->
flags
=
MRB_IREP_NOFREE
;
call_irep
->
iseq
=
call_iseq
;
call_irep
->
iseq
=
call_iseq
;
call_irep
->
ilen
=
1
;
call_irep
->
ilen
=
1
;
...
...
src/state.c
View file @
950204bc
...
@@ -63,10 +63,7 @@ mrb_close(mrb_state *mrb)
...
@@ -63,10 +63,7 @@ mrb_close(mrb_state *mrb)
mrb_free
(
mrb
,
mrb
->
stbase
);
mrb_free
(
mrb
,
mrb
->
stbase
);
mrb_free
(
mrb
,
mrb
->
cibase
);
mrb_free
(
mrb
,
mrb
->
cibase
);
for
(
i
=
0
;
i
<
mrb
->
irep_len
;
i
++
)
{
for
(
i
=
0
;
i
<
mrb
->
irep_len
;
i
++
)
{
if
(
mrb
->
irep
[
i
]
->
flags
&
MRB_IREP_NOFREE
)
continue
;
if
((
mrb
->
irep
[
i
]
->
flags
&
MRB_ISEQ_NOFREE
)
==
0
)
{
mrb_free
(
mrb
,
mrb
->
irep
[
i
]
->
iseq
);
mrb_free
(
mrb
,
mrb
->
irep
[
i
]
->
iseq
);
}
mrb_free
(
mrb
,
mrb
->
irep
[
i
]
->
pool
);
mrb_free
(
mrb
,
mrb
->
irep
[
i
]
->
pool
);
mrb_free
(
mrb
,
mrb
->
irep
[
i
]
->
syms
);
mrb_free
(
mrb
,
mrb
->
irep
[
i
]
->
syms
);
mrb_free
(
mrb
,
mrb
->
irep
[
i
]);
mrb_free
(
mrb
,
mrb
->
irep
[
i
]);
...
...
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