зеркало из https://github.com/mozilla/gecko-dev.git
Backed out 2 changesets (bug 1584758) for build bustages /builds/worker/workspace/build/src/js/src/vm/BytecodeLocation.h on a CLOSED TREE
Backed out changeset a693df77606e (bug 1584758) Backed out changeset 9737b534c68f (bug 1584758)
This commit is contained in:
Родитель
00108aa19b
Коммит
621b6d5c63
|
@ -22,8 +22,6 @@
|
|||
#include "jit/Lowering.h"
|
||||
#include "jit/MIRGraph.h"
|
||||
#include "vm/ArgumentsObject.h"
|
||||
#include "vm/BytecodeIterator.h"
|
||||
#include "vm/BytecodeLocation.h"
|
||||
#include "vm/BytecodeUtil.h"
|
||||
#include "vm/EnvironmentObject.h"
|
||||
#include "vm/Instrumentation.h"
|
||||
|
@ -35,8 +33,6 @@
|
|||
#include "gc/Nursery-inl.h"
|
||||
#include "jit/CompileInfo-inl.h"
|
||||
#include "jit/shared/Lowering-shared-inl.h"
|
||||
#include "vm/BytecodeIterator-inl.h"
|
||||
#include "vm/BytecodeLocation-inl.h"
|
||||
#include "vm/BytecodeUtil-inl.h"
|
||||
#include "vm/EnvironmentObject-inl.h"
|
||||
#include "vm/JSScript-inl.h"
|
||||
|
@ -630,54 +626,49 @@ AbortReasonOr<Ok> IonBuilder::analyzeNewLoopTypes(
|
|||
}
|
||||
}
|
||||
|
||||
// Get the start and end bytecode locations of this loop.
|
||||
BytecodeLocation start(script_, loopEntryBlock->stopPc());
|
||||
start = start.next();
|
||||
BytecodeLocation end(script_, loopEntry->loopStopPc());
|
||||
// Get the start and end pc of this loop.
|
||||
jsbytecode* start = loopEntryBlock->stopPc();
|
||||
start += GetBytecodeLength(start);
|
||||
jsbytecode* end = loopEntry->loopStopPc();
|
||||
|
||||
// Iterate the bytecode quickly to seed possible types in the loopheader.
|
||||
BytecodeLocation last = start;
|
||||
BytecodeLocation earlier = last;
|
||||
|
||||
for (auto it : BytecodeLocationRange(start, end)) {
|
||||
// Keeping track of previous BytecodeLocation values
|
||||
earlier = last;
|
||||
last = it;
|
||||
|
||||
jsbytecode* last = nullptr;
|
||||
jsbytecode* earlier = nullptr;
|
||||
for (jsbytecode* pc = start; pc != end;
|
||||
earlier = last, last = pc, pc += GetBytecodeLength(pc)) {
|
||||
uint32_t slot;
|
||||
|
||||
if (it.is(JSOP_SETLOCAL)) {
|
||||
slot = info().localSlot(it.local());
|
||||
} else if (it.is(JSOP_SETARG)) {
|
||||
slot = info().argSlotUnchecked(it.arg());
|
||||
if (*pc == JSOP_SETLOCAL) {
|
||||
slot = info().localSlot(GET_LOCALNO(pc));
|
||||
} else if (*pc == JSOP_SETARG) {
|
||||
slot = info().argSlotUnchecked(GET_ARGNO(pc));
|
||||
} else {
|
||||
continue;
|
||||
}
|
||||
if (slot >= info().firstStackSlot()) {
|
||||
continue;
|
||||
}
|
||||
if (!last.isValid(script_)) {
|
||||
if (!last) {
|
||||
continue;
|
||||
}
|
||||
|
||||
MPhi* phi = entry->getSlot(slot)->toPhi();
|
||||
|
||||
if (last.is(JSOP_POS) || last.is(JSOP_TONUMERIC)) {
|
||||
if (*last == JSOP_POS || *last == JSOP_TONUMERIC) {
|
||||
last = earlier;
|
||||
}
|
||||
|
||||
if (last.opHasTypeSet()) {
|
||||
TemporaryTypeSet* typeSet = bytecodeTypes(last.toRawBytecode());
|
||||
if (BytecodeOpHasTypeSet(JSOp(*last))) {
|
||||
TemporaryTypeSet* typeSet = bytecodeTypes(last);
|
||||
if (!typeSet->empty()) {
|
||||
MIRType type = typeSet->getKnownMIRType();
|
||||
if (!phi->addBackedgeType(alloc(), type, typeSet)) {
|
||||
return abort(AbortReason::Alloc);
|
||||
}
|
||||
}
|
||||
} else if (last.is(JSOP_GETLOCAL) || last.is(JSOP_GETARG)) {
|
||||
uint32_t slot = (last.is(JSOP_GETLOCAL))
|
||||
? info().localSlot(last.local())
|
||||
: info().argSlotUnchecked(last.arg());
|
||||
} else if (*last == JSOP_GETLOCAL || *last == JSOP_GETARG) {
|
||||
uint32_t slot = (*last == JSOP_GETLOCAL)
|
||||
? info().localSlot(GET_LOCALNO(last))
|
||||
: info().argSlotUnchecked(GET_ARGNO(last));
|
||||
if (slot < info().firstStackSlot()) {
|
||||
MPhi* otherPhi = entry->getSlot(slot)->toPhi();
|
||||
if (otherPhi->hasBackedgeType()) {
|
||||
|
@ -689,7 +680,7 @@ AbortReasonOr<Ok> IonBuilder::analyzeNewLoopTypes(
|
|||
}
|
||||
} else {
|
||||
MIRType type = MIRType::None;
|
||||
switch (last.getOp()) {
|
||||
switch (*last) {
|
||||
case JSOP_VOID:
|
||||
case JSOP_UNDEFINED:
|
||||
type = MIRType::Undefined;
|
||||
|
@ -755,7 +746,7 @@ AbortReasonOr<Ok> IonBuilder::analyzeNewLoopTypes(
|
|||
case JSOP_NEG:
|
||||
case JSOP_INC:
|
||||
case JSOP_DEC:
|
||||
type = inspector->expectedResultType(last.toRawBytecode());
|
||||
type = inspector->expectedResultType(last);
|
||||
break;
|
||||
case JSOP_BIGINT:
|
||||
type = MIRType::BigInt;
|
||||
|
|
|
@ -10,7 +10,6 @@
|
|||
#include "vm/BytecodeIterator.h"
|
||||
|
||||
#include "vm/JSScript.h"
|
||||
|
||||
namespace js {
|
||||
|
||||
inline BytecodeIterator::BytecodeIterator(const JSScript* script)
|
||||
|
@ -26,15 +25,5 @@ inline BytecodeIterator AllBytecodesIterable::end() {
|
|||
return BytecodeIterator(BytecodeLocation(script_, script_->codeEnd()));
|
||||
}
|
||||
|
||||
// BytecodeLocationRange
|
||||
|
||||
inline BytecodeIterator BytecodeLocationRange::begin() {
|
||||
return BytecodeIterator(beginLoc_);
|
||||
}
|
||||
|
||||
inline BytecodeIterator BytecodeLocationRange::end() {
|
||||
return BytecodeIterator(endLoc_);
|
||||
}
|
||||
|
||||
} // namespace js
|
||||
#endif
|
||||
|
|
|
@ -56,27 +56,6 @@ class AllBytecodesIterable {
|
|||
BytecodeIterator end();
|
||||
};
|
||||
|
||||
// Construct a range based iterator that will visit all bytecode locations
|
||||
// between two given bytecode locations.
|
||||
// `beginLoc_` is the bytecode location where the iterator will start, and
|
||||
// `endLoc_` is the bytecode location where the iterator will end.
|
||||
class BytecodeLocationRange {
|
||||
BytecodeLocation beginLoc_;
|
||||
BytecodeLocation endLoc_;
|
||||
|
||||
public:
|
||||
explicit BytecodeLocationRange(BytecodeLocation beginLoc,
|
||||
BytecodeLocation endLoc)
|
||||
: beginLoc_(beginLoc), endLoc_(endLoc) {
|
||||
#ifdef DEBUG
|
||||
MOZ_ASSERT(beginLoc.hasSameScript(endLoc));
|
||||
#endif
|
||||
}
|
||||
|
||||
BytecodeIterator begin();
|
||||
BytecodeIterator end();
|
||||
};
|
||||
|
||||
} // namespace js
|
||||
|
||||
#endif
|
||||
|
|
|
@ -35,6 +35,7 @@ class BytecodeLocation {
|
|||
#ifdef DEBUG
|
||||
const JSScript* debugOnlyScript_;
|
||||
#endif
|
||||
|
||||
// Construct a new BytecodeLocation, while borrowing scriptIdentity
|
||||
// from some other BytecodeLocation.
|
||||
BytecodeLocation(const BytecodeLocation& loc, RawBytecode pc)
|
||||
|
@ -48,9 +49,6 @@ class BytecodeLocation {
|
|||
}
|
||||
|
||||
public:
|
||||
// Disallow the creation of an uninitialized location.
|
||||
BytecodeLocation() = delete;
|
||||
|
||||
BytecodeLocation(const JSScript* script, RawBytecode pc)
|
||||
: rawBytecode_(pc)
|
||||
#ifdef DEBUG
|
||||
|
@ -75,12 +73,6 @@ class BytecodeLocation {
|
|||
|
||||
PropertyName* getPropertyName(const JSScript* script) const;
|
||||
|
||||
#ifdef DEBUG
|
||||
bool hasSameScript(const BytecodeLocation& other) const {
|
||||
return debugOnlyScript_ == other.debugOnlyScript_;
|
||||
}
|
||||
#endif
|
||||
|
||||
bool operator==(const BytecodeLocation& other) const {
|
||||
MOZ_ASSERT(this->debugOnlyScript_ == other.debugOnlyScript_);
|
||||
return rawBytecode_ == other.rawBytecode_;
|
||||
|
@ -130,16 +122,10 @@ class BytecodeLocation {
|
|||
|
||||
bool opHasTypeSet() const { return BytecodeOpHasTypeSet(getOp()); }
|
||||
|
||||
bool opHasTypeSet() const { return BytecodeOpHasTypeSet(getOp()); }
|
||||
|
||||
bool fallsThrough() const { return BytecodeFallsThrough(getOp()); }
|
||||
|
||||
uint32_t icIndex() const { return GET_ICINDEX(rawBytecode_); }
|
||||
|
||||
uint32_t local() const { return GET_LOCALNO(rawBytecode_); }
|
||||
|
||||
uint16_t arg() const { return GET_ARGNO(rawBytecode_); }
|
||||
|
||||
bool isEqualityOp() const { return IsEqualityOp(getOp()); }
|
||||
|
||||
bool isStrictEqualityOp() const {
|
||||
|
|
Загрузка…
Ссылка в новой задаче