1 |
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- |
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- |
2 |
* vim: set ts=8 sw=4 et tw=79: |
* vim: set ts=8 sw=4 et tw=79: |
3 |
* |
* |
4 |
* ***** BEGIN LICENSE BLOCK ***** |
* ***** BEGIN LICENSE BLOCK ***** |
43 |
/* |
/* |
44 |
* JS bytecode generation. |
* JS bytecode generation. |
45 |
*/ |
*/ |
|
|
|
|
#include "jsstddef.h" |
|
46 |
#include "jstypes.h" |
#include "jstypes.h" |
47 |
#include "jsatom.h" |
#include "jsatom.h" |
48 |
#include "jsopcode.h" |
#include "jsopcode.h" |
428 |
#define CG_LIMIT(cg) ((cg)->current->limit) |
#define CG_LIMIT(cg) ((cg)->current->limit) |
429 |
#define CG_NEXT(cg) ((cg)->current->next) |
#define CG_NEXT(cg) ((cg)->current->next) |
430 |
#define CG_CODE(cg,offset) (CG_BASE(cg) + (offset)) |
#define CG_CODE(cg,offset) (CG_BASE(cg) + (offset)) |
431 |
#define CG_OFFSET(cg) PTRDIFF(CG_NEXT(cg), CG_BASE(cg), jsbytecode) |
#define CG_OFFSET(cg) (CG_NEXT(cg) - CG_BASE(cg)) |
432 |
|
|
433 |
#define CG_NOTES(cg) ((cg)->current->notes) |
#define CG_NOTES(cg) ((cg)->current->notes) |
434 |
#define CG_NOTE_COUNT(cg) ((cg)->current->noteCount) |
#define CG_NOTE_COUNT(cg) ((cg)->current->noteCount) |
440 |
#define CG_PROLOG_LIMIT(cg) ((cg)->prolog.limit) |
#define CG_PROLOG_LIMIT(cg) ((cg)->prolog.limit) |
441 |
#define CG_PROLOG_NEXT(cg) ((cg)->prolog.next) |
#define CG_PROLOG_NEXT(cg) ((cg)->prolog.next) |
442 |
#define CG_PROLOG_CODE(cg,poff) (CG_PROLOG_BASE(cg) + (poff)) |
#define CG_PROLOG_CODE(cg,poff) (CG_PROLOG_BASE(cg) + (poff)) |
443 |
#define CG_PROLOG_OFFSET(cg) PTRDIFF(CG_PROLOG_NEXT(cg), CG_PROLOG_BASE(cg),\ |
#define CG_PROLOG_OFFSET(cg) (CG_PROLOG_NEXT(cg) - CG_PROLOG_BASE(cg)) |
|
jsbytecode) |
|
444 |
|
|
445 |
#define CG_SWITCH_TO_MAIN(cg) ((cg)->current = &(cg)->main) |
#define CG_SWITCH_TO_MAIN(cg) ((cg)->current = &(cg)->main) |
446 |
#define CG_SWITCH_TO_PROLOG(cg) ((cg)->current = &(cg)->prolog) |
#define CG_SWITCH_TO_PROLOG(cg) ((cg)->current = &(cg)->prolog) |