コミットメタ情報

リビジョン7abbd91ae4698048e05996a7bcc3045cdf651fcd (tree)
日時2014-03-17 17:29:22
作者hikarupsp <hikarupsp@user...>
コミッターhikarupsp

ログメッセージ

yaoさんの指摘によるコメント修正。

変更サマリ

差分

--- a/jitc.c
+++ b/jitc.c
@@ -1,82 +1,82 @@
1-#include "osecpu.h"
2-#include "jitc.h"
3-
4-//
5-// JITC common functions (architecture not dependent)
6-//
7-
8-void errorHandler(HOSECPU_RuntimeEnvironment *r)
9-{
10- puts("security error! abort...");
11- printf("debugInfo0=%d, debugInfo1=%d\n", r->debugInfo0, r->debugInfo1);
12-#if (USE_DEBUGGER != 0)
13- dbgrMain(r);
14-#endif
15- exit(1);
16-}
17-
18-int jitCompCmdLen(const unsigned char *src)
19-{
20- //BCode命令長を取得する
21- int i = 1;
22-
23- if (0x01 <= *src && *src < 0x04){
24- // LB, LIMM, PLIMM
25- i = 6;
26- } else if (*src == 0x04){
27- // CND
28- i = 2;
29- } else if (0x08 <= *src && *src < 0x0d){
30- // LMEM, SMEM, ??, ??, ??
31- i = 8 + src[7] * 4;
32- } else if (0x0e <= *src && *src < 0x10){
33- // PADD, PDIF
34- i = 8;
35- } else if (0x10 <= *src && *src < 0x1c){
36- // CP/OR, XOR, AND, ADD, SUB, MUL, SHL, SAR, DIV, MOD,
37- i = 4;
38- } else if (0x1c <= *src && *src < 0x1f){
39- // ??, ??, PCP
40- i = 3;
41- } else if (*src == 0x1f){
42- // ??
43- i = 11;
44- } else if(0x20 <= *src && *src < 0x2e){
45- // CMPE, CMPNE, CMPL, CMPGE, CMPLE, CMPG, TSTZ, TSTNZ,
46- // PCMPE, PCMPNE, PCMPL, PCMPGE, PCMPLE, PCMPG,
47- i = 4;
48- } else if (*src == 0x2f){
49- // ??
50- i = 4 + src[1];
51- } else if (0x30 <= *src && *src < 0x34){
52- // ??, ??, MALLOC, ??
53- i = 4;
54- } else if (0x3c <= *src && *src < 0x3e){
55- // ??, ??
56- i = 7;
57- } else if (*src == 0xfe){
58- // REMARK
59- i = 2 + src[1];
60- }
61-
62- return i;
63-}
64-
65-void PRegCopy(HOSECPU_PointerRegisterEntry *dst, HOSECPU_PointerRegisterEntry *src)
66-{
67- // なんか直接代入するとMacではアライメントエラーで落ちるのです...
68- // dst = src;
69-
70- dst->p = src->p;
71- dst->typ = src->typ;
72- dst->p0 = src->p0;
73- dst->p1 = src->p1;
74- dst->liveSign = src->liveSign;
75- dst->pls = src->pls;
76- dst->flags = src->flags;
77- dst->dummy = src->dummy;
78-}
79-
80-
81-
82-
1+#include "osecpu.h"
2+#include "jitc.h"
3+
4+//
5+// JITC common functions (architecture not dependent)
6+//
7+
8+void errorHandler(HOSECPU_RuntimeEnvironment *r)
9+{
10+ puts("security error! abort...");
11+ printf("debugInfo0=%d, debugInfo1=%d\n", r->debugInfo0, r->debugInfo1);
12+#if (USE_DEBUGGER != 0)
13+ dbgrMain(r);
14+#endif
15+ exit(1);
16+}
17+
18+int jitCompCmdLen(const unsigned char *src)
19+{
20+ //BCode命令長を取得する
21+ int i = 1;
22+
23+ if (0x01 <= *src && *src < 0x04){
24+ // LB, LIMM, PLIMM
25+ i = 6;
26+ } else if (*src == 0x04){
27+ // CND
28+ i = 2;
29+ } else if (0x08 <= *src && *src < 0x0d){
30+ // LMEM, SMEM, ??, ??, ??
31+ i = 8 + src[7] * 4;
32+ } else if (0x0e <= *src && *src < 0x10){
33+ // PADD, PDIF
34+ i = 8;
35+ } else if (0x10 <= *src && *src < 0x1c){
36+ // CP/OR, XOR, AND, ADD, SUB, MUL, SHL, SAR, DIV, MOD,
37+ i = 4;
38+ } else if (0x1c <= *src && *src < 0x1f){
39+ // ??, ??, PCP
40+ i = 3;
41+ } else if (*src == 0x1f){
42+ // ??
43+ i = 11;
44+ } else if(0x20 <= *src && *src < 0x2e){
45+ // CMPE, CMPNE, CMPL, CMPGE, CMPLE, CMPG, TSTZ, TSTNZ,
46+ // PCMPE, PCMPNE, PCMPL, PCMPGE, PCMPLE, PCMPG,
47+ i = 4;
48+ } else if (*src == 0x2f){
49+ // ??
50+ i = 4 + src[1];
51+ } else if (0x30 <= *src && *src < 0x34){
52+ // ??, ??, MALLOC, ??
53+ i = 4;
54+ } else if (0x3c <= *src && *src < 0x3e){
55+ // ??, ??
56+ i = 7;
57+ } else if (*src == 0xfe){
58+ // REMARK
59+ i = 2 + src[1];
60+ }
61+
62+ return i;
63+}
64+
65+void PRegCopy(HOSECPU_PointerRegisterEntry *dst, HOSECPU_PointerRegisterEntry *src)
66+{
67+ // なんか直接代入するとMacではアライメントエラーで落ちるのです...
68+ // *dst = *src;
69+
70+ dst->p = src->p;
71+ dst->typ = src->typ;
72+ dst->p0 = src->p0;
73+ dst->p1 = src->p1;
74+ dst->liveSign = src->liveSign;
75+ dst->pls = src->pls;
76+ dst->flags = src->flags;
77+ dst->dummy = src->dummy;
78+}
79+
80+
81+
82+
旧リポジトリブラウザで表示