source: EcnlProtoTool/trunk/mruby-1.2.0/include/mruby/irep.h@ 321

Last change on this file since 321 was 321, checked in by coas-nagasima, 7 years ago

文字コードを設定

  • Property svn:eol-style set to native
  • Property svn:mime-type set to text/x-chdr;charset=UTF-8
File size: 1.2 KB
Line 
1/*
2** mruby/irep.h - mrb_irep structure
3**
4** See Copyright Notice in mruby.h
5*/
6
7#ifndef MRUBY_IREP_H
8#define MRUBY_IREP_H
9
10#include "mruby/common.h"
11#include "mruby/compile.h"
12
13/**
14 * Compiled mruby scripts.
15 */
16MRB_BEGIN_DECL
17
18enum irep_pool_type {
19 IREP_TT_STRING,
20 IREP_TT_FIXNUM,
21 IREP_TT_FLOAT,
22};
23
24struct mrb_locals {
25 mrb_sym name;
26 uint16_t r;
27};
28
29/* Program data array struct */
30typedef struct mrb_irep {
31 uint16_t nlocals; /* Number of local variables */
32 uint16_t nregs; /* Number of register variables */
33 uint8_t flags;
34
35 mrb_code *iseq;
36 mrb_value *pool;
37 mrb_sym *syms;
38 struct mrb_irep **reps;
39
40 struct mrb_locals *lv;
41 /* debug info */
42 const char *filename;
43 uint16_t *lines;
44 struct mrb_irep_debug_info* debug_info;
45
46 size_t ilen, plen, slen, rlen, refcnt;
47} mrb_irep;
48
49#define MRB_ISEQ_NO_FREE 1
50
51MRB_API mrb_irep *mrb_add_irep(mrb_state *mrb);
52MRB_API mrb_value mrb_load_irep(mrb_state*, const uint8_t*);
53MRB_API mrb_value mrb_load_irep_cxt(mrb_state*, const uint8_t*, mrbc_context*);
54void mrb_irep_free(mrb_state*, struct mrb_irep*);
55void mrb_irep_incref(mrb_state*, struct mrb_irep*);
56void mrb_irep_decref(mrb_state*, struct mrb_irep*);
57
58MRB_END_DECL
59
60#endif /* MRUBY_IREP_H */
Note: See TracBrowser for help on using the repository browser.