summaryrefslogtreecommitdiffstats
path: root/js/src/jit
diff options
context:
space:
mode:
authorjanekptacijarabaci <janekptacijarabaci@seznam.cz>2018-03-25 16:22:38 +0200
committerjanekptacijarabaci <janekptacijarabaci@seznam.cz>2018-03-25 16:22:38 +0200
commitb311e8fa718e2a32805c25847781cc8a6a0541bd (patch)
tree458018bc532e6a56878c901424cdf2ddc5595694 /js/src/jit
parent2818e8dedb4a9a6cf40688ad42bf2be05e2f26d2 (diff)
downloadUXP-b311e8fa718e2a32805c25847781cc8a6a0541bd.tar
UXP-b311e8fa718e2a32805c25847781cc8a6a0541bd.tar.gz
UXP-b311e8fa718e2a32805c25847781cc8a6a0541bd.tar.lz
UXP-b311e8fa718e2a32805c25847781cc8a6a0541bd.tar.xz
UXP-b311e8fa718e2a32805c25847781cc8a6a0541bd.zip
Bug 1342553, Bug 1343072, Bug 1344753 (details in the description)
Bug 1342553 - Part 0.1: Use try-catch for IteratorClose in for-of Bug 1343072 - Update HasLiveStackValueAtDepth to follow the change in JSTRY_FOR_OF Bug 1344753 - Update for-of stack depth in ControlFlowGenerator::processWhileOrForInLoop Issue #74
Diffstat (limited to 'js/src/jit')
-rw-r--r--js/src/jit/BaselineBailouts.cpp14
-rw-r--r--js/src/jit/JitFrames.cpp15
2 files changed, 4 insertions, 25 deletions
diff --git a/js/src/jit/BaselineBailouts.cpp b/js/src/jit/BaselineBailouts.cpp
index 161e1aa4c..3ab722b3d 100644
--- a/js/src/jit/BaselineBailouts.cpp
+++ b/js/src/jit/BaselineBailouts.cpp
@@ -509,16 +509,10 @@ HasLiveStackValueAtDepth(JSScript* script, jsbytecode* pc, uint32_t stackDepth)
break;
case JSTRY_FOR_OF:
- // For-of loops have both the iterator and the result object on
- // stack. The iterator is below the result object.
- if (stackDepth == tn->stackDepth - 1)
- return true;
- break;
-
- case JSTRY_ITERCLOSE:
- // Code that need to call IteratorClose have the iterator on the
- // stack.
- if (stackDepth == tn->stackDepth)
+ // For-of loops have the iterator, the result object, and the value
+ // of the result object on stack. The iterator is below the result
+ // object and the value.
+ if (stackDepth == tn->stackDepth - 2)
return true;
break;
diff --git a/js/src/jit/JitFrames.cpp b/js/src/jit/JitFrames.cpp
index 7c3f0d120..a70356ad4 100644
--- a/js/src/jit/JitFrames.cpp
+++ b/js/src/jit/JitFrames.cpp
@@ -331,7 +331,6 @@ static void
CloseLiveIteratorIon(JSContext* cx, const InlineFrameIterator& frame, JSTryNote* tn)
{
MOZ_ASSERT(tn->kind == JSTRY_FOR_IN ||
- tn->kind == JSTRY_ITERCLOSE ||
tn->kind == JSTRY_DESTRUCTURING_ITERCLOSE);
bool isDestructuring = tn->kind == JSTRY_DESTRUCTURING_ITERCLOSE;
@@ -442,7 +441,6 @@ HandleExceptionIon(JSContext* cx, const InlineFrameIterator& frame, ResumeFromEx
switch (tn->kind) {
case JSTRY_FOR_IN:
- case JSTRY_ITERCLOSE:
case JSTRY_DESTRUCTURING_ITERCLOSE:
MOZ_ASSERT_IF(tn->kind == JSTRY_FOR_IN,
JSOp(*(script->main() + tn->start + tn->length)) == JSOP_ENDITER);
@@ -637,19 +635,6 @@ ProcessTryNotesBaseline(JSContext* cx, const JitFrameIterator& frame, Environmen
break;
}
- case JSTRY_ITERCLOSE: {
- uint8_t* framePointer;
- uint8_t* stackPointer;
- BaselineFrameAndStackPointersFromTryNote(tn, frame, &framePointer, &stackPointer);
- Value iterValue(*reinterpret_cast<Value*>(stackPointer));
- RootedObject iterObject(cx, &iterValue.toObject());
- if (!IteratorCloseForException(cx, iterObject)) {
- SettleOnTryNote(cx, tn, frame, ei, rfe, pc);
- return false;
- }
- break;
- }
-
case JSTRY_DESTRUCTURING_ITERCLOSE: {
uint8_t* framePointer;
uint8_t* stackPointer;