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
f7afe1d8
Commit
f7afe1d8
authored
Jan 07, 2016
by
Yukihiro "Matz" Matsumoto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
change mrb_run related API names; compatibility macros provided
parent
725b3ca5
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
13 additions
and
17 deletions
+13
-17
include/mruby.h
include/mruby.h
+6
-2
include/mruby/compile.h
include/mruby/compile.h
+0
-2
mrbgems/mruby-bin-mirb/tools/mirb/mirb.c
mrbgems/mruby-bin-mirb/tools/mirb/mirb.c
+1
-1
mrbgems/mruby-compiler/core/parse.y
mrbgems/mruby-compiler/core/parse.y
+1
-1
src/vm.c
src/vm.c
+5
-11
No files found.
include/mruby.h
View file @
f7afe1d8
...
...
@@ -933,9 +933,13 @@ MRB_API void* mrb_default_allocf(mrb_state*, void*, size_t, void*);
MRB_API
mrb_value
mrb_top_self
(
mrb_state
*
);
MRB_API
mrb_value
mrb_run
(
mrb_state
*
,
struct
RProc
*
,
mrb_value
);
MRB_API
mrb_value
mrb_top
level_run
(
mrb_state
*
,
struct
RProc
*
);
MRB_API
mrb_value
mrb_
context
_run
(
mrb_state
*
,
struct
RProc
*
,
mrb_value
,
unsigned
int
);
MRB_API
mrb_value
mrb_top
_run
(
mrb_state
*
,
struct
RProc
*
,
mrb_value
,
unsigned
int
);
MRB_API
mrb_value
mrb_
vm
_run
(
mrb_state
*
,
struct
RProc
*
,
mrb_value
,
unsigned
int
);
MRB_API
mrb_value
mrb_vm_exec
(
mrb_state
*
,
struct
RProc
*
,
mrb_code
*
);
/* compatibility macros */
#define mrb_toplevel_run_keep(m,p,k) mrb_top_run((m),(p),mrb_top_self(m),(k))
#define mrb_toplevel_run(m,p) mrb_toplevel_run_keep((m),(p),0)
#define mrb_context_run(m,p,s,k) mrb_vm_run((m),(p),(s),(k))
MRB_API
void
mrb_p
(
mrb_state
*
,
mrb_value
);
MRB_API
mrb_int
mrb_obj_id
(
mrb_value
obj
);
...
...
include/mruby/compile.h
View file @
f7afe1d8
...
...
@@ -40,8 +40,6 @@ MRB_API void mrbc_context_free(mrb_state *mrb, mrbc_context *cxt);
MRB_API
const
char
*
mrbc_filename
(
mrb_state
*
mrb
,
mrbc_context
*
c
,
const
char
*
s
);
MRB_API
void
mrbc_partial_hook
(
mrb_state
*
mrb
,
mrbc_context
*
c
,
int
(
*
partial_hook
)(
struct
mrb_parser_state
*
),
void
*
data
);
MRB_API
mrb_value
mrb_toplevel_run_keep
(
mrb_state
*
,
struct
RProc
*
,
unsigned
int
);
/* AST node structure */
typedef
struct
mrb_ast_node
{
struct
mrb_ast_node
*
car
,
*
cdr
;
...
...
mrbgems/mruby-bin-mirb/tools/mirb/mirb.c
View file @
f7afe1d8
...
...
@@ -546,7 +546,7 @@ done:
}
/* pass a proc for evaulation */
/* evaluate the bytecode */
result
=
mrb_
context
_run
(
mrb
,
result
=
mrb_
vm
_run
(
mrb
,
proc
,
mrb_top_self
(
mrb
),
stack_keep
);
...
...
mrbgems/mruby-compiler/core/parse.y
View file @
f7afe1d8
...
...
@@ -5634,7 +5634,7 @@ load_exec(mrb_state *mrb, parser_state *p, mrbc_context *c)
if (mrb->c->ci) {
mrb->c->ci->target_class = target;
}
v = mrb_top
level_run_keep(mrb, proc
, keep);
v = mrb_top
_run(mrb, proc, mrb_top_self(mrb)
, keep);
if (mrb->exc) return mrb_nil_value();
return v;
}
...
...
src/vm.c
View file @
f7afe1d8
...
...
@@ -746,7 +746,7 @@ argnum_error(mrb_state *mrb, mrb_int num)
void
mrb_method_missing
(
mrb_state
*
mrb
,
mrb_sym
name
,
mrb_value
self
,
mrb_value
args
);
MRB_API
mrb_value
mrb_
context
_run
(
mrb_state
*
mrb
,
struct
RProc
*
proc
,
mrb_value
self
,
unsigned
int
stack_keep
)
mrb_
vm
_run
(
mrb_state
*
mrb
,
struct
RProc
*
proc
,
mrb_value
self
,
unsigned
int
stack_keep
)
{
mrb_irep
*
irep
=
proc
->
body
.
irep
;
...
...
@@ -2434,30 +2434,24 @@ RETRY_TRY_BLOCK:
MRB_API
mrb_value
mrb_run
(
mrb_state
*
mrb
,
struct
RProc
*
proc
,
mrb_value
self
)
{
return
mrb_
context
_run
(
mrb
,
proc
,
self
,
mrb
->
c
->
ci
->
argc
+
2
);
/* argc + 2 (receiver and block) */
return
mrb_
vm
_run
(
mrb
,
proc
,
self
,
mrb
->
c
->
ci
->
argc
+
2
);
/* argc + 2 (receiver and block) */
}
MRB_API
mrb_value
mrb_top
level_run_keep
(
mrb_state
*
mrb
,
struct
RProc
*
proc
,
unsigned
int
stack_keep
)
mrb_top
_run
(
mrb_state
*
mrb
,
struct
RProc
*
proc
,
mrb_value
self
,
unsigned
int
stack_keep
)
{
mrb_callinfo
*
ci
;
mrb_value
v
;
if
(
!
mrb
->
c
->
cibase
||
mrb
->
c
->
ci
==
mrb
->
c
->
cibase
)
{
return
mrb_
context_run
(
mrb
,
proc
,
mrb_top_self
(
mrb
)
,
stack_keep
);
return
mrb_
vm_run
(
mrb
,
proc
,
self
,
stack_keep
);
}
ci
=
cipush
(
mrb
);
ci
->
nregs
=
1
;
/* protect the receiver */
ci
->
acc
=
CI_ACC_SKIP
;
ci
->
target_class
=
mrb
->
object_class
;
v
=
mrb_
context_run
(
mrb
,
proc
,
mrb_top_self
(
mrb
)
,
stack_keep
);
v
=
mrb_
vm_run
(
mrb
,
proc
,
self
,
stack_keep
);
cipop
(
mrb
);
return
v
;
}
MRB_API
mrb_value
mrb_toplevel_run
(
mrb_state
*
mrb
,
struct
RProc
*
proc
)
{
return
mrb_toplevel_run_keep
(
mrb
,
proc
,
0
);
}
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