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
a511957e
Commit
a511957e
authored
Nov 03, 2013
by
fleuria
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactor mrb_context_run()
parent
d75a907e
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
9 additions
and
15 deletions
+9
-15
include/mruby.h
include/mruby.h
+1
-1
mrbgems/mruby-bin-mirb/tools/mirb/mirb.c
mrbgems/mruby-bin-mirb/tools/mirb/mirb.c
+1
-1
mrbgems/mruby-bin-mruby/tools/mruby/mruby.c
mrbgems/mruby-bin-mruby/tools/mruby/mruby.c
+1
-1
src/load.c
src/load.c
+2
-2
src/parse.y
src/parse.y
+1
-1
src/vm.c
src/vm.c
+3
-9
No files found.
include/mruby.h
View file @
a511957e
...
...
@@ -261,7 +261,7 @@ void mrb_close(mrb_state*);
mrb_value
mrb_top_self
(
mrb_state
*
);
mrb_value
mrb_run
(
mrb_state
*
,
struct
RProc
*
,
mrb_value
);
mrb_value
mrb_context_run
(
mrb_state
*
,
struct
RProc
*
,
mrb_value
);
mrb_value
mrb_context_run
(
mrb_state
*
,
struct
RProc
*
,
mrb_value
,
unsigned
int
);
void
mrb_p
(
mrb_state
*
,
mrb_value
);
mrb_int
mrb_obj_id
(
mrb_value
obj
);
...
...
mrbgems/mruby-bin-mirb/tools/mirb/mirb.c
View file @
a511957e
...
...
@@ -367,7 +367,7 @@ main(int argc, char **argv)
result
=
mrb_context_run
(
mrb
,
/* pass a proc for evaulation */
mrb_proc_new
(
mrb
,
mrb
->
irep
[
n
]),
mrb_top_self
(
mrb
));
mrb_top_self
(
mrb
)
,
0
);
/* did an exception occur? */
if
(
mrb
->
exc
)
{
p
(
mrb
,
mrb_obj_value
(
mrb
->
exc
),
0
);
...
...
mrbgems/mruby-bin-mruby/tools/mruby/mruby.c
View file @
a511957e
...
...
@@ -203,7 +203,7 @@ main(int argc, char **argv)
fprintf
(
stderr
,
"failed to load mrb file: %s
\n
"
,
args
.
cmdline
);
}
else
if
(
!
args
.
check_syntax
)
{
mrb_context_run
(
mrb
,
mrb_proc_new
(
mrb
,
mrb
->
irep
[
n
]),
mrb_top_self
(
mrb
));
mrb_context_run
(
mrb
,
mrb_proc_new
(
mrb
,
mrb
->
irep
[
n
]),
mrb_top_self
(
mrb
)
,
0
);
n
=
0
;
if
(
mrb
->
exc
)
{
mrb_print_error
(
mrb
);
...
...
src/load.c
View file @
a511957e
...
...
@@ -510,7 +510,7 @@ mrb_load_irep(mrb_state *mrb, const uint8_t *bin)
irep_error
(
mrb
,
n
);
return
mrb_nil_value
();
}
return
mrb_context_run
(
mrb
,
mrb_proc_new
(
mrb
,
mrb
->
irep
[
n
]),
mrb_top_self
(
mrb
));
return
mrb_context_run
(
mrb
,
mrb_proc_new
(
mrb
,
mrb
->
irep
[
n
]),
mrb_top_self
(
mrb
)
,
0
);
}
#ifdef ENABLE_STDIO
...
...
@@ -760,6 +760,6 @@ mrb_load_irep_file(mrb_state *mrb, FILE* fp)
irep_error
(
mrb
,
n
);
return
mrb_nil_value
();
}
return
mrb_context_run
(
mrb
,
mrb_proc_new
(
mrb
,
mrb
->
irep
[
n
]),
mrb_top_self
(
mrb
));
return
mrb_context_run
(
mrb
,
mrb_proc_new
(
mrb
,
mrb
->
irep
[
n
]),
mrb_top_self
(
mrb
)
,
0
);
}
#endif
/* ENABLE_STDIO */
src/parse.y
View file @
a511957e
...
...
@@ -5388,7 +5388,7 @@ load_exec(mrb_state *mrb, parser_state *p, mrbc_context *c)
if (mrb->c->ci) {
mrb->c->ci->target_class = target;
}
v = mrb_
run(mrb, proc, mrb_top_self(mrb)
);
v = mrb_
context_run(mrb, proc, mrb_top_self(mrb), 0
);
if (mrb->exc) return mrb_nil_value();
return v;
}
...
...
src/vm.c
View file @
a511957e
...
...
@@ -546,8 +546,8 @@ void mrb_gv_val_set(mrb_state *mrb, mrb_sym sym, mrb_value val);
#define CALL_MAXARGS 127
static
mrb_value
run_proc
(
mrb_state
*
mrb
,
struct
RProc
*
proc
,
mrb_value
self
,
unsigned
int
stack_keep
)
mrb_value
mrb_context_run
(
mrb_state
*
mrb
,
struct
RProc
*
proc
,
mrb_value
self
,
unsigned
int
stack_keep
)
{
/* mrb_assert(mrb_proc_cfunc_p(proc)) */
mrb_irep
*
irep
=
proc
->
body
.
irep
;
...
...
@@ -2148,13 +2148,7 @@ run_proc(mrb_state *mrb, struct RProc *proc, mrb_value self, unsigned int stack_
mrb_value
mrb_run
(
mrb_state
*
mrb
,
struct
RProc
*
proc
,
mrb_value
self
)
{
return
run_proc
(
mrb
,
proc
,
self
,
mrb
->
c
->
ci
->
argc
+
2
);
/* argc + 2 (receiver and block) */
}
mrb_value
mrb_context_run
(
mrb_state
*
mrb
,
struct
RProc
*
proc
,
mrb_value
self
)
{
return
run_proc
(
mrb
,
proc
,
self
,
proc
->
body
.
irep
->
nregs
);
return
mrb_context_run
(
mrb
,
proc
,
self
,
mrb
->
c
->
ci
->
argc
+
2
);
/* argc + 2 (receiver and block) */
}
void
...
...
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