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
9184d254
Commit
9184d254
authored
May 14, 2014
by
Yukihiro "Matz" Matsumoto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
resize register number in LVAR section from 32bits to 16bits
parent
7a5d8a40
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
11 additions
and
11 deletions
+11
-11
include/mruby/irep.h
include/mruby/irep.h
+1
-1
src/codegen.c
src/codegen.c
+3
-3
src/dump.c
src/dump.c
+4
-4
src/load.c
src/load.c
+3
-3
No files found.
include/mruby/irep.h
View file @
9184d254
...
...
@@ -21,7 +21,7 @@ enum irep_pool_type {
struct
mrb_locals
{
mrb_sym
name
;
size
_t
r
;
uint16
_t
r
;
};
/* Program data array struct */
...
...
src/codegen.c
View file @
9184d254
...
...
@@ -66,8 +66,8 @@ typedef struct scope {
size_t
scapa
;
size_t
rcapa
;
in
t
nlocals
;
in
t
nregs
;
uint16_
t
nlocals
;
uint16_
t
nregs
;
int
ai
;
int
debug_start_pos
;
...
...
@@ -2505,7 +2505,7 @@ scope_new(mrb_state *mrb, codegen_scope *prev, node *lv)
p
->
irep
->
lv
[
i
].
name
=
lv_name
(
n
);
p
->
irep
->
lv
[
i
].
r
=
lv_idx
(
p
,
lv_name
(
n
));
}
mrb_assert
(
i
==
(
p
->
nlocals
-
1
)
);
mrb_assert
(
i
+
1
==
p
->
nlocals
);
}
p
->
ai
=
mrb_gc_arena_save
(
mrb
);
...
...
src/dump.c
View file @
9184d254
...
...
@@ -701,7 +701,7 @@ create_lv_sym_table(mrb_state *mrb, const mrb_irep *irep, mrb_sym **syms, uint32
*
syms
=
(
mrb_sym
*
)
mrb_malloc
(
mrb
,
sizeof
(
mrb_sym
)
*
1
);
}
for
(
i
=
0
;
i
<
(
irep
->
nlocals
-
1
)
;
++
i
)
{
for
(
i
=
0
;
i
+
1
<
irep
->
nlocals
;
++
i
)
{
mrb_sym
const
name
=
irep
->
lv
[
i
].
name
;
if
(
find_filename_index
(
*
syms
,
*
syms_len
,
name
)
!=
-
1
)
continue
;
...
...
@@ -743,12 +743,12 @@ write_lv_record(mrb_state *mrb, const mrb_irep *irep, uint8_t **start, mrb_sym c
uint8_t
*
cur
=
*
start
;
size_t
i
;
for
(
i
=
0
;
i
<
(
irep
->
nlocals
-
1
)
;
++
i
)
{
for
(
i
=
0
;
i
+
1
<
irep
->
nlocals
;
++
i
)
{
int
const
sym_idx
=
find_filename_index
(
syms
,
syms_len
,
irep
->
lv
[
i
].
name
);
mrb_assert
(
sym_idx
!=
-
1
);
/* local variable name must be in syms */
cur
+=
uint16_to_bin
(
sym_idx
,
cur
);
cur
+=
uint
32
_to_bin
(
irep
->
lv
[
i
].
r
,
cur
);
cur
+=
uint
16
_to_bin
(
irep
->
lv
[
i
].
r
,
cur
);
}
for
(
i
=
0
;
i
<
irep
->
rlen
;
++
i
)
{
...
...
@@ -765,7 +765,7 @@ get_lv_record_size(mrb_state *mrb, mrb_irep *irep)
{
size_t
ret
=
0
,
i
;
ret
+=
(
sizeof
(
uint16_t
)
+
sizeof
(
uint
32
_t
))
*
(
irep
->
nlocals
-
1
);
ret
+=
(
sizeof
(
uint16_t
)
+
sizeof
(
uint
16
_t
))
*
(
irep
->
nlocals
-
1
);
for
(
i
=
0
;
i
<
irep
->
rlen
;
++
i
)
{
ret
+=
get_lv_record_size
(
mrb
,
irep
->
reps
[
i
]);
...
...
src/load.c
View file @
9184d254
...
...
@@ -408,7 +408,7 @@ read_lv_record(mrb_state *mrb, const uint8_t *start, mrb_irep *irep, size_t *rec
irep
->
lv
=
(
struct
mrb_locals
*
)
mrb_malloc
(
mrb
,
sizeof
(
struct
mrb_locals
)
*
(
irep
->
nlocals
-
1
));
for
(
i
=
0
;
i
<
(
irep
->
nlocals
-
1
)
;
++
i
)
{
for
(
i
=
0
;
i
+
1
<
irep
->
nlocals
;
++
i
)
{
uint16_t
const
sym_idx
=
bin_to_uint16
(
bin
);
bin
+=
sizeof
(
uint16_t
);
if
(
sym_idx
>=
syms_len
)
{
...
...
@@ -416,8 +416,8 @@ read_lv_record(mrb_state *mrb, const uint8_t *start, mrb_irep *irep, size_t *rec
}
irep
->
lv
[
i
].
name
=
syms
[
sym_idx
];
irep
->
lv
[
i
].
r
=
bin_to_uint
32
(
bin
);
bin
+=
sizeof
(
uint
32
_t
);
irep
->
lv
[
i
].
r
=
bin_to_uint
16
(
bin
);
bin
+=
sizeof
(
uint
16
_t
);
}
for
(
i
=
0
;
i
<
irep
->
rlen
;
++
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