This commit is contained in:
rogerl%netscape.com 2003-05-19 21:06:38 +00:00
parent 9d5719c93f
commit f33e4a593a
6 changed files with 29 additions and 47 deletions

View File

@ -223,6 +223,14 @@ js2val print(JS2Metadata * /* meta */, const js2val /* thisValue */, js2val argv
return JS2VAL_UNDEFINED;
}
#ifdef TRACE_DEBUG
js2val trace(JS2Metadata *meta, const js2val /* thisValue */, js2val /* argv */ [], uint32 /* argc */)
{
meta->engine->traceInstructions = !meta->engine->traceInstructions;
return JS2VAL_UNDEFINED;
}
#endif
#ifdef DEBUG
js2val trees(JS2Metadata *meta, const js2val /* thisValue */, js2val /* argv */ [], uint32 /* argc */)
{
@ -230,12 +238,6 @@ js2val trees(JS2Metadata *meta, const js2val /* thisValue */, js2val /* argv */
return JS2VAL_UNDEFINED;
}
js2val trace(JS2Metadata *meta, const js2val /* thisValue */, js2val /* argv */ [], uint32 /* argc */)
{
meta->engine->traceInstructions = !meta->engine->traceInstructions;
return JS2VAL_UNDEFINED;
}
void accessAccess(AccessSet access)
{
if (access & ReadAccess)
@ -487,10 +489,11 @@ int main(int argc, char **argv)
metadata->addGlobalObjectFunction("dump", dump, 1);
metadata->addGlobalObjectFunction("dumpAt", dumpAt, 1);
metadata->addGlobalObjectFunction("trees", trees, 0);
metadata->addGlobalObjectFunction("trace", trace, 0);
metadata->addGlobalObjectFunction("gc", forceGC, 0);
#endif
#ifdef TRACE_DEBUG
metadata->addGlobalObjectFunction("trace", trace, 0);
#endif
try {
bool doInteractive = true;
int result = 0;

View File

@ -107,7 +107,7 @@ namespace MetaData {
try {
a = JS2VAL_VOID;
b = JS2VAL_VOID;
#ifdef DEBUG
#ifdef TRACE_DEBUG
if (traceInstructions)
printInstruction(pc, bCon->getCodeStart(), bCon, this);
#endif
@ -493,7 +493,7 @@ namespace MetaData {
delete [] activationStack;
}
#ifdef DEBUG
#ifdef TRACE_DEBUG
enum { BRANCH_OFFSET = 1, STR_PTR, TYPE_PTR, NAME_INDEX, FRAME_INDEX, BRANCH_PAIR, U16, FLOAT64, S32, BREAK_OFFSET_AND_COUNT };
struct {

View File

@ -372,7 +372,7 @@ public:
};
#ifdef DEBUG
#ifdef TRACE_DEBUG
uint8 *printInstruction(uint8 *pc, uint8 *start, BytecodeContainer *bCon, JS2Engine *engine);
#endif

View File

@ -3884,7 +3884,8 @@ static const uint8 urlCharType[256] =
// A 'forbidden' member, used to mark hidden bindings
forbiddenMember = new LocalMember(Member::ForbiddenMember, true);
FunctionInstance *fInst;
FunctionInstance *fInst = NULL;
DEFINE_ROOTKEEPER(rk1, fInst);
Variable *v;
// XXX Built-in Attributes... XXX
@ -4865,27 +4866,6 @@ XXX see EvalAttributeExpression, where identifiers are being handled for now...
{
}
/************************************************************************************
*
* Getter
*
************************************************************************************/
void Getter::mark()
{
GCMARKOBJECT(type);
}
/************************************************************************************
*
* Setter
*
************************************************************************************/
void Setter::mark()
{
GCMARKOBJECT(type);
}
/************************************************************************************
*
@ -5118,19 +5098,6 @@ XXX see EvalAttributeExpression, where identifiers are being handled for now...
}
/************************************************************************************
*
* InstanceMember
*
************************************************************************************/
// gc-mark all contained JS2Objects and visit contained structures to do likewise
void InstanceMember::mark()
{
GCMARKOBJECT(multiname);
}
/************************************************************************************
*
* InstanceVariable

View File

@ -610,6 +610,8 @@ public:
JS2Class *type; // Type of values that may be stored in this variable
virtual Access instanceMemberAccess() { return ReadAccess; }
virtual void mark();
};
class InstanceSetter : public InstanceMember {
@ -620,6 +622,7 @@ public:
JS2Class *type; // Type of values that may be stored in this variable
virtual Access instanceMemberAccess() { return WriteAccess; }
virtual void mark();
};
class InstanceBinding {
@ -1615,6 +1618,14 @@ public:
inline char narrow(char16 ch) { return char(ch); }
inline void Setter::mark() { GCMARKOBJECT(type); GCMARKOBJECT(code); }
inline void Getter::mark() { GCMARKOBJECT(type); GCMARKOBJECT(code); }
inline void InstanceGetter::mark() { InstanceMember::mark(); GCMARKOBJECT(type); GCMARKOBJECT(fInst); }
inline void InstanceSetter::mark() { InstanceMember::mark(); GCMARKOBJECT(type); GCMARKOBJECT(fInst); }
inline void InstanceMember::mark() { GCMARKOBJECT(multiname); }
}; // namespace MetaData
inline bool operator==(MetaData::LocalBindingEntry *s1, const String &s2) { return s1->name == s2;}

View File

@ -435,6 +435,7 @@ static js2val String_split(JS2Metadata *meta, const js2val thisValue, js2val *ar
JS2RegExp *RE = NULL;
const String *R = NULL;
DEFINE_ROOTKEEPER(rk2, R);
if (meta->objectType(separatorV) == meta->regexpClass)
RE = (checked_cast<RegExpInstance *>(JS2VAL_TO_OBJECT(separatorV)))->mRegExp;
else
@ -463,7 +464,7 @@ static js2val String_split(JS2Metadata *meta, const js2val thisValue, js2val *ar
}
String *T = NULL;
DEFINE_ROOTKEEPER(rk2, T);
DEFINE_ROOTKEEPER(rk3, T);
while (true) {
uint32 q = p;