зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1206485 - "Boot loop after first boot on some devices (Xperia M2, ...)" [r=terrence f=lissyx+mozillians]
This commit is contained in:
Родитель
fd3361fcbd
Коммит
b1c196880f
|
@ -54,6 +54,7 @@ JSFunction::AutoParseUsingFunctionBox::AutoParseUsingFunctionBox(ExclusiveContex
|
|||
: fun_(cx, funbox->function()),
|
||||
oldEnv_(cx, fun_->environment())
|
||||
{
|
||||
fun_->unsetEnvironment();
|
||||
fun_->setFunctionBox(funbox);
|
||||
funbox->computeAllowSyntax(fun_);
|
||||
funbox->computeInWith(fun_);
|
||||
|
@ -62,7 +63,7 @@ JSFunction::AutoParseUsingFunctionBox::AutoParseUsingFunctionBox(ExclusiveContex
|
|||
JSFunction::AutoParseUsingFunctionBox::~AutoParseUsingFunctionBox()
|
||||
{
|
||||
fun_->unsetFunctionBox();
|
||||
fun_->setEnvironment(oldEnv_);
|
||||
fun_->initEnvironment(oldEnv_);
|
||||
}
|
||||
|
||||
namespace js {
|
||||
|
|
|
@ -319,17 +319,22 @@ class JSFunction : public js::NativeObject
|
|||
|
||||
void setEnvironment(JSObject* obj) {
|
||||
MOZ_ASSERT(isInterpreted() && !isBeingParsed());
|
||||
*(js::HeapPtrObject*)&u.i.env_ = obj;
|
||||
*reinterpret_cast<js::HeapPtrObject*>(&u.i.env_) = obj;
|
||||
}
|
||||
|
||||
void initEnvironment(JSObject* obj) {
|
||||
MOZ_ASSERT(isInterpreted() && !isBeingParsed());
|
||||
((js::HeapPtrObject*)&u.i.env_)->init(obj);
|
||||
reinterpret_cast<js::HeapPtrObject*>(&u.i.env_)->init(obj);
|
||||
}
|
||||
|
||||
void unsetEnvironment() {
|
||||
setEnvironment(nullptr);
|
||||
}
|
||||
|
||||
private:
|
||||
void setFunctionBox(js::frontend::FunctionBox* funbox) {
|
||||
MOZ_ASSERT(isInterpreted());
|
||||
MOZ_ASSERT_IF(!isBeingParsed(), !environment());
|
||||
flags_ |= BEING_PARSED;
|
||||
u.i.funbox_ = funbox;
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче