12016-04-08 Skachkov Oleksandr <gskachkov@gmail.com>
2
3 calling super() a second time in a constructor should throw
4 https://bugs.webkit.org/show_bug.cgi?id=151113
5
6 Reviewed by NOBODY (OOPS!).
7
8 Current patch implement check if 'super()' was called in constructor
9 more than once and raise RuntimeError if 'super()' called second time.
10 According to spec we need to raise error just after second super()
11 is finished, and before new this is assign
12 https://esdiscuss.org/topic/duplicate-super-call-behaviour.
13 To implement this behavior was introduced new op code - op_is_empty
14 that is used to check if 'this' is empty.
15
16 * bytecode/BytecodeList.json:
17 * bytecode/BytecodeUseDef.h:
18 (JSC::computeUsesForBytecodeOffset):
19 (JSC::computeDefsForBytecodeOffset):
20 * bytecode/CodeBlock.cpp:
21 (JSC::CodeBlock::dumpBytecode):
22 * bytecompiler/BytecodeGenerator.cpp:
23 (JSC::BytecodeGenerator::emitIsEmpty):
24 * bytecompiler/BytecodeGenerator.h:
25 * bytecompiler/NodesCodegen.cpp:
26 (JSC::FunctionCallValueNode::emitBytecode):
27 * dfg/DFGAbstractInterpreterInlines.h:
28 (JSC::DFG::AbstractInterpreter<AbstractStateType>::executeEffects):
29 * dfg/DFGByteCodeParser.cpp:
30 (JSC::DFG::ByteCodeParser::parseBlock):
31 * dfg/DFGCapabilities.cpp:
32 (JSC::DFG::capabilityLevel):
33 * dfg/DFGClobberize.h:
34 (JSC::DFG::clobberize):
35 * dfg/DFGDoesGC.cpp:
36 (JSC::DFG::doesGC):
37 * dfg/DFGFixupPhase.cpp:
38 (JSC::DFG::FixupPhase::fixupNode):
39 * dfg/DFGNodeType.h:
40 * dfg/DFGPredictionPropagationPhase.cpp:
41 (JSC::DFG::PredictionPropagationPhase::propagate):
42 * dfg/DFGSafeToExecute.h:
43 (JSC::DFG::safeToExecute):
44 * dfg/DFGSpeculativeJIT32_64.cpp:
45 (JSC::DFG::SpeculativeJIT::compile):
46 * dfg/DFGSpeculativeJIT64.cpp:
47 (JSC::DFG::SpeculativeJIT::compile):
48 * ftl/FTLCapabilities.cpp:
49 (JSC::FTL::canCompile):
50 * ftl/FTLLowerDFGToB3.cpp:
51 (JSC::FTL::DFG::LowerDFGToB3::compileNode):
52 (JSC::FTL::DFG::LowerDFGToB3::compileIsEmpty):
53 * jit/JIT.cpp:
54 (JSC::JIT::privateCompileMainPass):
55 * jit/JIT.h:
56 * jit/JITOpcodes.cpp:
57 (JSC::JIT::emit_op_is_empty):
58 * jit/JITOpcodes32_64.cpp:
59 (JSC::JIT::emit_op_is_empty):
60 * llint/LowLevelInterpreter32_64.asm:
61 * llint/LowLevelInterpreter64.asm:
62 * tests/stress/class-syntax-double-constructor.js: Added.
63
64