~ubuntu-branches/ubuntu/trusty/ruby1.9/trusty

« back to all changes in this revision

Viewing changes to vm.h

  • Committer: Bazaar Package Importer
  • Author(s): Stephan Hermann
  • Date: 2008-01-24 11:42:29 UTC
  • mfrom: (1.1.9 upstream)
  • Revision ID: james.westby@ubuntu.com-20080124114229-jw2f87rdxlq6gp11
Tags: 1.9.0.0-2ubuntu1
* Merge from debian unstable, remaining changes:
  - Robustify check for target_os, fixing build failure on lpia.

Show diffs side-by-side

added added

removed removed

Lines of Context:
3
3
  vm.h -
4
4
 
5
5
  $Author: ko1 $
6
 
  $Date: 2007-08-13 04:09:15 +0900 (月, 13  8月 2007) $
 
6
  $Date: 2007-12-24 04:03:23 +0900 (Mon, 24 Dec 2007) $
7
7
  created at: 04/01/01 16:56:59 JST
8
8
 
9
 
  Copyright (C) 2004-2006 Koichi Sasada
 
9
  Copyright (C) 2004-2007 Koichi Sasada
10
10
 
11
11
**********************************************************************/
12
12
 
118
118
#define ELABEL(x) INSN_ELABEL_##x
119
119
#define LABEL_PTR(x) &&LABEL(x)
120
120
 
121
 
#define INSN_ENTRY_SIG(insn) \
122
 
  asm volatile (  "; #**************************************************\n" \
123
 
                "\t; #[start] " # insn "\n") \
124
 
 
125
 
 
126
 
#define INSN_DISPATCH_SIG(insn) \
127
 
  asm volatile (  "; #[end  ] " # insn "\n"\
128
 
                "\t; #==================================================\n") \
 
121
#define INSN_ENTRY_SIG(insn)
 
122
 
 
123
 
 
124
#define INSN_DISPATCH_SIG(insn)
129
125
 
130
126
#define INSN_ENTRY(insn) \
131
127
  LABEL(insn): \
214
210
  ((rb_control_frame_t *)(th->stack + th->stack_size) - (rb_control_frame_t *)(cfp))
215
211
#define VM_SP_CNT(th, sp) ((sp) - (th)->stack)
216
212
 
217
 
#define CHECK_STACK_OVERFLOW(cfp, margin) do \
218
 
  if (((VALUE *)(cfp)->sp) + (margin) >= ((VALUE *)cfp)) { \
219
 
      rb_exc_raise(sysstack_error); \
220
 
  } \
221
 
while (0)
222
 
 
223
213
/*
224
214
  env{
225
215
    env[0] // special (block or prev env)
242
232
#define FRAME_MAGIC_IFUNC  0x81
243
233
#define FRAME_MAGIC_EVAL   0x91
244
234
#define FRAME_MAGIC_LAMBDA 0xa1
245
 
#define FRAME_MAGIC_MASK   0xff
 
235
#define FRAME_MAGIC_MASK_BITS   8
 
236
#define FRAME_MAGIC_MASK   (~(~0<<FRAME_MAGIC_MASK_BITS))
246
237
 
247
238
#define VM_FRAME_FLAG(type) ((VALUE)((type) & FRAME_MAGIC_MASK))
248
239
 
252
243
#define RUBYVM_CFUNC_FRAME_P(cfp) \
253
244
  (VM_FRAME_TYPE(cfp) == FRAME_MAGIC_CFUNC)
254
245
 
255
 
/*
256
 
 * Excception
257
 
 */
258
 
 
259
 
#define NEW_THROW_OBJECT(val, pt, st) NEW_NODE(NODE_LIT, (val), (pt), (st))
260
 
#define GET_THROWOBJ_VAL(obj)         ((VALUE)RNODE((obj))->u1.value)
261
 
#define GET_THROWOBJ_CATCH_POINT(obj) ((VALUE*)RNODE((obj))->u2.value)
262
 
#define GET_THROWOBJ_STATE(obj)       ((int)RNODE((obj))->u3.value)
263
 
 
264
 
#define SET_THROWOBJ_CATCH_POINT(obj, val) \
265
 
  (RNODE((obj))->u2.value = (val))
266
 
#define SET_THROWOBJ_STATE(obj, val) \
267
 
  (RNODE((obj))->u3.value = (val))
268
 
 
269
246
#if OPT_CALL_THREADED_CODE
270
247
#define THROW_EXCEPTION(exc) do { \
271
248
    th->errinfo = (VALUE)(exc); \
298
275
#define BOP_SUCC   0x1000
299
276
#define BOP_GT     0x2000
300
277
#define BOP_GE     0x4000
 
278
#define BOP_NOT    0x8000
 
279
#define BOP_NEQ   0x10000
301
280
 
302
281
#endif /* RUBY_VM_H */