| Differences between
and this patch
- a/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj +2 lines
Lines 2778-2783 a/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj_sec1
2778
		99E45A2118A1B2590026D88F /* EncodedValue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EncodedValue.h; sourceTree = "<group>"; };
2778
		99E45A2118A1B2590026D88F /* EncodedValue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EncodedValue.h; sourceTree = "<group>"; };
2779
		99E45A2218A1B2590026D88F /* InputCursor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InputCursor.h; sourceTree = "<group>"; };
2779
		99E45A2218A1B2590026D88F /* InputCursor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InputCursor.h; sourceTree = "<group>"; };
2780
		99E45A2318A1B2590026D88F /* NondeterministicInput.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NondeterministicInput.h; sourceTree = "<group>"; };
2780
		99E45A2318A1B2590026D88F /* NondeterministicInput.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NondeterministicInput.h; sourceTree = "<group>"; };
2781
		9B4954E81A6640DB002815A6 /* ParserFunctionInfo.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ParserFunctionInfo.h; sourceTree = "<group>"; };
2781
		9E729409190F0306001A91B5 /* BundlePath.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = BundlePath.mm; sourceTree = "<group>"; };
2782
		9E729409190F0306001A91B5 /* BundlePath.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = BundlePath.mm; sourceTree = "<group>"; };
2782
		9E72940A190F0514001A91B5 /* BundlePath.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BundlePath.h; sourceTree = "<group>"; };
2783
		9E72940A190F0514001A91B5 /* BundlePath.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BundlePath.h; sourceTree = "<group>"; };
2783
		9EA5C7A0190F05D200508EBE /* InitializeLLVMMac.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = InitializeLLVMMac.cpp; path = llvm/InitializeLLVMMac.cpp; sourceTree = "<group>"; };
2784
		9EA5C7A0190F05D200508EBE /* InitializeLLVMMac.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = InitializeLLVMMac.cpp; path = llvm/InitializeLLVMMac.cpp; sourceTree = "<group>"; };
Lines 4141-4146 a/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj_sec2
4141
				93052C320FB792190048FDC3 /* ParserArena.cpp */,
4142
				93052C320FB792190048FDC3 /* ParserArena.cpp */,
4142
				93052C330FB792190048FDC3 /* ParserArena.h */,
4143
				93052C330FB792190048FDC3 /* ParserArena.h */,
4143
				0FCCAE4316D0CF6E00D0C65B /* ParserError.h */,
4144
				0FCCAE4316D0CF6E00D0C65B /* ParserError.h */,
4145
				9B4954E81A6640DB002815A6 /* ParserFunctionInfo.h */,
4144
				A77F18241641925400640A47 /* ParserModes.h */,
4146
				A77F18241641925400640A47 /* ParserModes.h */,
4145
				65303D631447B9E100D3F904 /* ParserTokens.h */,
4147
				65303D631447B9E100D3F904 /* ParserTokens.h */,
4146
				869EBCB60E8C6D4A008722CC /* ResultType.h */,
4148
				869EBCB60E8C6D4A008722CC /* ResultType.h */,
- a/Source/JavaScriptCore/bytecompiler/NodesCodegen.cpp -32 / +168 lines
Lines 147-152 RegisterID* ThisNode::emitBytecode(BytecodeGenerator& generator, RegisterID* dst a/Source/JavaScriptCore/bytecompiler/NodesCodegen.cpp_sec1
147
    return result;
147
    return result;
148
}
148
}
149
149
150
// ------------------------------ SuperNode -------------------------------------
151
152
RegisterID* SuperNode::emitBytecode(BytecodeGenerator& generator, RegisterID* dst)
153
{
154
    if (dst == generator.ignoredResult())
155
        return 0;
156
157
    RegisterID callee;
158
    callee.setIndex(JSStack::Callee);
159
160
    RefPtr<RegisterID> homeObject = generator.emitGetById(generator.newTemporary(), &callee, generator.propertyNames().homeObjectPrivateName);
161
    RefPtr<RegisterID> protoParent = generator.emitGetById(generator.newTemporary(), homeObject.get(), generator.propertyNames().underscoreProto);
162
    return generator.emitGetById(generator.finalDestination(dst), protoParent.get(), generator.propertyNames().constructor);
163
}
164
165
static RegisterID* emitSuperBaseForCallee(BytecodeGenerator& generator)
166
{
167
    RegisterID callee;
168
    callee.setIndex(JSStack::Callee);
169
170
    RefPtr<RegisterID> homeObject = generator.emitGetById(generator.newTemporary(), &callee, generator.propertyNames().homeObjectPrivateName);
171
    return generator.emitGetById(generator.newTemporary(), homeObject.get(), generator.propertyNames().underscoreProto);
172
}
173
174
// ------------------------------ SuperBracketAccessorNode -------------------------------------
175
176
RegisterID* SuperBracketAccessorNode::emitBytecode(BytecodeGenerator& generator, RegisterID* dst)
177
{
178
    UNUSED_PARAM(m_subscript);
179
    if (dst == generator.ignoredResult())
180
        return 0;
181
182
    RegisterID callee;
183
    callee.setIndex(JSStack::Callee);
184
185
    
186
187
    return generator.moveToDestinationIfNeeded(dst, &callee /* generator.scopeRegister() */);
188
}
189
190
// ------------------------------ SuperDotAccessorNode -------------------------------------
191
192
RegisterID* SuperDotAccessorNode::emitBytecode(BytecodeGenerator& generator, RegisterID* dst)
193
{
194
    UNUSED_PARAM(m_ident);
195
    if (dst == generator.ignoredResult())
196
        return 0;
197
198
    RegisterID callee;
199
    callee.setIndex(JSStack::Callee);
200
201
    RefPtr<RegisterID> homeObject = generator.emitGetById(generator.newTemporary(), &callee, generator.propertyNames().homeObjectPrivateName);
202
    RefPtr<RegisterID> baseValue = generator.emitGetById(generator.newTemporary(), homeObject.get(), generator.propertyNames().underscoreProto);
203
    return generator.emitGetById(generator.tempDestination(dst), baseValue.get(), m_ident);
204
}
205
150
// ------------------------------ ResolveNode ----------------------------------
206
// ------------------------------ ResolveNode ----------------------------------
151
207
152
bool ResolveNode::isPure(BytecodeGenerator& generator) const
208
bool ResolveNode::isPure(BytecodeGenerator& generator) const
Lines 273-304 ArgumentListNode* ArrayNode::toArgumentList(ParserArena& parserArena, int lineNu a/Source/JavaScriptCore/bytecompiler/NodesCodegen.cpp_sec2
273
329
274
RegisterID* ObjectLiteralNode::emitBytecode(BytecodeGenerator& generator, RegisterID* dst)
330
RegisterID* ObjectLiteralNode::emitBytecode(BytecodeGenerator& generator, RegisterID* dst)
275
{
331
{
276
     if (!m_list) {
332
    if (!m_list) {
277
         if (dst == generator.ignoredResult())
333
        if (dst == generator.ignoredResult())
278
             return 0;
334
            return 0;
279
         return generator.emitNewObject(generator.finalDestination(dst));
335
        return generator.emitNewObject(generator.finalDestination(dst));
280
     }
336
    }
281
     return generator.emitNode(dst, m_list);
337
    RefPtr<RegisterID> newObj = generator.emitNewObject(generator.finalDestination(dst));
338
    return generator.emitNode(newObj.get(), m_list);
282
}
339
}
283
340
284
// ------------------------------ PropertyListNode -----------------------------
341
// ------------------------------ PropertyListNode -----------------------------
285
342
286
RegisterID* PropertyListNode::emitBytecode(BytecodeGenerator& generator, RegisterID* dst)
343
RegisterID* PropertyListNode::emitBytecode(BytecodeGenerator& generator, RegisterID* dst)
287
{
344
{
288
    RefPtr<RegisterID> newObj = generator.tempDestination(dst);
345
    RefPtr<RegisterID> newObj = dst;
289
    
346
290
    generator.emitNewObject(newObj.get());
291
    
292
    // Fast case: this loop just handles regular value properties.
347
    // Fast case: this loop just handles regular value properties.
293
    PropertyListNode* p = this;
348
    PropertyListNode* p = this;
294
    for (; p && p->m_node->m_type == PropertyNode::Constant; p = p->m_next) {
349
    for (; p && p->m_node->m_type == PropertyNode::Constant; p = p->m_next)
295
        if (p->m_node->m_name) {
350
        emitConstantProperty(generator, newObj.get(), p->m_node);
296
            generator.emitDirectPutById(newObj.get(), *p->m_node->name(), generator.emitNode(p->m_node->m_assign));
297
            continue;
298
        }
299
        RefPtr<RegisterID> propertyName = generator.emitNode(p->m_node->m_expression);
300
        generator.emitDirectPutByVal(newObj.get(), propertyName.get(), generator.emitNode(p->m_node->m_assign));
301
    }
302
351
303
    // Were there any get/set properties?
352
    // Were there any get/set properties?
304
    if (p) {
353
    if (p) {
Lines 324-335 RegisterID* PropertyListNode::emitBytecode(BytecodeGenerator& generator, Registe a/Source/JavaScriptCore/bytecompiler/NodesCodegen.cpp_sec3
324
373
325
            // Handle regular values.
374
            // Handle regular values.
326
            if (node->m_type == PropertyNode::Constant) {
375
            if (node->m_type == PropertyNode::Constant) {
327
                if (node->name()) {
376
                emitConstantProperty(generator, newObj.get(), node);
328
                    generator.emitDirectPutById(newObj.get(), *node->name(), generator.emitNode(node->m_assign));
329
                    continue;
330
                }
331
                RefPtr<RegisterID> propertyName = generator.emitNode(p->m_node->m_expression);
332
                generator.emitDirectPutByVal(newObj.get(), propertyName.get(), generator.emitNode(p->m_node->m_assign));
333
                continue;
377
                continue;
334
            }
378
            }
335
            
379
            
Lines 370-386 RegisterID* PropertyListNode::emitBytecode(BytecodeGenerator& generator, Registe a/Source/JavaScriptCore/bytecompiler/NodesCodegen.cpp_sec4
370
                }
414
                }
371
            }
415
            }
372
416
417
            // FIXME: Set super on getter & setter.
418
373
            generator.emitPutGetterSetter(newObj.get(), *node->name(), getterReg.get(), setterReg.get());
419
            generator.emitPutGetterSetter(newObj.get(), *node->name(), getterReg.get(), setterReg.get());
374
        }
420
        }
375
    }
421
    }
376
422
377
    return generator.moveToDestinationIfNeeded(dst, newObj.get());
423
    return dst;
