Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
a218e068
Commit
a218e068
authored
Nov 23, 2011
by
Jacek Caban
Committed by
Alexandre Julliard
Nov 23, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
jscript: Use bytecode for double literal.
parent
e5e7803a
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
35 additions
and
0 deletions
+35
-0
compile.c
dlls/jscript/compile.c
+20
-0
engine.c
dlls/jscript/engine.c
+13
-0
engine.h
dlls/jscript/engine.h
+2
-0
No files found.
dlls/jscript/compile.c
View file @
a218e068
...
...
@@ -112,6 +112,24 @@ static HRESULT push_instr_str(compiler_ctx_t *ctx, jsop_t op, const WCHAR *arg)
return
S_OK
;
}
static
HRESULT
push_instr_double
(
compiler_ctx_t
*
ctx
,
jsop_t
op
,
double
arg
)
{
unsigned
instr
;
DOUBLE
*
dbl
;
dbl
=
compiler_alloc
(
ctx
->
code
,
sizeof
(
arg
));
if
(
!
dbl
)
return
E_OUTOFMEMORY
;
*
dbl
=
arg
;
instr
=
push_instr
(
ctx
,
op
);
if
(
instr
==
-
1
)
return
E_OUTOFMEMORY
;
instr_ptr
(
ctx
,
instr
)
->
arg1
.
dbl
=
dbl
;
return
S_OK
;
}
static
HRESULT
compile_binary_expression
(
compiler_ctx_t
*
ctx
,
binary_expression_t
*
expr
,
jsop_t
op
)
{
HRESULT
hres
;
...
...
@@ -157,6 +175,8 @@ static HRESULT compile_literal(compiler_ctx_t *ctx, literal_expression_t *expr)
switch
(
literal
->
type
)
{
case
LT_BOOL
:
return
push_instr_int
(
ctx
,
OP_bool
,
literal
->
u
.
bval
);
case
LT_DOUBLE
:
return
push_instr_double
(
ctx
,
OP_double
,
literal
->
u
.
dval
);
case
LT_INT
:
return
push_instr_int
(
ctx
,
OP_int
,
literal
->
u
.
lval
);
case
LT_STRING
:
...
...
dlls/jscript/engine.c
View file @
a218e068
...
...
@@ -1747,6 +1747,19 @@ HRESULT interp_int(exec_ctx_t *ctx)
return
stack_push
(
ctx
,
&
v
);
}
/* ECMA-262 3rd Edition 7.8.3 */
HRESULT
interp_double
(
exec_ctx_t
*
ctx
)
{
const
double
arg
=
*
ctx
->
parser
->
code
->
instrs
[
ctx
->
ip
].
arg1
.
dbl
;
VARIANT
v
;
TRACE
(
"%lf
\n
"
,
arg
);
V_VT
(
&
v
)
=
VT_R8
;
V_R8
(
&
v
)
=
arg
;
return
stack_push
(
ctx
,
&
v
);
}
/* ECMA-262 3rd Edition 7.8.4 */
HRESULT
interp_str
(
exec_ctx_t
*
ctx
)
{
...
...
dlls/jscript/engine.h
View file @
a218e068
...
...
@@ -45,6 +45,7 @@ typedef struct _func_stack {
X(add, 1, 0) \
X(bool, 1, 0) \
X(bneg, 1, 0) \
X(double, 1, 0) \
X(eq2, 1, 0) \
X(in, 1, 0) \
X(int, 1, ARG_INT) \
...
...
@@ -64,6 +65,7 @@ OP_LIST
typedef
union
{
expression_t
*
expr
;
double
*
dbl
;
LONG
lng
;
WCHAR
*
str
;
}
instr_arg_t
;
...
...
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