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
7872bee7
Commit
7872bee7
authored
Mar 17, 2013
by
Yukihiro "Matz" Matsumoto
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1024 from crimsonwoods/remove_bitshifted_constants_larger_than_16bit
remove bit-shift operation.
parents
526f4bf6
83ddef68
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
5 additions
and
5 deletions
+5
-5
src/codegen.c
src/codegen.c
+2
-2
src/crc.c
src/crc.c
+1
-1
src/opcode.h
src/opcode.h
+1
-1
src/vm.c
src/vm.c
+1
-1
No files found.
src/codegen.c
View file @
7872bee7
...
...
@@ -541,11 +541,11 @@ for_body(codegen_scope *s, node *tree)
// generate loop variable
n2
=
tree
->
car
;
if
(
n2
->
car
&&
!
n2
->
car
->
cdr
&&
!
n2
->
cdr
)
{
genop
(
s
,
MKOP_Ax
(
OP_ENTER
,
1
<<
18
));
genop
(
s
,
MKOP_Ax
(
OP_ENTER
,
0x40000
));
gen_assignment
(
s
,
n2
->
car
->
car
,
1
,
NOVAL
);
}
else
{
genop
(
s
,
MKOP_Ax
(
OP_ENTER
,
1
<<
18
));
genop
(
s
,
MKOP_Ax
(
OP_ENTER
,
0x40000
));
gen_vmassignment
(
s
,
n2
,
1
,
VAL
);
}
codegen
(
s
,
tree
->
cdr
->
cdr
->
car
,
VAL
);
...
...
src/crc.c
View file @
7872bee7
...
...
@@ -13,7 +13,7 @@
// carry
#define CRC_16_CCITT 0x11021ul //x^16+x^12+x^5+1
#define CRC_XOR_PATTERN (CRC_16_CCITT << 8)
#define CRC_CARRY_BIT (
1 << 24
)
#define CRC_CARRY_BIT (
0x01000000
)
uint16_t
calc_crc_16_ccitt
(
unsigned
char
*
src
,
int
nbytes
)
...
...
src/opcode.h
View file @
7872bee7
...
...
@@ -7,7 +7,7 @@
#ifndef OPCODE_H
#define OPCODE_H
#define MAXARG_Bx (
(1<<16)-1
)
#define MAXARG_Bx (
0xffff
)
#define MAXARG_sBx (MAXARG_Bx>>1)
/* `sBx' is signed */
/* instructions OP:A:B:C = 7:9:9:7 (32 bits) */
...
...
src/vm.c
View file @
7872bee7
...
...
@@ -45,7 +45,7 @@
/* Maximum stack depth. Should be set lower on memory constrained systems.
The value below allows about 60000 recursive calls in the simplest case. */
#ifndef MRB_STACK_MAX
#define MRB_STACK_MAX (
(1<<18)
- MRB_STACK_GROWTH)
#define MRB_STACK_MAX (
0x40000
- MRB_STACK_GROWTH)
#endif
#ifdef VM_DEBUG
...
...
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