424
}
425
426
static void emitPutHomeObject(BytecodeGenerator& generator, RegisterID* function, RegisterID* homeObject)
427
{
428
    generator.emitPutById(function, generator.propertyNames().homeObjectPrivateName, homeObject);
429
}
430
431
void PropertyListNode::emitConstantProperty(BytecodeGenerator& generator, RegisterID* newObj, PropertyNode* node)
432
{
433
    if (node->name()) {
434
        RefPtr<RegisterID> value = generator.emitNode(node->m_assign);
435
        generator.emitDirectPutById(newObj, *node->name(), value.get());
436
        // FIXME: ES6 spec says we should only store homeObject when the function has "super"
437
        // but we can't easily determine it here since we lazily evaluate the function body.
438
        if (m_isMethodList)
439
            emitPutHomeObject(generator, value.get(), newObj);
440
        return;
441
    }
442
    ASSERT(!m_isMethodList);
443
    RefPtr<RegisterID> propertyName = generator.emitNode(node->m_expression);
444
    generator.emitDirectPutByVal(newObj, propertyName.get(), generator.emitNode(node->m_assign));
378
}
445
}
379
446
380
// ------------------------------ BracketAccessorNode --------------------------------
447
// ------------------------------ BracketAccessorNode --------------------------------
381
448
382
RegisterID* BracketAccessorNode::emitBytecode(BytecodeGenerator& generator, RegisterID* dst)
449
RegisterID* BracketAccessorNode::emitBytecode(BytecodeGenerator& generator, RegisterID* dst)
383
{
450
{
451
    if (m_base->isSuperNode()) {
452
        // FIXME: Should we generate the profiler info?
453
        if (m_subscript->isString()) {
454
            const Identifier& id = static_cast<StringNode*>(m_subscript)->value();
455
            return generator.emitGetById(generator.finalDestination(dst), emitSuperBaseForCallee(generator), id);
456
        }
457
        return generator.emitGetByVal(generator.finalDestination(dst), emitSuperBaseForCallee(generator), generator.emitNode(m_subscript));
458
    }
384
    if (m_base->isResolveNode() 
459
    if (m_base->isResolveNode() 
385
        && generator.willResolveToArguments(static_cast<ResolveNode*>(m_base)->identifier())
460
        && generator.willResolveToArguments(static_cast<ResolveNode*>(m_base)->identifier())
386
        && !generator.symbolTable().slowArguments()) {
461
        && !generator.symbolTable().slowArguments()) {
Lines 425-431 RegisterID* DotAccessorNode::emitBytecode(BytecodeGenerator& generator, Register a/Source/JavaScriptCore/bytecompiler/NodesCodegen.cpp_sec5
425
    }
500
    }
426
501
427
nonArgumentsPath:
502
nonArgumentsPath:
428
    RefPtr<RegisterID> base = generator.emitNode(m_base);
503
    RefPtr<RegisterID> base = m_base->isSuperNode() ? emitSuperBaseForCallee(generator) : generator.emitNode(m_base);
429
    generator.emitExpressionInfo(divot(), divotStart(), divotEnd());
504
    generator.emitExpressionInfo(divot(), divotStart(), divotEnd());
430
    RegisterID* finalDest = generator.finalDestination(dst);
505
    RegisterID* finalDest = generator.finalDestination(dst);
431
    RegisterID* ret = generator.emitGetById(finalDest, base.get(), m_ident);
506
    RegisterID* ret = generator.emitGetById(finalDest, base.get(), m_ident);
Lines 512-518 RegisterID* FunctionCallValueNode::emitBytecode(BytecodeGenerator& generator, Re a/Source/JavaScriptCore/bytecompiler/NodesCodegen.cpp_sec6
512
    RefPtr<RegisterID> func = generator.emitNode(m_expr);
587
    RefPtr<RegisterID> func = generator.emitNode(m_expr);
513
    RefPtr<RegisterID> returnValue = generator.finalDestination(dst, func.get());
588
    RefPtr<RegisterID> returnValue = generator.finalDestination(dst, func.get());
514
    CallArguments callArguments(generator, m_args);
589
    CallArguments callArguments(generator, m_args);
515
    generator.emitLoad(callArguments.thisRegister(), jsUndefined());
590
    if (m_expr->isSuperNode())
591
        generator.emitLoad(callArguments.thisRegister(), generator.thisRegister());
592
    else
593
        generator.emitLoad(callArguments.thisRegister(), jsUndefined());
516
    RegisterID* ret = generator.emitCall(returnValue.get(), func.get(), NoExpectedFunction, callArguments, divot(), divotStart(), divotEnd());
594
    RegisterID* ret = generator.emitCall(returnValue.get(), func.get(), NoExpectedFunction, callArguments, divot(), divotStart(), divotEnd());
517
    if (generator.vm()->typeProfiler()) {
595
    if (generator.vm()->typeProfiler()) {
518
        generator.emitProfileType(returnValue.get(), ProfileTypeBytecodeDoesNotHaveGlobalID, nullptr);
596
        generator.emitProfileType(returnValue.get(), ProfileTypeBytecodeDoesNotHaveGlobalID, nullptr);
Lines 563-575 RegisterID* FunctionCallResolveNode::emitBytecode(BytecodeGenerator& generator, a/Source/JavaScriptCore/bytecompiler/NodesCodegen.cpp_sec7
563
641
564
RegisterID* FunctionCallBracketNode::emitBytecode(BytecodeGenerator& generator, RegisterID* dst)
642
RegisterID* FunctionCallBracketNode::emitBytecode(BytecodeGenerator& generator, RegisterID* dst)
565
{
643
{
566
    RefPtr<RegisterID> base = generator.emitNode(m_base);
644
    bool baseIsSuper = m_base->isSuperNode();
645
    RefPtr<RegisterID> base = baseIsSuper ? emitSuperBaseForCallee(generator) : generator.emitNode(m_base);
567
    RefPtr<RegisterID> property = generator.emitNode(m_subscript);
646
    RefPtr<RegisterID> property = generator.emitNode(m_subscript);
568
    generator.emitExpressionInfo(subexpressionDivot(), subexpressionStart(), subexpressionEnd());
647
    generator.emitExpressionInfo(subexpressionDivot(), subexpressionStart(), subexpressionEnd());
569
    RefPtr<RegisterID> function = generator.emitGetByVal(generator.tempDestination(dst), base.get(), property.get());
648
    RefPtr<RegisterID> function = generator.emitGetByVal(generator.tempDestination(dst), base.get(), property.get());
570
    RefPtr<RegisterID> returnValue = generator.finalDestination(dst, function.get());
649
    RefPtr<RegisterID> returnValue = generator.finalDestination(dst, function.get());
571
    CallArguments callArguments(generator, m_args);
650
    CallArguments callArguments(generator, m_args);
572
    generator.emitMove(callArguments.thisRegister(), base.get());
651
    if (baseIsSuper)
652
        generator.emitMove(callArguments.thisRegister(), generator.thisRegister());
653
    else
654
        generator.emitMove(callArguments.thisRegister(), base.get());
573
    RegisterID* ret = generator.emitCall(returnValue.get(), function.get(), NoExpectedFunction, callArguments, divot(), divotStart(), divotEnd());
655
    RegisterID* ret = generator.emitCall(returnValue.get(), function.get(), NoExpectedFunction, callArguments, divot(), divotStart(), divotEnd());
574
    if (generator.vm()->typeProfiler()) {
656
    if (generator.vm()->typeProfiler()) {
575
        generator.emitProfileType(returnValue.get(), ProfileTypeBytecodeDoesNotHaveGlobalID, nullptr);
657
        generator.emitProfileType(returnValue.get(), ProfileTypeBytecodeDoesNotHaveGlobalID, nullptr);
Lines 585-593 RegisterID* FunctionCallDotNode::emitBytecode(BytecodeGenerator& generator, Regi a/Source/JavaScriptCore/bytecompiler/NodesCodegen.cpp_sec8
585
    RefPtr<RegisterID> function = generator.tempDestination(dst);
667
    RefPtr<RegisterID> function = generator.tempDestination(dst);
586
    RefPtr<RegisterID> returnValue = generator.finalDestination(dst, function.get());
668
    RefPtr<RegisterID> returnValue = generator.finalDestination(dst, function.get());
587
    CallArguments callArguments(generator, m_args);
669
    CallArguments callArguments(generator, m_args);
588
    generator.emitNode(callArguments.thisRegister(), m_base);
670
    bool baseIsSuper = m_base->isSuperNode();
671
    if (baseIsSuper)
672
        generator.emitMove(callArguments.thisRegister(), generator.thisRegister());
673
    else
674
        generator.emitNode(callArguments.thisRegister(), m_base);
675
589
    generator.emitExpressionInfo(subexpressionDivot(), subexpressionStart(), subexpressionEnd());
676
    generator.emitExpressionInfo(subexpressionDivot(), subexpressionStart(), subexpressionEnd());
590
    generator.emitGetById(function.get(), callArguments.thisRegister(), m_ident);
677
    generator.emitGetById(function.get(), baseIsSuper ? emitSuperBaseForCallee(generator) : callArguments.thisRegister(), m_ident);
591
    RegisterID* ret = generator.emitCall(returnValue.get(), function.get(), NoExpectedFunction, callArguments, divot(), divotStart(), divotEnd());
678
    RegisterID* ret = generator.emitCall(returnValue.get(), function.get(), NoExpectedFunction, callArguments, divot(), divotStart(), divotEnd());
592
    if (generator.vm()->typeProfiler()) {
679
    if (generator.vm()->typeProfiler()) {
593
        generator.emitProfileType(returnValue.get(), ProfileTypeBytecodeDoesNotHaveGlobalID, nullptr);
680
        generator.emitProfileType(returnValue.get(), ProfileTypeBytecodeDoesNotHaveGlobalID, nullptr);
Lines 929-934 RegisterID* DeleteBracketNode::emitBytecode(BytecodeGenerator& generator, Regist a/Source/JavaScriptCore/bytecompiler/NodesCodegen.cpp_sec9
929
    RefPtr<RegisterID> r1 = generator.emitNode(m_subscript);
1016
    RefPtr<RegisterID> r1 = generator.emitNode(m_subscript);
930
1017
931
    generator.emitExpressionInfo(divot(), divotStart(), divotEnd());
1018
    generator.emitExpressionInfo(divot(), divotStart(), divotEnd());
1019
    if (m_base->isSuperNode())
1020
        return emitThrowReferenceError(generator, "Cannot delete a super property");
932
    return generator.emitDeleteByVal(generator.finalDestination(dst), r0.get(), r1.get());
1021
    return generator.emitDeleteByVal(generator.finalDestination(dst), r0.get(), r1.get());
933
}
1022
}
934
1023
Lines 939-944 RegisterID* DeleteDotNode::emitBytecode(BytecodeGenerator& generator, RegisterID a/Source/JavaScriptCore/bytecompiler/NodesCodegen.cpp_sec10
939
    RefPtr<RegisterID> r0 = generator.emitNode(m_base);
1028
    RefPtr<RegisterID> r0 = generator.emitNode(m_base);
940
1029
941
    generator.emitExpressionInfo(divot(), divotStart(), divotEnd());
1030
    generator.emitExpressionInfo(divot(), divotStart(), divotEnd());
1031
    if (m_base->isSuperNode())
1032
        return emitThrowReferenceError(generator, "Cannot delete a super property");
942
    return generator.emitDeleteById(generator.finalDestination(dst), r0.get(), m_ident);
1033
    return generator.emitDeleteById(generator.finalDestination(dst), r0.get(), m_ident);
943
}
1034
}
944
1035
Lines 2744-2750 RegisterID* FuncExprNode::emitBytecode(BytecodeGenerator& generator, RegisterID* a/Source/JavaScriptCore/bytecompiler/NodesCodegen.cpp_sec11
2744
{
2835
{
2745
    return generator.emitNewFunctionExpression(generator.finalDestination(dst), this);
2836
    return generator.emitNewFunctionExpression(generator.finalDestination(dst), this);
2746
}
2837
}
2747
    
2838
2839
// ------------------------------ ClassDeclNode ---------------------------------
2840
2841
void ClassDeclNode::emitBytecode(BytecodeGenerator& generator, RegisterID* dst)
2842
{
2843
    RefPtr<RegisterID> classHeritage;
2844
    if (m_parentClassExpression) {
2845
        classHeritage = generator.newTemporary();
2846
        generator.emitNode(classHeritage.get(), m_parentClassExpression);
2847
    }
2848
2849
    // FIXME: When base class' consturctor is never called, we need to return an "uninitialized" object.
2850
    RefPtr<RegisterID> constructor = generator.emitNode(dst, m_constructorDeclaration);
2851
    RefPtr<RegisterID> prototype = generator.emitGetById(generator.newTemporary(), constructor.get(), generator.propertyNames().prototype);
2852
    // ES6 draft doesn't store homeObject on the constructor but this would make supporting "new super" in constructor cumbersome.
2853
    emitPutHomeObject(generator, constructor.get(), prototype.get());
2854
    if (!classHeritage && !m_staticMethods && !m_instanceMethods)
2855
        return;
2856
2857
    if (classHeritage) {
2858
        RefPtr<RegisterID> protoParent = generator.newTemporary();
2859
        RefPtr<Label> classHeritageIsNull = generator.newLabel();
2860
        RefPtr<Label> protoParentIsSet = generator.newLabel();
2861
2862
        generator.emitJumpIfTrue(generator.emitUnaryOp(op_eq_null, protoParent.get(), classHeritage.get()), classHeritageIsNull.get());
2863
2864
        // FIXME: Throw TypeError if isConstructor(parentClass) is false or it's a generator function.
2865
        generator.emitGetById(protoParent.get(), classHeritage.get(), generator.vm()->propertyNames->prototype);
2866
        // FIXME: Throw TypeError if Type(protoParent) is not Object or null.
2867
2868
        generator.emitDirectPutById(prototype.get(), generator.propertyNames().underscoreProto, protoParent.get());
2869
        generator.emitJump(protoParentIsSet.get());
2870
2871
        generator.emitLabel(classHeritageIsNull.get());
2872
        generator.emitDirectPutById(prototype.get(), generator.propertyNames().underscoreProto, classHeritage.get());
2873
2874
        generator.emitLabel(protoParentIsSet.get());
2875
    }
2876
2877
    if (m_staticMethods)
2878
        generator.emitNode(constructor.get(), m_staticMethods);
2879
2880
    if (m_instanceMethods)
2881
        generator.emitNode(prototype.get(), m_instanceMethods);
2882
}
2883
2748
// ------------------------------ DeconstructingAssignmentNode -----------------
2884
// ------------------------------ DeconstructingAssignmentNode -----------------
2749
RegisterID* DeconstructingAssignmentNode::emitBytecode(BytecodeGenerator& generator, RegisterID* dst)
2885
RegisterID* DeconstructingAssignmentNode::emitBytecode(BytecodeGenerator& generator, RegisterID* dst)
2750
{
2886
{
- a/Source/JavaScriptCore/parser/ASTBuilder.h -18 / +57 lines
Lines 166-171 public: a/Source/JavaScriptCore/parser/ASTBuilder.h_sec1
166
        usesThis();
166
        usesThis();
167
        return new (m_parserArena) ThisNode(location);
167
        return new (m_parserArena) ThisNode(location);
168
    }
168
    }
169
    ExpressionNode* superExpr(const JSTokenLocation& location)
170
    {
171
        // FIXME: Add and call usesSuper();
172
        return new (m_parserArena) SuperNode(location);
173
    }
174
    ExpressionNode* createSuperCall(const JSTokenLocation& location, ArgumentsNode* arguments, const JSTextPosition& start, const JSTextPosition& divot, const JSTextPosition& end)
175
    {
176
        UNUSED_PARAM(arguments);
177
        UNUSED_PARAM(start);
178
        UNUSED_PARAM(divot);
179
        UNUSED_PARAM(end);
180
        return new (m_parserArena) SuperNode(location);
181
    }
182
    ExpressionNode* createSuperBracketAccess(const JSTokenLocation& location, ExpressionNode* property, const JSTextPosition& start, const JSTextPosition& divot, const JSTextPosition& end)
183
    {
184
        UNUSED_PARAM(property);
185
        UNUSED_PARAM(start);
186
        UNUSED_PARAM(divot);
187
        UNUSED_PARAM(end);
188
        return new (m_parserArena) SuperBracketAccessorNode(location, property);
189
    }
190
    ExpressionNode* createSuperDotAccess(const JSTokenLocation& location, const Identifier* property, const JSTextPosition& start, const JSTextPosition& divot, const JSTextPosition& end)
191
    {
192
        UNUSED_PARAM(start);
193
        UNUSED_PARAM(divot);
194
        UNUSED_PARAM(end);
195
        return new (m_parserArena) SuperDotAccessorNode(location, *property);
196
    }
169
    ExpressionNode* createResolve(const JSTokenLocation& location, const Identifier* ident, const JSTextPosition& start)
197
    ExpressionNode* createResolve(const JSTokenLocation& location, const Identifier* ident, const JSTextPosition& start)
170
    {
198
    {
171
        if (m_vm->propertyNames->arguments == *ident)
199
        if (m_vm->propertyNames->arguments == *ident)
Lines 273-283 public: a/Source/JavaScriptCore/parser/ASTBuilder.h_sec2
273
        return node;
301
        return node;
274
    }
302
    }
275
303
276
    ExpressionNode* createFunctionExpr(const JSTokenLocation& location, const Identifier* name, FunctionBodyNode* body, ParameterNode* parameters, unsigned openBraceOffset, unsigned closeBraceOffset, int bodyStartLine, int bodyEndLine, unsigned startColumn, unsigned functionKeywordStart)
304
    ExpressionNode* createFunctionExpr(const JSTokenLocation& location, const ParserFunctionInfo<ASTBuilder>& info, unsigned functionKeywordStart)
277
    {
305
    {
278
        FuncExprNode* result = new (m_parserArena) FuncExprNode(location, *name, body, m_sourceCode->subExpression(openBraceOffset, closeBraceOffset, bodyStartLine, startColumn), parameters);
306
        FuncExprNode* result = new (m_parserArena) FuncExprNode(location, *info.name, info.body,
279
        body->setLoc(bodyStartLine, bodyEndLine, location.startOffset, location.lineStartOffset);
307
            m_sourceCode->subExpression(info.openBraceOffset, info.closeBraceOffset, info.bodyStartLine, info.bodyStartColumn), info.parameters);
280
        body->setFunctionKeywordStart(functionKeywordStart);
308
        info.body->setLoc(info.bodyStartLine, info.bodyEndLine, location.startOffset, location.lineStartOffset);
309
        info.body->setFunctionKeywordStart(functionKeywordStart);
281
        return result;
310
        return result;
282
    }
311
    }
283
312
Lines 291-310 public: a/Source/JavaScriptCore/parser/ASTBuilder.h_sec3
291
        body->setFunctionNameStart(functionNameStart);
320
        body->setFunctionNameStart(functionNameStart);
292
    }
321
    }
293
    
322
    
294
    NEVER_INLINE PropertyNode* createGetterOrSetterProperty(const JSTokenLocation& location, PropertyNode::Type type, bool, const Identifier* name, ParameterNode* params, FunctionBodyNode* body, unsigned openBraceOffset, unsigned closeBraceOffset, int bodyStartLine, int bodyEndLine, unsigned bodyStartColumn, unsigned getOrSetStartOffset)
323
    NEVER_INLINE PropertyNode* createGetterOrSetterProperty(const JSTokenLocation& location, PropertyNode::Type type, bool,
324
        const Identifier* name, const ParserFunctionInfo<ASTBuilder>& info, unsigned getOrSetStartOffset)
295
    {
325
    {
296
        ASSERT(name);
326
        ASSERT(name);
297
        body->setLoc(bodyStartLine, bodyEndLine, location.startOffset, location.lineStartOffset);
327
        info.body->setLoc(info.bodyStartLine, info.bodyEndLine, location.startOffset, location.lineStartOffset);
298
        body->setInferredName(*name);
328
        info.body->setInferredName(*name);
299
        body->setFunctionKeywordStart(getOrSetStartOffset);
329
        info.body->setFunctionKeywordStart(getOrSetStartOffset);
300
        return new (m_parserArena) PropertyNode(*name, new (m_parserArena) FuncExprNode(location, m_vm->propertyNames->nullIdentifier, body, m_sourceCode->subExpression(openBraceOffset, closeBraceOffset, bodyStartLine, bodyStartColumn), params), type);
330
        return new (m_parserArena) PropertyNode(*name, new (m_parserArena) FuncExprNode(location, m_vm->propertyNames->nullIdentifier, info.body, m_sourceCode->subExpression(info.openBraceOffset, info.closeBraceOffset, info.bodyStartLine, info.bodyStartColumn), info.parameters), type);
301
    }
331
    }
302
    
332
    
303
    NEVER_INLINE PropertyNode* createGetterOrSetterProperty(VM* vm, ParserArena& parserArena, const JSTokenLocation& location, PropertyNode::Type type, bool, double name, ParameterNode* params, FunctionBodyNode* body, unsigned openBraceOffset, unsigned closeBraceOffset, int bodyStartLine, int bodyEndLine, unsigned bodyStartColumn, unsigned getOrSetStartOffset)
333
    NEVER_INLINE PropertyNode* createGetterOrSetterProperty(VM* vm, ParserArena& parserArena, const JSTokenLocation& location, PropertyNode::Type type, bool, double name, const ParserFunctionInfo<ASTBuilder>& info, unsigned getOrSetStartOffset)
304
    {
334
    {
305
        body->setLoc(bodyStartLine, bodyEndLine, location.startOffset, location.lineStartOffset);
335
        info.body->setLoc(info.bodyStartLine, info.bodyEndLine, location.startOffset, location.lineStartOffset);
306
        body->setFunctionKeywordStart(getOrSetStartOffset);
336
        info.body->setFunctionKeywordStart(getOrSetStartOffset);
307
        return new (m_parserArena) PropertyNode(parserArena.identifierArena().makeNumericIdentifier(vm, name), new (m_parserArena) FuncExprNode(location, vm->propertyNames->nullIdentifier, body, m_sourceCode->subExpression(openBraceOffset, closeBraceOffset, bodyStartLine, bodyStartColumn), params), type);
337
        return new (m_parserArena) PropertyNode(parserArena.identifierArena().makeNumericIdentifier(vm, name), new (m_parserArena) FuncExprNode(location, vm->propertyNames->nullIdentifier, info.body, m_sourceCode->subExpression(info.openBraceOffset, info.closeBraceOffset, info.bodyStartLine, info.bodyStartColumn), info.parameters), type);
308
    }
338
    }
309
339
310
    ArgumentsNode* createArguments() { return new (m_parserArena) ArgumentsNode(); }
340
    ArgumentsNode* createArguments() { return new (m_parserArena) ArgumentsNode(); }
Lines 336-349 public: a/Source/JavaScriptCore/parser/ASTBuilder.h_sec4
336
    ClauseListNode* createClauseList(CaseClauseNode* clause) { return new (m_parserArena) ClauseListNode(clause); }
366
    ClauseListNode* createClauseList(CaseClauseNode* clause) { return new (m_parserArena) ClauseListNode(clause); }
337
    ClauseListNode* createClauseList(ClauseListNode* tail, CaseClauseNode* clause) { return new (m_parserArena) ClauseListNode(tail, clause); }
367
    ClauseListNode* createClauseList(ClauseListNode* tail, CaseClauseNode* clause) { return new (m_parserArena) ClauseListNode(tail, clause); }
338
368
339
    StatementNode* createFuncDeclStatement(const JSTokenLocation& location, const Identifier* name, FunctionBodyNode* body, ParameterNode* parameters, unsigned openBraceOffset, unsigned closeBraceOffset, int bodyStartLine, int bodyEndLine, unsigned bodyStartColumn, unsigned functionKeywordStart)
369
    StatementNode* createFuncDeclStatement(const JSTokenLocation& location, const ParserFunctionInfo<ASTBuilder>& info, unsigned functionKeywordStart)
340
    {
370
    {
341
        FuncDeclNode* decl = new (m_parserArena) FuncDeclNode(location, *name, body, m_sourceCode->subExpression(openBraceOffset, closeBraceOffset, bodyStartLine, bodyStartColumn), parameters);
371
        FuncDeclNode* decl = new (m_parserArena) FuncDeclNode(location, *info.name, info.body,
342
        if (*name == m_vm->propertyNames->arguments)
372
            m_sourceCode->subExpression(info.openBraceOffset, info.closeBraceOffset, info.bodyStartLine, info.bodyStartColumn), info.parameters);
373
        if (*info.name == m_vm->propertyNames->arguments)
343
            usesArguments();
374
            usesArguments();
344
        m_scope.m_funcDeclarations.append(decl->body());
375
        m_scope.m_funcDeclarations.append(decl->body());
345
        body->setLoc(bodyStartLine, bodyEndLine, location.startOffset, location.lineStartOffset);
376
        info.body->setLoc(info.bodyStartLine, info.bodyEndLine, location.startOffset, location.lineStartOffset);
346
        body->setFunctionKeywordStart(functionKeywordStart);
377
        info.body->setFunctionKeywordStart(functionKeywordStart);
378
        return decl;
379
    }
380
381
    StatementNode* createClassDeclStatement(const JSTokenLocation& location, const Identifier& name, ExpressionNode* constructorDeclaration,
382
        ExpressionNode* parentClassExpression, PropertyListNode* instanceMethods, PropertyListNode* staticMethods, int startLine, int endLine)
383
    {
384
        ClassDeclNode* decl = new (m_parserArena) ClassDeclNode(location, name, constructorDeclaration, parentClassExpression, instanceMethods, staticMethods);
385
        decl->setLoc(startLine, endLine, location.startOffset, location.lineStartOffset);
347
        return decl;
386
        return decl;
348
    }
387
    }
349
388
- a/Source/JavaScriptCore/parser/Keywords.table -4 / +4 lines
Lines 10-17 false FALSETOKEN a/Source/JavaScriptCore/parser/Keywords.table_sec1
10
break		BREAK
10
break		BREAK
11
case		CASE
11
case		CASE
12
catch		CATCH
12
catch		CATCH
13
class		CLASSTOKEN
13
const		CONSTTOKEN
14
const		CONSTTOKEN
14
default		DEFAULT
15
default		DEFAULT
16
extends		EXTENDS
15
finally		FINALLY
17
finally		FINALLY
16
for		FOR
18
for		FOR
17
instanceof	INSTANCEOF
19
instanceof	INSTANCEOF
Lines 28-33 do DO a/Source/JavaScriptCore/parser/Keywords.table_sec2
28
while		WHILE
30
while		WHILE
29
else		ELSE
31
else		ELSE
30
in		INTOKEN
32
in		INTOKEN
33
static		STATICTOKEN
34
super           SUPER
31
switch		SWITCH
35
switch		SWITCH
32
throw		THROW
36
throw		THROW
33
try		TRY
37
try		TRY
Lines 36-47 with WITH a/Source/JavaScriptCore/parser/Keywords.table_sec3
36
debugger	DEBUGGER
40
debugger	DEBUGGER
37
41
38
# Reserved for future use.
42
# Reserved for future use.
39
class           RESERVED
40
enum            RESERVED
43
enum            RESERVED
41
export          RESERVED
44
export          RESERVED
42
extends         RESERVED
43
import          RESERVED
45
import          RESERVED
44
super           RESERVED
45
46
46
# Reserved for future use in strict code.
47
# Reserved for future use in strict code.
47
implements      RESERVED_IF_STRICT
48
implements      RESERVED_IF_STRICT
Lines 51-57 package RESERVED_IF_STRICT a/Source/JavaScriptCore/parser/Keywords.table_sec4
51
private         RESERVED_IF_STRICT
52
private         RESERVED_IF_STRICT
52
protected       RESERVED_IF_STRICT
53
protected       RESERVED_IF_STRICT
53
public          RESERVED_IF_STRICT
54
public          RESERVED_IF_STRICT
54
static          RESERVED_IF_STRICT
55
yield           RESERVED_IF_STRICT
55
yield           RESERVED_IF_STRICT
56
56
57
@end
57
@end
- a/Source/JavaScriptCore/parser/NodeConstructors.h +32 lines
Lines 102-107 namespace JSC { a/Source/JavaScriptCore/parser/NodeConstructors.h_sec1
102
    {
102
    {
103
    }
103
    }
104
104
105
    inline SuperNode::SuperNode(const JSTokenLocation& location)
106
        : ExpressionNode(location)
107
    {
108
    }
109
110
    inline SuperBracketAccessorNode::SuperBracketAccessorNode(const JSTokenLocation& location, ExpressionNode* subscript)
111
        : ExpressionNode(location)
112
        , m_subscript(subscript)
113
    {
114
    }
115
116
    inline SuperDotAccessorNode::SuperDotAccessorNode(const JSTokenLocation& location, const Identifier& ident)
117
        : ExpressionNode(location)
118
        , m_ident(ident)
119
    {
120
    }
121
105
inline ResolveNode::ResolveNode(const JSTokenLocation& location, const Identifier& ident, const JSTextPosition& start)
122
inline ResolveNode::ResolveNode(const JSTokenLocation& location, const Identifier& ident, const JSTextPosition& start)
106
        : ExpressionNode(location)
123
        : ExpressionNode(location)
107
        , m_ident(ident)
124
        , m_ident(ident)
Lines 168-173 inline ResolveNode::ResolveNode(const JSTokenLocation& location, const Identifie a/Source/JavaScriptCore/parser/NodeConstructors.h_sec2
168
        : ExpressionNode(location)
185
        : ExpressionNode(location)
169
        , m_node(node)
186
        , m_node(node)
170
        , m_next(0)
187
        , m_next(0)
188
        , m_isMethodList(false)
171
    {
189
    {
172
    }
190
    }
173
191
Lines 175-180 inline ResolveNode::ResolveNode(const JSTokenLocation& location, const Identifie a/Source/JavaScriptCore/parser/NodeConstructors.h_sec3
175
        : ExpressionNode(location)
193
        : ExpressionNode(location)
176
        , m_node(node)
194
        , m_node(node)
177
        , m_next(0)
195
        , m_next(0)
196
        , m_isMethodList(false)
178
    {
197
    {
179
        list->m_next = this;
198
        list->m_next = this;
180
    }
199
    }
Lines 768-773 inline ResolveNode::ResolveNode(const JSTokenLocation& location, const Identifie a/Source/JavaScriptCore/parser/NodeConstructors.h_sec4
768
        m_body->finishParsing(source, parameter, ident, FunctionDeclaration);
787
        m_body->finishParsing(source, parameter, ident, FunctionDeclaration);
769
    }
788
    }
770
789
790
    inline ClassDeclNode::ClassDeclNode(const JSTokenLocation& location, const Identifier& name, ExpressionNode* constructorDeclaration,
791
        ExpressionNode* parentClassExpression, PropertyListNode* instanceMethods, PropertyListNode* staticMethods)
792
        : StatementNode(location)
793
        , m_name(name)
794
        , m_constructorDeclaration(constructorDeclaration)
795
        , m_parentClassExpression(parentClassExpression)
796
        , m_instanceMethods(instanceMethods)
797
        , m_staticMethods(staticMethods)
798
    {
799
        if (instanceMethods)
800
            instanceMethods->setIsMethodList();
801
    }
802
771
    inline CaseClauseNode::CaseClauseNode(ExpressionNode* expr, SourceElements* statements)
803
    inline CaseClauseNode::CaseClauseNode(ExpressionNode* expr, SourceElements* statements)
772
        : m_expr(expr)
804
        : m_expr(expr)
773
        , m_statements(statements)
805
        , m_statements(statements)
- a/Source/JavaScriptCore/parser/Nodes.h +51 lines
Lines 163-168 namespace JSC { a/Source/JavaScriptCore/parser/Nodes.h_sec1
163
        virtual bool isSubtract() const { return false; }
163
        virtual bool isSubtract() const { return false; }
164
        virtual bool isBoolean() const { return false; }
164
        virtual bool isBoolean() const { return false; }
165
        virtual bool isSpreadExpression() const { return false; }
165
        virtual bool isSpreadExpression() const { return false; }
166
        virtual bool isSuperNode() const { return false; }
166
167
167
        virtual void emitBytecodeInConditionContext(BytecodeGenerator&, Label*, Label*, FallThroughMode);
168
        virtual void emitBytecodeInConditionContext(BytecodeGenerator&, Label*, Label*, FallThroughMode);
168
169
Lines 428-433 namespace JSC { a/Source/JavaScriptCore/parser/Nodes.h_sec2
428
        virtual RegisterID* emitBytecode(BytecodeGenerator&, RegisterID* = 0) override;
429
        virtual RegisterID* emitBytecode(BytecodeGenerator&, RegisterID* = 0) override;
429
    };
430
    };
430
431
432
    class SuperNode final : public ExpressionNode {
433
    public:
434
        SuperNode(const JSTokenLocation&);
435
436
    private:
437
        virtual bool isSuperNode() const override { return true; }
438
        virtual RegisterID* emitBytecode(BytecodeGenerator&, RegisterID* = 0) override;
439
    };
440
441
    class SuperBracketAccessorNode final : public ExpressionNode {
442
    public:
443
        SuperBracketAccessorNode(const JSTokenLocation&, ExpressionNode* subscript);
444
445
    private:
446
        virtual RegisterID* emitBytecode(BytecodeGenerator&, RegisterID* = 0) override;
447
448
        ExpressionNode* m_subscript;
449
    };
450
451
    class SuperDotAccessorNode final : public ExpressionNode {
452
    public:
453
        SuperDotAccessorNode(const JSTokenLocation&, const Identifier&);
454
455
    private:
456
        virtual RegisterID* emitBytecode(BytecodeGenerator&, RegisterID* = 0) override;
457
458
        const Identifier& m_ident;
459
    };
460
431
    class ResolveNode : public ExpressionNode {
461
    class ResolveNode : public ExpressionNode {
432
    public:
462
    public:
433
        ResolveNode(const JSTokenLocation&, const Identifier&, const JSTextPosition& start);
463
        ResolveNode(const JSTokenLocation&, const Identifier&, const JSTextPosition& start);
Lines 504-514 namespace JSC { a/Source/JavaScriptCore/parser/Nodes.h_sec3
504
        PropertyListNode(const JSTokenLocation&, PropertyNode*);
534
        PropertyListNode(const JSTokenLocation&, PropertyNode*);
505
        PropertyListNode(const JSTokenLocation&, PropertyNode*, PropertyListNode*);
535
        PropertyListNode(const JSTokenLocation&, PropertyNode*, PropertyListNode*);
506
536
537
        void setIsMethodList() { m_isMethodList = true; }
538
507
        virtual RegisterID* emitBytecode(BytecodeGenerator&, RegisterID* = 0) override;
539
        virtual RegisterID* emitBytecode(BytecodeGenerator&, RegisterID* = 0) override;
508
540
509
    private:
541
    private:
542
        void emitConstantProperty(BytecodeGenerator&, RegisterID*, PropertyNode*);
543
510
        PropertyNode* m_node;
544
        PropertyNode* m_node;
511
        PropertyListNode* m_next;
545
        PropertyListNode* m_next;
546
        bool m_isMethodList;
512
    };
547
    };
513
548
514
    class ObjectLiteralNode : public ExpressionNode {
549
    class ObjectLiteralNode : public ExpressionNode {
Lines 1723-1728 namespace JSC { a/Source/JavaScriptCore/parser/Nodes.h_sec4
1723
        FunctionBodyNode* m_body;
1758
        FunctionBodyNode* m_body;
1724
    };
1759
    };
1725
1760
1761
    // FIXME: We should inherit from ThrowableExpressionData.
1762
    class ClassDeclNode final : public StatementNode {
1763
    public:
1764
        ClassDeclNode(const JSTokenLocation&, const Identifier&, ExpressionNode* constructorDeclaration,
1765
            ExpressionNode* parentClass, PropertyListNode* instanceMethods, PropertyListNode* staticMethods);
1766
1767
    private:
1768
        virtual void emitBytecode(BytecodeGenerator&, RegisterID* = 0) override;
1769
1770
        Identifier m_name;
1771
        ExpressionNode* m_constructorDeclaration;
1772
        ExpressionNode* m_parentClassExpression;
1773
        PropertyListNode* m_instanceMethods;
1774
        PropertyListNode* m_staticMethods;
1775
    };
1776
1726
    class CaseClauseNode : public ParserArenaFreeable {
1777
    class CaseClauseNode : public ParserArenaFreeable {
1727
    public:
1778
    public:
1728
        CaseClauseNode(ExpressionNode*, SourceElements* = 0);
1779
        CaseClauseNode(ExpressionNode*, SourceElements* = 0);
- a/Source/JavaScriptCore/parser/Parser.cpp -58 / +169 lines
Lines 1150-1155 template <class TreeBuilder> TreeStatement Parser<LexerType>::parseStatement(Tre a/Source/JavaScriptCore/parser/Parser.cpp_sec1
1150
    case CONSTTOKEN:
1150
    case CONSTTOKEN:
1151
        result = parseConstDeclaration(context);
1151
        result = parseConstDeclaration(context);
1152
        break;
1152
        break;
1153
    case CLASSTOKEN:
1154
        failIfFalse(m_statementDepth == 1, "Class declaration is not allowed in a lexically nested statement");
1155
        result = parseClassDeclaration(context);
1156
        break;
1153
    case FUNCTION:
1157
    case FUNCTION:
1154
        failIfFalseIfStrict(m_statementDepth == 1, "Strict mode does not allow function declarations in a lexically nested statement");
1158
        failIfFalseIfStrict(m_statementDepth == 1, "Strict mode does not allow function declarations in a lexically nested statement");
1155
        result = parseFunctionDeclaration(context);
1159
        result = parseFunctionDeclaration(context);
Lines 1267-1279 static const char* stringForFunctionMode(FunctionParseMode mode) a/Source/JavaScriptCore/parser/Parser.cpp_sec2
1267
        return "setter";
1271
        return "setter";
1268
    case FunctionMode:
1272
    case FunctionMode:
1269
        return "function";
1273
        return "function";
1274
    case MethodMode:
1275
        return "method";
1270
    }
1276
    }
1271
    RELEASE_ASSERT_NOT_REACHED();
1277
    RELEASE_ASSERT_NOT_REACHED();
1272
    return nullptr;
1278
    return nullptr;
1273
}
1279
}
1274
1280
1275
template <typename LexerType>
1281
template <typename LexerType>
1276
template <class TreeBuilder> bool Parser<LexerType>::parseFunctionInfo(TreeBuilder& context, FunctionRequirements requirements, FunctionParseMode mode, bool nameIsInContainingScope, const Identifier*& name, TreeFormalParameterList& parameters, TreeFunctionBody& body, unsigned& openBraceOffset, unsigned& closeBraceOffset, int& bodyStartLine, unsigned& bodyStartColumn)
1282
template <class TreeBuilder> bool Parser<LexerType>::parseFunctionInfo(TreeBuilder& context, FunctionRequirements requirements, FunctionParseMode mode, bool nameIsInContainingScope, ParserFunctionInfo<TreeBuilder>& info)
1277
{
1283
{
1278
    AutoPopScopeRef functionScope(this, pushScope());
1284
    AutoPopScopeRef functionScope(this, pushScope());
1279
    functionScope->setIsFunction();
1285
    functionScope->setIsFunction();
Lines 1281-1294 template <class TreeBuilder> bool Parser<LexerType>::parseFunctionInfo(TreeBuild a/Source/JavaScriptCore/parser/Parser.cpp_sec3
1281
    const Identifier* lastFunctionName = m_lastFunctionName;
1287
    const Identifier* lastFunctionName = m_lastFunctionName;
1282
    m_lastFunctionName = nullptr;
1288
    m_lastFunctionName = nullptr;
1283
    if (match(IDENT)) {
1289
    if (match(IDENT)) {
1284
        name = m_token.m_data.ident;
1290
        info.name = m_token.m_data.ident;
1285
        m_lastFunctionName = name;
1291
        m_lastFunctionName = info.name;
1286
        next();
1292
        next();
1287
        if (!nameIsInContainingScope)
1293
        if (!nameIsInContainingScope)
1288
            failIfFalseIfStrict(functionScope->declareVariable(name), "'", name->impl(), "' is not a valid ", stringForFunctionMode(mode), " name in strict mode");
1294
            failIfFalseIfStrict(functionScope->declareVariable(info.name), "'", info.name->impl(), "' is not a valid ", stringForFunctionMode(mode), " name in strict mode");
1289
    } else if (requirements == FunctionNeedsName) {
1295
    } else if (requirements == FunctionNeedsName) {
1290
        if (match(OPENPAREN) && mode == FunctionMode)
1296
        if (match(OPENPAREN) && mode == FunctionMode)
1291
            semanticFail("Function statements must have a name");
1297
            semanticFail(stringForFunctionMode(mode), " must have a name");
1292
        semanticFailureDueToKeyword(stringForFunctionMode(mode), " name");
1298
        semanticFailureDueToKeyword(stringForFunctionMode(mode), " name");
1293
        failDueToUnexpectedToken();
1299
        failDueToUnexpectedToken();
1294
        return false;
1300
        return false;
Lines 1298-1316 template <class TreeBuilder> bool Parser<LexerType>::parseFunctionInfo(TreeBuild a/Source/JavaScriptCore/parser/Parser.cpp_sec4
1298
        failWithMessage("Expected an opening '(' before a ", stringForFunctionMode(mode), "'s parameter list");
1304
        failWithMessage("Expected an opening '(' before a ", stringForFunctionMode(mode), "'s parameter list");
1299
    }
1305
    }
1300
    if (!match(CLOSEPAREN)) {
1306
    if (!match(CLOSEPAREN)) {
1301
        parameters = parseFormalParameters(context);
1307
        info.parameters = parseFormalParameters(context);
1302
        failIfFalse(parameters, "Cannot parse parameters for this ", stringForFunctionMode(mode));
1308
        failIfFalse(info.parameters, "Cannot parse parameters for this ", stringForFunctionMode(mode));
1303
    }
1309
    }
1304
    consumeOrFail(CLOSEPAREN, "Expected a ')' or a ',' after a parameter declaration");
1310
    consumeOrFail(CLOSEPAREN, "Expected a ')' or a ',' after a parameter declaration");
1305
    matchOrFail(OPENBRACE, "Expected an opening '{' at the start of a ", stringForFunctionMode(mode), " body");
1311
    matchOrFail(OPENBRACE, "Expected an opening '{' at the start of a ", stringForFunctionMode(mode), " body");
1306
    
1312
    
1307
    openBraceOffset = m_token.m_data.offset;
1313
    info.openBraceOffset = m_token.m_data.offset;
1308
    bodyStartLine = tokenLine();
1314
    info.bodyStartLine = tokenLine();
1309
    bodyStartColumn = m_token.m_data.offset - m_token.m_data.lineStartOffset;
1315
    info.bodyStartColumn = m_token.m_data.offset - m_token.m_data.lineStartOffset;
1310
    JSTokenLocation startLocation(tokenLocation());
1316
    JSTokenLocation startLocation(tokenLocation());
1311
    
1317
    
1312
    // If we know about this function already, we can use the cached info and skip the parser to the end of the function.
1318
    // If we know about this function already, we can use the cached info and skip the parser to the end of the function.
1313
    if (const SourceProviderCacheItem* cachedInfo = TreeBuilder::CanUseFunctionCache ? findCachedFunctionInfo(openBraceOffset) : 0) {
1319
    if (const SourceProviderCacheItem* cachedInfo = TreeBuilder::CanUseFunctionCache ? findCachedFunctionInfo(info.openBraceOffset) : 0) {
1314
        // If we're in a strict context, the cached function info must say it was strict too.
1320
        // If we're in a strict context, the cached function info must say it was strict too.
1315
        ASSERT(!strictMode() || cachedInfo->strictMode);
1321
        ASSERT(!strictMode() || cachedInfo->strictMode);
1316
        JSTokenLocation endLocation;
1322
        JSTokenLocation endLocation;
Lines 1319-1339 template <class TreeBuilder> bool Parser<LexerType>::parseFunctionInfo(TreeBuild a/Source/JavaScriptCore/parser/Parser.cpp_sec5
1319
        endLocation.startOffset = cachedInfo->closeBraceOffset;
1325
        endLocation.startOffset = cachedInfo->closeBraceOffset;
1320
        endLocation.lineStartOffset = cachedInfo->closeBraceLineStartOffset;
1326
        endLocation.lineStartOffset = cachedInfo->closeBraceLineStartOffset;
1321
1327
1322
        bool endColumnIsOnStartLine = (endLocation.line == bodyStartLine);
1328
        bool endColumnIsOnStartLine = (endLocation.line == info.bodyStartLine);
1323
        ASSERT(endLocation.startOffset >= endLocation.lineStartOffset);
1329
        ASSERT(endLocation.startOffset >= endLocation.lineStartOffset);
1324
        unsigned bodyEndColumn = endColumnIsOnStartLine ?
1330
        unsigned bodyEndColumn = endColumnIsOnStartLine ?
1325
            endLocation.startOffset - m_token.m_data.lineStartOffset :
1331
            endLocation.startOffset - m_token.m_data.lineStartOffset :
1326
            endLocation.startOffset - endLocation.lineStartOffset;
1332
            endLocation.startOffset - endLocation.lineStartOffset;
1327
        unsigned currentLineStartOffset = m_token.m_location.lineStartOffset;
1333
        unsigned currentLineStartOffset = m_token.m_location.lineStartOffset;
1328
1334
1329
        body = context.createFunctionBody(startLocation, endLocation, bodyStartColumn, bodyEndColumn, cachedInfo->strictMode);
1335
        info.body = context.createFunctionBody(startLocation, endLocation, info.bodyStartColumn, bodyEndColumn, cachedInfo->strictMode);
1330
        
1336
        
1331
        functionScope->restoreFromSourceProviderCache(cachedInfo);
1337
        functionScope->restoreFromSourceProviderCache(cachedInfo);
1332
        failIfFalse(popScope(functionScope, TreeBuilder::NeedsFreeVariableInfo), "Parser error");
1338
        failIfFalse(popScope(functionScope, TreeBuilder::NeedsFreeVariableInfo), "Parser error");
1333
        
1339
        
1334
        closeBraceOffset = cachedInfo->closeBraceOffset;
1340
        info.closeBraceOffset = cachedInfo->closeBraceOffset;
1335
1341
1336
        context.setFunctionNameStart(body, functionNameStart);
1342
        context.setFunctionNameStart(info.body, functionNameStart);
1337
        m_token = cachedInfo->closeBraceToken();
1343
        m_token = cachedInfo->closeBraceToken();
1338
        if (endColumnIsOnStartLine)
1344
        if (endColumnIsOnStartLine)
1339
            m_token.m_location.lineStartOffset = currentLineStartOffset;
1345
            m_token.m_location.lineStartOffset = currentLineStartOffset;
Lines 1341-1363 template <class TreeBuilder> bool Parser<LexerType>::parseFunctionInfo(TreeBuild a/Source/JavaScriptCore/parser/Parser.cpp_sec6
1341
        m_lexer->setOffset(m_token.m_location.endOffset, m_token.m_location.lineStartOffset);
1347
        m_lexer->setOffset(m_token.m_location.endOffset, m_token.m_location.lineStartOffset);
1342
        m_lexer->setLineNumber(m_token.m_location.line);
1348
        m_lexer->setLineNumber(m_token.m_location.line);
1343
1349
1344
        context.setEndOffset(body, m_lexer->currentOffset());
1350
        context.setEndOffset(info.body, m_lexer->currentOffset());
1345
        
1351
        
1346
        next();
1352
        next();
1353
        info.bodyEndLine = m_lastTokenEndPosition.line;
1347
        return true;
1354
        return true;
1348
    }
1355
    }
1349
    m_lastFunctionName = lastFunctionName;
1356
    m_lastFunctionName = lastFunctionName;
1350
    ParserState oldState = saveState();
1357
    ParserState oldState = saveState();
1351
    body = parseFunctionBody(context);
1358
    info.body = parseFunctionBody(context);
1352
    restoreState(oldState);
1359
    restoreState(oldState);
1353
    failIfFalse(body, "Cannot parse the body of this ", stringForFunctionMode(mode));
1360
    failIfFalse(info.body, "Cannot parse the body of this ", stringForFunctionMode(mode));
1354
    context.setEndOffset(body, m_lexer->currentOffset());
1361
    context.setEndOffset(info.body, m_lexer->currentOffset());
1355
    if (functionScope->strictMode() && name) {
1362
    if (functionScope->strictMode() && info.name) {
1356
        RELEASE_ASSERT(mode == FunctionMode);
1363
        RELEASE_ASSERT(mode == FunctionMode);
1357
        semanticFailIfTrue(m_vm->propertyNames->arguments == *name, "'", name->impl(), "' is not a valid function name in strict mode");
1364
        semanticFailIfTrue(m_vm->propertyNames->arguments == *info.name, "'", info.name->impl(), "' is not a valid function name in strict mode");
1358
        semanticFailIfTrue(m_vm->propertyNames->eval == *name, "'", name->impl(), "' is not a valid function name in strict mode");
1365
        semanticFailIfTrue(m_vm->propertyNames->eval == *info.name, "'", info.name->impl(), "' is not a valid function name in strict mode");
1359
    }
1366
    }
1360
    closeBraceOffset = m_token.m_data.offset;
1367
    info.closeBraceOffset = m_token.m_data.offset;
1361
    unsigned closeBraceLine = m_token.m_data.line;
1368
    unsigned closeBraceLine = m_token.m_data.line;
1362
    unsigned closeBraceLineStartOffset = m_token.m_data.lineStartOffset;
1369
    unsigned closeBraceLineStartOffset = m_token.m_data.lineStartOffset;
1363
    
1370
    
Lines 1365-1390 template <class TreeBuilder> bool Parser<LexerType>::parseFunctionInfo(TreeBuild a/Source/JavaScriptCore/parser/Parser.cpp_sec7
1365
    // Any future reparsing can then skip the function.
1372
    // Any future reparsing can then skip the function.
1366
    static const int minimumFunctionLengthToCache = 16;
1373
    static const int minimumFunctionLengthToCache = 16;
1367
    std::unique_ptr<SourceProviderCacheItem> newInfo;
1374
    std::unique_ptr<SourceProviderCacheItem> newInfo;
1368
    int functionLength = closeBraceOffset - openBraceOffset;
1375
    int functionLength = info.closeBraceOffset - info.openBraceOffset;
1369
    if (TreeBuilder::CanUseFunctionCache && m_functionCache && functionLength > minimumFunctionLengthToCache) {
1376
    if (TreeBuilder::CanUseFunctionCache && m_functionCache && functionLength > minimumFunctionLengthToCache) {
1370
        SourceProviderCacheItemCreationParameters parameters;
1377
        SourceProviderCacheItemCreationParameters parameters;
1371
        parameters.functionNameStart = functionNameStart;
1378
        parameters.functionNameStart = functionNameStart;
1372
        parameters.closeBraceLine = closeBraceLine;
1379
        parameters.closeBraceLine = closeBraceLine;
1373
        parameters.closeBraceOffset = closeBraceOffset;
1380
        parameters.closeBraceOffset = info.closeBraceOffset;
1374
        parameters.closeBraceLineStartOffset = closeBraceLineStartOffset;
1381
        parameters.closeBraceLineStartOffset = closeBraceLineStartOffset;
1375
        functionScope->fillParametersForSourceProviderCache(parameters);
1382
        functionScope->fillParametersForSourceProviderCache(parameters);
1376
        newInfo = SourceProviderCacheItem::create(parameters);
1383
        newInfo = SourceProviderCacheItem::create(parameters);
1377
1384
1378
    }
1385
    }
1379
    context.setFunctionNameStart(body, functionNameStart);
1386
    context.setFunctionNameStart(info.body, functionNameStart);
1380
    
1387
    
1381
    failIfFalse(popScope(functionScope, TreeBuilder::NeedsFreeVariableInfo), "Parser error");
1388
    failIfFalse(popScope(functionScope, TreeBuilder::NeedsFreeVariableInfo), "Parser error");
1382
    matchOrFail(CLOSEBRACE, "Expected a closing '}' after a ", stringForFunctionMode(mode), " body");
1389
    matchOrFail(CLOSEBRACE, "Expected a closing '}' after a ", stringForFunctionMode(mode), " body");
1383
    
1390
    
1384
    if (newInfo)
1391
    if (newInfo)
1385
        m_functionCache->add(openBraceOffset, WTF::move(newInfo));
1392
        m_functionCache->add(info.openBraceOffset, WTF::move(newInfo));
1386
    
1393
    
1387
    next();
1394
    next();
1395
    info.bodyEndLine = m_lastTokenEndPosition.line;
1388
    return true;
1396
    return true;
1389
}
1397
}
1390
1398
Lines 1395-1411 template <class TreeBuilder> TreeStatement Parser<LexerType>::parseFunctionDecla a/Source/JavaScriptCore/parser/Parser.cpp_sec8
1395
    JSTokenLocation location(tokenLocation());
1403
    JSTokenLocation location(tokenLocation());
1396
    unsigned functionKeywordStart = tokenStart();
1404
    unsigned functionKeywordStart = tokenStart();
1397
    next();
1405
    next();
1406
    ParserFunctionInfo<TreeBuilder> info;
1407
    failIfFalse((parseFunctionInfo(context, FunctionNeedsName, FunctionMode, true, info)), "Cannot parse this function");
1408
    failIfFalse(info.name, "Function statements must have a name");
1409
    failIfFalseIfStrict(declareVariable(info.name), "Cannot declare a function named '", info.name->impl(), "' in strict mode");
1410
    return context.createFuncDeclStatement(location, info, functionKeywordStart);
1411
}
1412
1413
template <typename LexerType>
1414
template <class TreeBuilder> TreeStatement Parser<LexerType>::parseClassDeclaration(TreeBuilder& context)
1415
{
1416
    ASSERT(match(CLASSTOKEN));
1417
    JSTokenLocation location(tokenLocation());
1418
    JSTextPosition classStart = tokenStartPosition();
1419
    unsigned classStartLine = tokenLine();
1420
    unsigned classEndLine = 0;
1421
    next();
1398
    const Identifier* name = 0;
1422
    const Identifier* name = 0;
1399
    TreeFormalParameterList parameters = 0;
1423
    TreeExpression parentClass = 0;
1400
    TreeFunctionBody body = 0;
1424
    TreeExpression constructor = 0;
1401
    unsigned openBraceOffset = 0;
1425
    TreePropertyList instanceMethods = 0;
1402
    unsigned closeBraceOffset = 0;
1426
    TreePropertyList staticMethods = 0;
1403
    int bodyStartLine = 0;
1427
//    TreeFormalParameterList constructorParameters = 0;
1404
    unsigned bodyStartColumn = 0;
1428
    failIfFalse((parseClassInfo(context, FunctionNeedsName, name, parentClass, constructor, instanceMethods, staticMethods)), "Cannot parse this class");
1405
    failIfFalse((parseFunctionInfo(context, FunctionNeedsName, FunctionMode, true, name, parameters, body, openBraceOffset, closeBraceOffset, bodyStartLine, bodyStartColumn)), "Cannot parse this function");
1429
    failIfFalse(name, "Class statements must have a name");
1406
    failIfFalse(name, "Function statements must have a name");
1430
    failIfFalse(declareVariable(name), "Cannot declare a class named '", name->impl(), "'");
1407
    failIfFalseIfStrict(declareVariable(name), "Cannot declare a function named '", name->impl(), "' in strict mode");
1431
1408
    return context.createFuncDeclStatement(location, name, body, parameters, openBraceOffset, closeBraceOffset, bodyStartLine, m_lastTokenEndPosition.line, bodyStartColumn, functionKeywordStart);
1432
    // FIXME: We should create a Miranda function here.
1433
    failIfFalse(constructor, "Cannot declare a class without constructor");
1434
1435
    JSTextPosition classEnd = lastTokenEndPosition();
1436
1437
    TreeExpression classDeclration = context.createAssignResolve(location, *name, constructor, classStart, classStart + 1, classEnd);
1438
    return context.createClassDeclStatement(location, *name, classDeclration, parentClass, instanceMethods, staticMethods, classStartLine, classEndLine);
1439
1440
//    return context.createFuncDeclStatement(location, name, constructor, constructorParameters, 0, 0, 0, 0, 0, 0);
1441
//    return context.createEmptyStatement(location);
1442
}
1443
1444
template <typename LexerType>
1445
template <class TreeBuilder> bool Parser<LexerType>::parseClassInfo(TreeBuilder& context, FunctionRequirements requirements, const Identifier*& name,
1446
    TreeExpression& parentClass, TreeExpression& constructor, TreePropertyList& instanceMethods, TreePropertyList& staticMethods)
1447
{
1448
    AutoPopScopeRef classScope(this, pushScope());
1449
    classScope->setStrictMode();
1450
1451
    if (match(IDENT)) {
1452
        name = m_token.m_data.ident;
1453
        next();
1454
        failIfFalse(classScope->declareVariable(name), "'", name->impl(), "' is not a valid class name");
1455
    } else if (requirements == FunctionNeedsName) {
1456
/*        if (match(OPENBRACKET) || match(EXTENDS))
1457
            semanticFail("class statements must have a name");*/
1458
        semanticFailureDueToKeyword("class name");
1459
        failDueToUnexpectedToken();
1460
        return false;
1461
    }
1462
1463
    if (consume(EXTENDS)) {
1464
        parentClass = parsePrimaryExpression(context);
1465
        failIfFalse(parentClass, "Cannot parse the parent class name");
1466
    }
1467
1468
    consumeOrFail(OPENBRACE, "Expected an opening '{' at the start of a class body");
1469
1470
    TreePropertyList instanceMethodsTail = 0;
1471
    TreePropertyList staticMethodsTail = 0;
1472
    while (!match(CLOSEBRACE)) {
1473
        if (match(SEMICOLON))
1474
            next();
1475
1476
        bool isStaticMethod = match(STATICTOKEN);
1477
        if (isStaticMethod)
1478
            next();
1479
1480
        // FIXME: Should be a binding identifier.
1481
        if (!match(IDENT)) {
1482
            failWithMessage("Expected an indentifier");
1483
            break;
1484
        }
1485
1486
        JSTokenLocation methodLocation(tokenLocation());
1487
        unsigned methodStart = tokenStart();
1488
        ParserFunctionInfo<TreeBuilder> info;
1489
        failIfFalse((parseFunctionInfo(context, FunctionNeedsName, FunctionMode, false, info)), "Cannot parse this method");
1490
        failIfFalse(info.name, "method must have a name");
1491
        failIfFalse(declareVariable(info.name), "Cannot declare a method named '", info.name->impl(), "'");
1492
1493
        bool isConstructor = !isStaticMethod && *info.name == m_vm->propertyNames->constructor;
1494
        if (isConstructor)
1495
            info.name = name; // FIXME: Is this correct??
1496
1497
        TreeExpression method = context.createFunctionExpr(methodLocation, info, methodStart);
1498
        if (isConstructor) {
1499
            semanticFailIfTrue(constructor, "Cannot declrate multiple constructors in a single class");
1500
            constructor = method;
1501
        } else {
1502
            // FIXME: Syntax error when super() is called
1503
            semanticFailIfTrue(*info.name == m_vm->propertyNames->prototype, "Cannot declrate a static method named '", info.name->impl(), "'");
1504
            TreeProperty property = context.createProperty(info.name, method, PropertyNode::Constant, /* complete */ false);
1505
1506
            TreePropertyList& head = isStaticMethod ? staticMethods : instanceMethods;
1507
            TreePropertyList& tail = isStaticMethod ? staticMethodsTail : instanceMethodsTail;
1508
1509
            if (tail)
1510
                tail = context.createPropertyList(methodLocation, property, tail);
1511
            else {
1512
                head = context.createPropertyList(methodLocation, property);
1513
                tail = head;
1514
            }
1515
        }
1516
    }
1517
1518
    consumeOrFail(CLOSEBRACE, "Expected a closing '}' after a class body");
1519
1520
    return true;
1409
}
1521
}
1410
1522
1411
struct LabelInfo {
1523
struct LabelInfo {
Lines 1799-1811 template <class TreeBuilder> TreeProperty Parser<LexerType>::parseProperty(TreeB a/Source/JavaScriptCore/parser/Parser.cpp_sec9
1799
            return context.createProperty(ident, node, PropertyNode::Constant, complete);
1911
            return context.createProperty(ident, node, PropertyNode::Constant, complete);
1800
        }
1912
        }
1801
        failIfFalse(wasIdent, "Expected an identifier as property name");
1913
        failIfFalse(wasIdent, "Expected an identifier as property name");
1802
        const Identifier* accessorName = 0;
1803
        TreeFormalParameterList parameters = 0;
1804
        TreeFunctionBody body = 0;
1805
        unsigned openBraceOffset = 0;
1806
        unsigned closeBraceOffset = 0;
1807
        int bodyStartLine = 0;
1808
        unsigned bodyStartColumn = 0;
1809
        PropertyNode::Type type;
1914
        PropertyNode::Type type;
1810
        if (*ident == m_vm->propertyNames->get)
1915
        if (*ident == m_vm->propertyNames->get)
1811
            type = PropertyNode::Getter;
1916
            type = PropertyNode::Getter;
Lines 1823-1838 template <class TreeBuilder> TreeProperty Parser<LexerType>::parseProperty(TreeB a/Source/JavaScriptCore/parser/Parser.cpp_sec10
1823
            failDueToUnexpectedToken();
1928
            failDueToUnexpectedToken();
1824
        JSTokenLocation location(tokenLocation());
1929
        JSTokenLocation location(tokenLocation());
1825
        next();
1930
        next();
1931
        ParserFunctionInfo<TreeBuilder> info;
1826
        if (type == PropertyNode::Getter) {
1932
        if (type == PropertyNode::Getter) {
1827
            failIfFalse(match(OPENPAREN), "Expected a parameter list for getter definition");
1933
            failIfFalse(match(OPENPAREN), "Expected a parameter list for getter definition");
1828
            failIfFalse((parseFunctionInfo(context, FunctionNoRequirements, GetterMode, false, accessorName, parameters, body, openBraceOffset, closeBraceOffset, bodyStartLine, bodyStartColumn)), "Cannot parse getter definition");
1934
            failIfFalse((parseFunctionInfo(context, FunctionNoRequirements, GetterMode, false, info)), "Cannot parse getter definition");
1829
        } else {
1935
        } else {
1830
            failIfFalse(match(OPENPAREN), "Expected a parameter list for setter definition");
1936
            failIfFalse(match(OPENPAREN), "Expected a parameter list for setter definition");
1831
            failIfFalse((parseFunctionInfo(context, FunctionNoRequirements, SetterMode, false, accessorName, parameters, body, openBraceOffset, closeBraceOffset, bodyStartLine, bodyStartColumn)), "Cannot parse setter definition");
1937
            failIfFalse((parseFunctionInfo(context, FunctionNoRequirements, SetterMode, false, info)), "Cannot parse setter definition");
1832
        }
1938
        }
1833
        if (stringPropertyName)
1939
        if (stringPropertyName)
1834
            return context.createGetterOrSetterProperty(location, type, complete, stringPropertyName, parameters, body, openBraceOffset, closeBraceOffset, bodyStartLine, m_lastTokenEndPosition.line, bodyStartColumn, getterOrSetterStartOffset);
1940
            return context.createGetterOrSetterProperty(location, type, complete, stringPropertyName, info, getterOrSetterStartOffset);
1835
        return context.createGetterOrSetterProperty(const_cast<VM*>(m_vm), m_parserArena, location, type, complete, numericPropertyName, parameters, body, openBraceOffset, closeBraceOffset, bodyStartLine, m_lastTokenEndPosition.line, bodyStartColumn, getterOrSetterStartOffset);
1941
        return context.createGetterOrSetterProperty(const_cast<VM*>(m_vm), m_parserArena, location, type, complete, numericPropertyName, info, getterOrSetterStartOffset);
1836
    }
1942
    }
1837
    case NUMBER: {
1943
    case NUMBER: {
1838
        double propertyName = m_token.m_data.doubleValue;
1944
        double propertyName = m_token.m_data.doubleValue;
Lines 2172-2191 template <class TreeBuilder> TreeExpression Parser<LexerType>::parseMemberExpres a/Source/JavaScriptCore/parser/Parser.cpp_sec11
2172
        next();
2278
        next();
2173
        newCount++;
2279
        newCount++;
2174
    }
2280
    }
2175
    
2281
2282
    bool baseIsSuper = false;
2176
    if (match(FUNCTION)) {
2283
    if (match(FUNCTION)) {
2177
        const Identifier* name = &m_vm->propertyNames->nullIdentifier;
2178
        TreeFormalParameterList parameters = 0;
2179
        TreeFunctionBody body = 0;
2180
        unsigned openBraceOffset = 0;
2181
        unsigned closeBraceOffset = 0;
2182
        int bodyStartLine = 0;
2183
        unsigned bodyStartColumn = 0;
2184
        unsigned functionKeywordStart = tokenStart();
2284
        unsigned functionKeywordStart = tokenStart();
2185
        location = tokenLocation();
2285
        location = tokenLocation();
2186
        next();
2286
        next();
2187
        failIfFalse((parseFunctionInfo(context, FunctionNoRequirements, FunctionMode, false, name, parameters, body, openBraceOffset, closeBraceOffset, bodyStartLine, bodyStartColumn)), "Cannot parse function expression");
2287
        ParserFunctionInfo<TreeBuilder> info;
2188
        base = context.createFunctionExpr(location, name, body, parameters, openBraceOffset, closeBraceOffset, bodyStartLine, m_lastTokenEndPosition.line, bodyStartColumn, functionKeywordStart);
2288
        info.name = &m_vm->propertyNames->nullIdentifier;
2289
        failIfFalse((parseFunctionInfo(context, FunctionNoRequirements, FunctionMode, false, info)), "Cannot parse function expression");
2290
        base = context.createFunctionExpr(location, info, functionKeywordStart);
2291
    } else if (match(SUPER)) {
2292
        base = context.superExpr(location);
2293
        baseIsSuper = true;
2294
        next();
2189
    } else
2295
    } else
2190
        base = parsePrimaryExpression(context);
2296
        base = parsePrimaryExpression(context);
2191
    
2297
    
Lines 2201-2206 template <class TreeBuilder> TreeExpression Parser<LexerType>::parseMemberExpres a/Source/JavaScriptCore/parser/Parser.cpp_sec12
2201
            int initialAssignments = m_assignmentCount;
2307
            int initialAssignments = m_assignmentCount;
2202
            TreeExpression property = parseExpression(context);
2308
            TreeExpression property = parseExpression(context);
2203
            failIfFalse(property, "Cannot parse subscript expression");
2309
            failIfFalse(property, "Cannot parse subscript expression");
2310
            if (baseIsSuper)
2311
                failIfTrue(initialAssignments || m_assignmentCount, "Cannot assign a value to super");
2204
            base = context.createBracketAccess(location, base, property, initialAssignments != m_assignmentCount, expressionStart, expressionEnd, tokenEndPosition());
2312
            base = context.createBracketAccess(location, base, property, initialAssignments != m_assignmentCount, expressionStart, expressionEnd, tokenEndPosition());
2205
            handleProductionOrFail(CLOSEBRACKET, "]", "end", "subscript expression");
2313
            handleProductionOrFail(CLOSEBRACKET, "]", "end", "subscript expression");
2206
            m_nonLHSCount = nonLHSCount;
2314
            m_nonLHSCount = nonLHSCount;
Lines 2219-2224 template <class TreeBuilder> TreeExpression Parser<LexerType>::parseMemberExpres a/Source/JavaScriptCore/parser/Parser.cpp_sec13
2219
                JSTextPosition expressionEnd = lastTokenEndPosition();
2327
                JSTextPosition expressionEnd = lastTokenEndPosition();
2220
                TreeArguments arguments = parseArguments(context, AllowSpread);
2328
                TreeArguments arguments = parseArguments(context, AllowSpread);
2221
                failIfFalse(arguments, "Cannot parse call arguments");
2329
                failIfFalse(arguments, "Cannot parse call arguments");
2330
                // FIXME: if baseIsSuper: failIfFalse(isConstructor, "Cannot call super() in this function").
2222
                base = context.makeFunctionCallNode(location, base, arguments, expressionStart, expressionEnd, lastTokenEndPosition());
2331
                base = context.makeFunctionCallNode(location, base, arguments, expressionStart, expressionEnd, lastTokenEndPosition());
2223
            }
2332
            }
2224
            m_nonLHSCount = nonLHSCount;
2333
            m_nonLHSCount = nonLHSCount;
Lines 2236-2243 template <class TreeBuilder> TreeExpression Parser<LexerType>::parseMemberExpres a/Source/JavaScriptCore/parser/Parser.cpp_sec14
2236
        default:
2345
        default:
2237
            goto endMemberExpression;
2346
            goto endMemberExpression;
2238
        }
2347
        }
2348
        baseIsSuper = false;
2239
    }
2349
    }
2240
endMemberExpression:
2350
endMemberExpression:
2351
//    failIfTrue(baseIsSuper && !newCount, "Cannot reference super");
2241
    while (newCount--)
2352
    while (newCount--)
2242
        base = context.createNewExpr(location, base, expressionStart, lastTokenEndPosition());
2353
        base = context.createNewExpr(location, base, expressionStart, lastTokenEndPosition());
2243
    return base;
2354
    return base;
- a/Source/JavaScriptCore/parser/Parser.h -2 / +7 lines
Lines 31-36 a/Source/JavaScriptCore/parser/Parser.h_sec1
31
#include "Nodes.h"
31
#include "Nodes.h"
32
#include "ParserArena.h"
32
#include "ParserArena.h"
33
#include "ParserError.h"
33
#include "ParserError.h"
34
#include "ParserFunctionInfo.h"
34
#include "ParserTokens.h"
35
#include "ParserTokens.h"
35
#include "SourceProvider.h"
36
#include "SourceProvider.h"
36
#include "SourceProviderCache.h"
37
#include "SourceProviderCache.h"
Lines 77-83 COMPILE_ASSERT(LastUntaggedToken < 64, LessThan64UntaggedTokens); a/Source/JavaScriptCore/parser/Parser.h_sec2
77
78
78
enum SourceElementsMode { CheckForStrictMode, DontCheckForStrictMode };
79
enum SourceElementsMode { CheckForStrictMode, DontCheckForStrictMode };
79
enum FunctionRequirements { FunctionNoRequirements, FunctionNeedsName };
80
enum FunctionRequirements { FunctionNoRequirements, FunctionNeedsName };
80
enum FunctionParseMode { FunctionMode, GetterMode, SetterMode };
81
enum FunctionParseMode { FunctionMode, GetterMode, SetterMode, MethodMode };
81
enum DeconstructionKind {
82
enum DeconstructionKind {
82
    DeconstructToVariables,
83
    DeconstructToVariables,
83
    DeconstructToParameters,
84
    DeconstructToParameters,
Lines 692-697 private: a/Source/JavaScriptCore/parser/Parser.h_sec3
692
    
693
    
693
    template <class TreeBuilder> TreeSourceElements parseSourceElements(TreeBuilder&, SourceElementsMode);
694
    template <class TreeBuilder> TreeSourceElements parseSourceElements(TreeBuilder&, SourceElementsMode);
694
    template <class TreeBuilder> TreeStatement parseStatement(TreeBuilder&, const Identifier*& directive, unsigned* directiveLiteralLength = 0);
695
    template <class TreeBuilder> TreeStatement parseStatement(TreeBuilder&, const Identifier*& directive, unsigned* directiveLiteralLength = 0);
696
    template <class TreeBuilder> TreeStatement parseClassDeclaration(TreeBuilder&);
695
    template <class TreeBuilder> TreeStatement parseFunctionDeclaration(TreeBuilder&);
697
    template <class TreeBuilder> TreeStatement parseFunctionDeclaration(TreeBuilder&);
696
    template <class TreeBuilder> TreeStatement parseVarDeclaration(TreeBuilder&);
698
    template <class TreeBuilder> TreeStatement parseVarDeclaration(TreeBuilder&);
697
    template <class TreeBuilder> TreeStatement parseConstDeclaration(TreeBuilder&);
699
    template <class TreeBuilder> TreeStatement parseConstDeclaration(TreeBuilder&);
Lines 733-739 private: a/Source/JavaScriptCore/parser/Parser.h_sec4
733
    template <class TreeBuilder> NEVER_INLINE TreeDeconstructionPattern createBindingPattern(TreeBuilder&, DeconstructionKind, const Identifier&, int depth, JSToken);
735
    template <class TreeBuilder> NEVER_INLINE TreeDeconstructionPattern createBindingPattern(TreeBuilder&, DeconstructionKind, const Identifier&, int depth, JSToken);
734
    template <class TreeBuilder> NEVER_INLINE TreeDeconstructionPattern parseDeconstructionPattern(TreeBuilder&, DeconstructionKind, int depth = 0);
736
    template <class TreeBuilder> NEVER_INLINE TreeDeconstructionPattern parseDeconstructionPattern(TreeBuilder&, DeconstructionKind, int depth = 0);
735
    template <class TreeBuilder> NEVER_INLINE TreeDeconstructionPattern tryParseDeconstructionPatternExpression(TreeBuilder&);
737
    template <class TreeBuilder> NEVER_INLINE TreeDeconstructionPattern tryParseDeconstructionPatternExpression(TreeBuilder&);
736
    template <class TreeBuilder> NEVER_INLINE bool parseFunctionInfo(TreeBuilder&, FunctionRequirements, FunctionParseMode, bool nameIsInContainingScope, const Identifier*&, TreeFormalParameterList&, TreeFunctionBody&, unsigned& openBraceOffset, unsigned& closeBraceOffset, int& bodyStartLine, unsigned& bodyStartColumn);
738
739
    template <class TreeBuilder> NEVER_INLINE bool parseFunctionInfo(TreeBuilder&, FunctionRequirements, FunctionParseMode, bool nameIsInContainingScope, ParserFunctionInfo<TreeBuilder>&);
740
    template <class TreeBuilder> NEVER_INLINE bool parseClassInfo(TreeBuilder&, FunctionRequirements, const Identifier*&,
741
        TreeExpression& parentClass, TreeExpression& constructor, TreePropertyList& instanceMethods, TreePropertyList& staticMethods);
737
    ALWAYS_INLINE int isBinaryOperator(JSTokenType);
742
    ALWAYS_INLINE int isBinaryOperator(JSTokenType);
738
    bool allowAutomaticSemicolon();
743
    bool allowAutomaticSemicolon();
739
    
744
    
- a/Source/JavaScriptCore/parser/ParserFunctionInfo.h +45 lines
Line 0 a/Source/JavaScriptCore/parser/ParserFunctionInfo.h_sec1
1
/*
2
 * Copyright (C) 2015 Apple Inc. All rights reserved.
3
 *
4
 * Redistribution and use in source and binary forms, with or without
5
 * modification, are permitted provided that the following conditions
6
 * are met:
7
 * 1. Redistributions of source code must retain the above copyright
8
 *    notice, this list of conditions and the following disclaimer.
9
 * 2. Redistributions in binary form must reproduce the above copyright
10
 *    notice, this list of conditions and the following disclaimer in the
11
 *    documentation and/or other materials provided with the distribution.
12
 *
13
 * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
14
 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
15
 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
16
 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
17
 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
18
 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
19
 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
20
 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
21
 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
22
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
23
 * THE POSSIBILITY OF SUCH DAMAGE.
24
 */
25
26
#ifndef ParserFunctionInfo_h
27
#define ParserFunctionInfo_h
28
29
namespace JSC {
30
31
template <class TreeBuilder>
32
struct ParserFunctionInfo {
33
    const Identifier* name = 0;
34
    typename TreeBuilder::FormalParameterList parameters = 0;
35
    typename TreeBuilder::FunctionBody body = 0;
36
    unsigned openBraceOffset = 0;
37
    unsigned closeBraceOffset = 0;
38
    int bodyStartLine = 0;
39
    int bodyEndLine = 0;
40
    unsigned bodyStartColumn = 0;
41
};
42
43
}
44
45
#endif
- a/Source/JavaScriptCore/parser/ParserTokens.h +4 lines
Lines 75-80 enum JSTokenType { a/Source/JavaScriptCore/parser/ParserTokens.h_sec1
75
    FINALLY,
75
    FINALLY,
76
    DEBUGGER,
76
    DEBUGGER,
77
    ELSE,
77
    ELSE,
78
    CLASSTOKEN,
79
    EXTENDS,
80
    STATICTOKEN,
81
    SUPER,
78
    OPENBRACE = 0,
82
    OPENBRACE = 0,
79
    CLOSEBRACE,
83
    CLOSEBRACE,
80
    OPENPAREN,
84
    OPENPAREN,
- a/Source/JavaScriptCore/parser/SyntaxChecker.h -6 / +12 lines
Lines 26-36 a/Source/JavaScriptCore/parser/SyntaxChecker.h_sec1
26
#ifndef SyntaxChecker_h
26
#ifndef SyntaxChecker_h
27
#define SyntaxChecker_h
27
#define SyntaxChecker_h
28
28
29
#include "ParserFunctionInfo.h"
29
#include "Lexer.h"
30
#include "Lexer.h"
30
#include "YarrSyntaxChecker.h"
31
#include "YarrSyntaxChecker.h"
31
32
32
namespace JSC {
33
namespace JSC {
33
    
34
34
class SyntaxChecker {
35
class SyntaxChecker {
35
public:
36
public:
36
    struct BinaryExprContext {
37
    struct BinaryExprContext {
Lines 71-77 public: a/Source/JavaScriptCore/parser/SyntaxChecker.h_sec2
71
    typedef SyntaxChecker FunctionBodyBuilder;
72
    typedef SyntaxChecker FunctionBodyBuilder;
72
    enum { NoneExpr = 0,
73
    enum { NoneExpr = 0,
73
        ResolveEvalExpr, ResolveExpr, NumberExpr, StringExpr,
74
        ResolveEvalExpr, ResolveExpr, NumberExpr, StringExpr,
74
        ThisExpr, NullExpr, BoolExpr, RegExpExpr, ObjectLiteralExpr,
75
        ThisExpr, SuperExpr, NullExpr, BoolExpr, RegExpExpr, ObjectLiteralExpr,
75
        FunctionExpr, BracketExpr, DotExpr, CallExpr,
76
        FunctionExpr, BracketExpr, DotExpr, CallExpr,
76
        NewExpr, PreExpr, PostExpr, UnaryExpr, BinaryExpr,
77
        NewExpr, PreExpr, PostExpr, UnaryExpr, BinaryExpr,
77
        ConditionalExpr, AssignmentExpr, TypeofExpr,
78
        ConditionalExpr, AssignmentExpr, TypeofExpr,
Lines 142-147 public: a/Source/JavaScriptCore/parser/SyntaxChecker.h_sec3
142
    ExpressionType createUnaryPlus(const JSTokenLocation&, ExpressionType) { return UnaryExpr; }
143
    ExpressionType createUnaryPlus(const JSTokenLocation&, ExpressionType) { return UnaryExpr; }
143
    ExpressionType createVoid(const JSTokenLocation&, ExpressionType) { return UnaryExpr; }
144
    ExpressionType createVoid(const JSTokenLocation&, ExpressionType) { return UnaryExpr; }
144
    ExpressionType thisExpr(const JSTokenLocation&) { return ThisExpr; }
145
    ExpressionType thisExpr(const JSTokenLocation&) { return ThisExpr; }
146
    ExpressionType superExpr(const JSTokenLocation&) { return ThisExpr; }
147
    ExpressionType createSuperCall(const JSTokenLocation&, ExpressionType, const JSTextPosition&, const JSTextPosition&, const JSTextPosition&) { return SuperExpr; }
148
    ExpressionType createSuperBracketAccess(const JSTokenLocation&, ExpressionType, const JSTextPosition&, const JSTextPosition&, const JSTextPosition&) { return SuperExpr; }
149
    ExpressionType createSuperDotAccess(const JSTokenLocation&, const Identifier*, const JSTextPosition&, const JSTextPosition&, const JSTextPosition&) { return SuperExpr; }
145
    ExpressionType createResolve(const JSTokenLocation&, const Identifier*, int) { return ResolveExpr; }
150
    ExpressionType createResolve(const JSTokenLocation&, const Identifier*, int) { return ResolveExpr; }
146
    ExpressionType createObjectLiteral(const JSTokenLocation&) { return ObjectLiteralExpr; }
151
    ExpressionType createObjectLiteral(const JSTokenLocation&) { return ObjectLiteralExpr; }
147
    ExpressionType createObjectLiteral(const JSTokenLocation&, int) { return ObjectLiteralExpr; }
152
    ExpressionType createObjectLiteral(const JSTokenLocation&, int) { return ObjectLiteralExpr; }
Lines 159-165 public: a/Source/JavaScriptCore/parser/SyntaxChecker.h_sec4
159
    ExpressionType createConditionalExpr(const JSTokenLocation&, ExpressionType, ExpressionType, ExpressionType) { return ConditionalExpr; }
164
    ExpressionType createConditionalExpr(const JSTokenLocation&, ExpressionType, ExpressionType, ExpressionType) { return ConditionalExpr; }
160
    ExpressionType createAssignResolve(const JSTokenLocation&, const Identifier&, ExpressionType, int, int, int) { return AssignmentExpr; }
165
    ExpressionType createAssignResolve(const JSTokenLocation&, const Identifier&, ExpressionType, int, int, int) { return AssignmentExpr; }
161
    ExpressionType createEmptyVarExpression(const JSTokenLocation&, const Identifier&) { return AssignmentExpr; }
166
    ExpressionType createEmptyVarExpression(const JSTokenLocation&, const Identifier&) { return AssignmentExpr; }
162
    ExpressionType createFunctionExpr(const JSTokenLocation&, const Identifier*, int, int, int, int, int, int, int, int) { return FunctionExpr; }
167
    ExpressionType createFunctionExpr(const JSTokenLocation&, const ParserFunctionInfo<SyntaxChecker>&, int) { return FunctionExpr; }
163
    int createFunctionBody(const JSTokenLocation&, const JSTokenLocation&, int, int, bool) { return FunctionBodyResult; }
168
    int createFunctionBody(const JSTokenLocation&, const JSTokenLocation&, int, int, bool) { return FunctionBodyResult; }
164
    void setFunctionNameStart(int, int) { }
169
    void setFunctionNameStart(int, int) { }
165
    int createArguments() { return ArgumentsResult; }
170
    int createArguments() { return ArgumentsResult; }
Lines 193-199 public: a/Source/JavaScriptCore/parser/SyntaxChecker.h_sec5
193
    int createClause(int, int) { return ClauseResult; }
198
    int createClause(int, int) { return ClauseResult; }
194
    int createClauseList(int) { return ClauseListResult; }
199
    int createClauseList(int) { return ClauseListResult; }
195
    int createClauseList(int, int) { return ClauseListResult; }
200
    int createClauseList(int, int) { return ClauseListResult; }
196
    int createFuncDeclStatement(const JSTokenLocation&, const Identifier*, int, int, int, int, int, int, int, int) { return StatementResult; }
201
    int createFuncDeclStatement(const JSTokenLocation&, const ParserFunctionInfo<SyntaxChecker>&, int) { return StatementResult; }
202
    int createClassDeclStatement(const JSTokenLocation&, const Identifier&, ExpressionType, ExpressionType, PropertyList, PropertyList, int, int) { return StatementResult; }
197
    int createBlockStatement(const JSTokenLocation&, int, int, int) { return StatementResult; }
203
    int createBlockStatement(const JSTokenLocation&, int, int, int) { return StatementResult; }
198
    int createExprStatement(const JSTokenLocation&, int, int, int) { return StatementResult; }
204
    int createExprStatement(const JSTokenLocation&, int, int, int) { return StatementResult; }
199
    int createIfStatement(const JSTokenLocation&, int, int, int, int) { return StatementResult; }
205
    int createIfStatement(const JSTokenLocation&, int, int, int, int) { return StatementResult; }
Lines 218-231 public: a/Source/JavaScriptCore/parser/SyntaxChecker.h_sec6
218
    int createDebugger(const JSTokenLocation&, int, int) { return StatementResult; }
224
    int createDebugger(const JSTokenLocation&, int, int) { return StatementResult; }
219
    int createConstStatement(const JSTokenLocation&, int, int, int) { return StatementResult; }
225
    int createConstStatement(const JSTokenLocation&, int, int, int) { return StatementResult; }
220
    int appendConstDecl(const JSTokenLocation&, int, const Identifier*, int) { return StatementResult; }
226
    int appendConstDecl(const JSTokenLocation&, int, const Identifier*, int) { return StatementResult; }
221
    Property createGetterOrSetterProperty(const JSTokenLocation&, PropertyNode::Type type, bool strict, const Identifier* name, int, int, int, int, int, int, int, int)
227
    Property createGetterOrSetterProperty(const JSTokenLocation&, PropertyNode::Type type, bool strict, const Identifier* name, const ParserFunctionInfo<SyntaxChecker>&, unsigned)
222
    {
228
    {
223
        ASSERT(name);
229
        ASSERT(name);
224
        if (!strict)
230
        if (!strict)
225
            return Property(type);
231
            return Property(type);
226
        return Property(name, type);
232
        return Property(name, type);
227
    }
233
    }
228
    Property createGetterOrSetterProperty(VM* vm, ParserArena& parserArena, const JSTokenLocation&, PropertyNode::Type type, bool strict, double name, int, int, int, int, int, int, int, int)
234
    Property createGetterOrSetterProperty(VM* vm, ParserArena& parserArena, const JSTokenLocation&, PropertyNode::Type type, bool strict, double name, const ParserFunctionInfo<SyntaxChecker>&, unsigned)
229
    {
235
    {
230
        if (!strict)
236
        if (!strict)
231
            return Property(type);
237
            return Property(type);
- a/Source/JavaScriptCore/runtime/CommonIdentifiers.h +1 lines
Lines 220-225 a/Source/JavaScriptCore/runtime/CommonIdentifiers.h_sec1
220
    macro(yield)
220
    macro(yield)
221
221
222
#define JSC_COMMON_PRIVATE_IDENTIFIERS_EACH_PROPERTY_NAME(macro) \
222
#define JSC_COMMON_PRIVATE_IDENTIFIERS_EACH_PROPERTY_NAME(macro) \
223
    macro(homeObject) \
223
    macro(iterator) \
224
    macro(iterator) \
224
    macro(iteratorNext) \
225
    macro(iteratorNext) \
225
    macro(resolve) \
226
    macro(resolve) \

Return to Bug 140491