diff --git a/mozilla/js2/src/Makefile.am b/mozilla/js2/src/Makefile.am index 4ba03e3a04c..1e2ec486f96 100644 --- a/mozilla/js2/src/Makefile.am +++ b/mozilla/js2/src/Makefile.am @@ -2,9 +2,11 @@ include $(top_srcdir)/common.mk bin_PROGRAMS = epimetheus DEFS = -DEPIMETHEUS +LIBS = -L$(FDLIBM_DIR) -lfdm epimetheus_DEPENDENCIES = $(LIBFDLIBM) epimetheus_SOURCES = \ bytecodecontainer.cpp \ + epimetheus.cpp \ exception.cpp \ formatter.cpp \ hash.cpp \ diff --git a/mozilla/js2/src/js2array.cpp b/mozilla/js2/src/js2array.cpp index ee5121ee1d5..f7c45597e4f 100644 --- a/mozilla/js2/src/js2array.cpp +++ b/mozilla/js2/src/js2array.cpp @@ -194,7 +194,6 @@ static js2val Array_pop(JS2Metadata *meta, const js2val thisValue, js2val * /*ar if (length > 0) { Multiname mn(numberToString(length - 1), meta->publicNamespace); LookupKind lookup(false, JS2VAL_NULL); - const String *id = numberToString(length - 1); js2val result = JS2VAL_UNDEFINED; bool deleteResult; meta->readDynamicProperty(thisObj, &mn, &lookup, RunPhase, &result); diff --git a/mozilla/js2/src/js2engine.cpp b/mozilla/js2/src/js2engine.cpp index 07cf322fafb..6cf4b6cd311 100644 --- a/mozilla/js2/src/js2engine.cpp +++ b/mozilla/js2/src/js2engine.cpp @@ -107,7 +107,7 @@ namespace MetaData { HandlerData *hndlr = (HandlerData *)mTryStack.top(); ActivationFrame *curAct = (activationStackEmpty()) ? NULL : (activationStackTop - 1); - js2val x; + js2val x = JS2VAL_UNDEFINED; if (curAct != hndlr->mActivation) { ASSERT(!activationStackEmpty()); ActivationFrame *prev; @@ -351,9 +351,9 @@ namespace MetaData { #define INIT_STRINGATOM(n) n##_StringAtom(allocStringPtr(&world.identifiers[#n])) JS2Engine::JS2Engine(World &world) - : pc(NULL), + : meta(NULL), + pc(NULL), bCon(NULL), - meta(NULL), retval(JS2VAL_VOID), INIT_STRINGATOM(true), INIT_STRINGATOM(false), diff --git a/mozilla/js2/src/js2eval.cpp b/mozilla/js2/src/js2eval.cpp index 2e85c458afc..66094353c49 100644 --- a/mozilla/js2/src/js2eval.cpp +++ b/mozilla/js2/src/js2eval.cpp @@ -41,4 +41,7 @@ namespace MetaData { }; // namespace MetaData -}; // namespace Javascript \ No newline at end of file +}; // namespace Javascript + + + diff --git a/mozilla/js2/src/js2metadata.cpp b/mozilla/js2/src/js2metadata.cpp index 2ff8de919e6..37d1cab9ce8 100644 --- a/mozilla/js2/src/js2metadata.cpp +++ b/mozilla/js2/src/js2metadata.cpp @@ -1417,7 +1417,7 @@ namespace MetaData { return a; } Namespace *na = checked_cast(a); - if (b->kind == NamespaceAttr) { + if (b->attrKind == NamespaceAttr) { Namespace *nb = checked_cast(b); CompoundAttribute *c = new CompoundAttribute(); c->addNamespace(na); @@ -1449,7 +1449,7 @@ namespace MetaData { ca->dynamic |= cb->dynamic; if (ca->memberMod == NoModifier) ca->memberMod = cb->memberMod; - if (ca->overrideMod == NoModifier) + if (ca->overrideMod == NoOverride) ca->overrideMod = cb->overrideMod; ca->prototype |= cb->prototype; ca->unused |= cb->unused; @@ -1957,10 +1957,10 @@ doUnary: case ExprNode::numUnit: { NumUnitExprNode *n = checked_cast(p); - if (n->str == L"UL") + if (n->str.compare(String(widenCString("UL"))) == 0) bCon->addUInt64((uint64)(n->num), p->pos); else - if (n->str == L"L") + if (n->str.compare(String(widenCString("L"))) == 0) bCon->addInt64((uint64)(n->num), p->pos); else reportError(Exception::badValueError, "Unrecognized unit", p->pos); @@ -2468,8 +2468,8 @@ doUnary: } Multiname *mn = new Multiname(id); mn->addNamespace(namespaces); - - for (StaticBindingIterator b = localFrame->staticReadBindings.lower_bound(*id), + StaticBindingIterator b, end; + for (b = localFrame->staticReadBindings.lower_bound(*id), end = localFrame->staticReadBindings.upper_bound(*id); (b != end); b++) { if (mn->matches(b->second->qname)) reportError(Exception::definitionError, "Duplicate definition {0}", pos, id); @@ -3017,7 +3017,7 @@ doUnary: const DynamicPropertyMap::value_type e(*name, newValue); dynamicProperties.insert(e); - char16 *numEnd; + const char16 *numEnd; float64 f = stringToDouble(name->data(), name->data() + name->length(), numEnd); uint32 index = JS2Engine::float64toUInt32(f); @@ -3755,7 +3755,7 @@ deleteClassProperty: return (JS2VAL_TO_BOOLEAN(x)) ? 1.0 : 0.0; if (JS2VAL_IS_STRING(x)) { String *str = JS2VAL_TO_STRING(x); - char16 *numEnd; + const char16 *numEnd; return stringToDouble(str->data(), str->data() + str->length(), numEnd); } if (JS2VAL_IS_INACCESSIBLE(x)) diff --git a/mozilla/js2/src/js2number.cpp b/mozilla/js2/src/js2number.cpp index 58822c3bef5..8194e0cc181 100644 --- a/mozilla/js2/src/js2number.cpp +++ b/mozilla/js2/src/js2number.cpp @@ -113,4 +113,6 @@ namespace MetaData { } -} \ No newline at end of file +} + + diff --git a/mozilla/js2/src/js2op_access.cpp b/mozilla/js2/src/js2op_access.cpp index 81cbbba2f18..aa0e9772d0d 100644 --- a/mozilla/js2/src/js2op_access.cpp +++ b/mozilla/js2/src/js2op_access.cpp @@ -234,4 +234,7 @@ Frame *f = meta->env.getTopFrame(); push((*f->temps)[slotIndex]); } - break; \ No newline at end of file + break; + + + diff --git a/mozilla/js2/src/js2op_flowcontrol.cpp b/mozilla/js2/src/js2op_flowcontrol.cpp index c4158c035c9..cb8021217d7 100644 --- a/mozilla/js2/src/js2op_flowcontrol.cpp +++ b/mozilla/js2/src/js2op_flowcontrol.cpp @@ -118,11 +118,11 @@ case eTry: { int32 finallyOffset = BytecodeContainer::getOffset(pc); - if (finallyOffset != NotALabel) + if (finallyOffset != (int32)NotALabel) pushHandler(pc + finallyOffset); pc += sizeof(int32); int32 catchOffset = BytecodeContainer::getOffset(pc); - if (catchOffset != NotALabel) + if (catchOffset != (int32)NotALabel) pushHandler(pc + catchOffset); pc += sizeof(int32); } @@ -157,4 +157,6 @@ finallyStack.pop(); } break; - \ No newline at end of file + + + diff --git a/mozilla/js2/src/js2op_invocation.cpp b/mozilla/js2/src/js2op_invocation.cpp index a00a6795702..905ac57920b 100644 --- a/mozilla/js2/src/js2op_invocation.cpp +++ b/mozilla/js2/src/js2op_invocation.cpp @@ -272,4 +272,6 @@ } push(a); } - break; \ No newline at end of file + break; + + diff --git a/mozilla/js2/src/js2string.cpp b/mozilla/js2/src/js2string.cpp index f632d6cb7f5..f2fe5db1795 100644 --- a/mozilla/js2/src/js2string.cpp +++ b/mozilla/js2/src/js2string.cpp @@ -254,8 +254,8 @@ static js2val String_replace(JS2Metadata *meta, const js2val thisValue, js2val * { const String *S = meta->toString(thisValue); - js2val searchValue; - js2val replaceValue; + js2val searchValue = JS2VAL_UNDEFINED; + js2val replaceValue = JS2VAL_UNDEFINED; if (argc > 0) searchValue = argv[0]; if (argc > 1) replaceValue = argv[1]; diff --git a/mozilla/js2/src/regexp/regexp.c b/mozilla/js2/src/regexp/regexp.c index c6be9b8763c..4d00b6c5630 100644 --- a/mozilla/js2/src/regexp/regexp.c +++ b/mozilla/js2/src/regexp/regexp.c @@ -357,7 +357,7 @@ static REbool calculateBitmapSize(REState *pState, RENode *target) { - REchar rangeStart; + REchar rangeStart = 0; const REchar *src = (const REchar *)(target->child); const REchar *end = target->data.chclass.end; @@ -1205,7 +1205,7 @@ static void addCharacterRangeToCharSet(RECharSet *cs, REchar c1, REchar c2) static REbool processCharSet(REState *pState, RENode *target) { - REchar rangeStart, thisCh; + REchar rangeStart = 0, thisCh; const REchar *src = (const REchar *)(target->child); const REchar *end = target->data.chclass.end; @@ -1666,12 +1666,12 @@ static REMatchState *executeREBytecode(REuint8 *pc, REGlobalData *gData, REMatch { REOp op = (REOp)(*pc++); REContinuationData currentContinuation; - REMatchState *result; + REMatchState *result = NULL; REBackTrackData *backTrackData; REint32 k, length, offset, index; REuint32 parenIndex; REbool anchor = RE_FALSE; - REchar anchorCh; + REchar anchorCh = 0; REchar matchCh; REuint8 *nextpc; REOp nextop; @@ -1810,7 +1810,7 @@ static REMatchState *executeREBytecode(REuint8 *pc, REGlobalData *gData, REMatch pc += ARG_LEN; x->parens[parenIndex].length = x->endIndex - x->parens[parenIndex].index; - if (parenIndex > gData->lastParen) + if ((REint32)parenIndex > gData->lastParen) gData->lastParen = (REint32)parenIndex; op = (REOp)(*pc++); continue;