Closed Bug 1534721 Opened 6 years ago Closed 6 years ago

Handle fields in derived classes

Categories

(Core :: JavaScript Engine, enhancement, P1)

enhancement

Tracking

()

RESOLVED FIXED
mozilla68
Tracking Status
firefox67 --- wontfix
firefox68 --- fixed

People

(Reporter: khyperia, Assigned: khyperia)

References

Details

Attachments

(1 file)

Currently, fields in derived classes are just entirely broken. Let's fix that.

Priority: -- → P1
Blocks: es-fields

Leaving a note, because I'm not quite ready to review this patch yet.

Three sanity tests to put in the test suite:

class Base {
}
class C extends Base {
  field;
}
new C();

$ $DJS --enable-experimental-fields ../../../../crasher.js
Assertion failure: (activation.regs()).stackDepth() == 0 || (*(activation.regs()).pc == JSOP_AWAIT && !(activation.regs()).fp()->isResumedGenerator()), at /Users/jorendorff/work/gecko/js/src/vm/Interpreter.cpp:2127
class Base {
}
var C = class extends Base {
  field;
};
new C();

$ $DJS --enable-experimental-fields ../../../../crasher.js
Assertion failure: env == cx->global() || env == &cx->global()->lexicalEnvironment() || env->is<RuntimeLexicalErrorObject>(), at /Users/jorendorff/work/gecko/js/src/vm/Interpreter-inl.h:315
class Base {
}
class C extends Base {
  field;
  constructor() {
    super();
  }
};
new C();

$ $DJS --enable-experimental-fields ../../../../crasher.js
Assertion failure: next == JSOP_CHECKTHIS || next == JSOP_CHECKRETURN || next == JSOP_CHECKTHISREINIT, at /Users/jorendorff/work/gecko/js/src/vm/Interpreter.cpp:3520
Pushed by ahauck@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/048424eb3075 Handle fields in derived classes. r=jorendorff
Pushed by ahauck@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/ed722cf1b2d9 Handle fields in derived classes. r=jorendorff
Status: ASSIGNED → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla68
Flags: needinfo?(khyperia)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: