Changeset 212665 in webkit


Ignore:
Timestamp:
Feb 20, 2017 12:30:43 PM (7 years ago)
Author:
commit-queue@webkit.org
Message:

Unreviewed, rolling out r212618.
https://bugs.webkit.org/show_bug.cgi?id=168609

"Appears to cause PLT regression" (Requested by mlam on
#webkit).

Reverted changeset:

"CachedCall should let GC know to keep its arguments alive."
https://bugs.webkit.org/show_bug.cgi?id=168567
http://trac.webkit.org/changeset/212618

Location:
trunk/Source
Files:
1 deleted
13 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r212640 r212665  
     12017-02-20  Commit Queue  <commit-queue@webkit.org>
     2
     3        Unreviewed, rolling out r212618.
     4        https://bugs.webkit.org/show_bug.cgi?id=168609
     5
     6        "Appears to cause PLT regression" (Requested by mlam on
     7        #webkit).
     8
     9        Reverted changeset:
     10
     11        "CachedCall should let GC know to keep its arguments alive."
     12        https://bugs.webkit.org/show_bug.cgi?id=168567
     13        http://trac.webkit.org/changeset/212618
     14
    1152017-02-19  Mark Lam  <mark.lam@apple.com>
    216
  • trunk/Source/JavaScriptCore/interpreter/CachedCall.h

    r212618 r212665  
    11/*
    2  * Copyright (C) 2009-2017 Apple Inc. All rights reserved.
     2 * Copyright (C) 2009, 2013, 2016 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    3434#include "VMEntryScope.h"
    3535#include "VMInlines.h"
    36 #include <wtf/ForbidHeapAllocation.h>
    3736
    3837namespace JSC {
    3938    class CachedCall {
    40         WTF_MAKE_NONCOPYABLE(CachedCall);
    41         WTF_FORBID_HEAP_ALLOCATION;
     39        WTF_MAKE_NONCOPYABLE(CachedCall); WTF_MAKE_FAST_ALLOCATED;
    4240    public:
    4341        CachedCall(CallFrame* callFrame, JSFunction* function, int argumentCount)
     
    5250            ASSERT(!function->isHostFunctionNonInline());
    5351            if (UNLIKELY(vm.isSafeToRecurseSoft())) {
    54                 m_arguments.ensureCapacity(argumentCount);
    55                 m_closure = m_interpreter->prepareForRepeatCall(function->jsExecutable(), callFrame, &m_protoCallFrame, function, argumentCount + 1, function->scope(), m_arguments);
     52                m_arguments.resize(argumentCount);
     53                m_closure = m_interpreter->prepareForRepeatCall(function->jsExecutable(), callFrame, &m_protoCallFrame, function, argumentCount + 1, function->scope(), m_arguments.data());
    5654            } else
    5755                throwStackOverflowError(callFrame, scope);
     
    6260        {
    6361            ASSERT(m_valid);
    64             ASSERT(m_arguments.size() == static_cast<size_t>(m_protoCallFrame.argumentCount()));
    6562            return m_interpreter->execute(m_closure);
    6663        }
    6764        void setThis(JSValue v) { m_protoCallFrame.setThisValue(v); }
    68 
    69         void clearArguments() { m_arguments.clear(); }
    70         void appendArgument(JSValue v) { m_arguments.append(v); }
     65        void setArgument(int n, JSValue v) { m_protoCallFrame.setArgument(n, v); }
    7166
    7267    private:
     
    7671        VMEntryScope m_entryScope;
    7772        ProtoCallFrame m_protoCallFrame;
    78         MarkedArgumentBuffer m_arguments;
     73        Vector<JSValue> m_arguments;
    7974        CallFrameClosure m_closure;
    8075    };
  • trunk/Source/JavaScriptCore/interpreter/CallFrame.h

    r212618 r212665  
    22 *  Copyright (C) 1999-2001 Harri Porten (porten@kde.org)
    33 *  Copyright (C) 2001 Peter Kelly (pmk@post.com)
    4  *  Copyright (C) 2003-2017 Apple Inc. All rights reserved.
     4 *  Copyright (C) 2003, 2007-2008, 2011, 2013-2016 Apple Inc. All rights reserved.
    55 *
    66 *  This library is free software; you can redistribute it and/or
     
    120120        AtomicStringTable* atomicStringTable() const { return vm().atomicStringTable(); }
    121121        const CommonIdentifiers& propertyNames() const { return *vm().propertyNames; }
    122         const ArgList& emptyList() const { return *vm().emptyList; }
     122        const MarkedArgumentBuffer& emptyList() const { return *vm().emptyList; }
    123123        Interpreter* interpreter() { return vm().interpreter; }
    124124        Heap* heap() { return &vm().heap; }
  • trunk/Source/JavaScriptCore/interpreter/Interpreter.cpp

    r212618 r212665  
    11/*
    2  * Copyright (C) 2008-2017 Apple Inc. All rights reserved.
     2 * Copyright (C) 2008-2010, 2012-2016 Apple Inc. All rights reserved.
    33 * Copyright (C) 2008 Cameron Zwarich <cwzwarich@uwaterloo.ca>
    44 *
     
    10061006}
    10071007
    1008 CallFrameClosure Interpreter::prepareForRepeatCall(FunctionExecutable* functionExecutable, CallFrame* callFrame, ProtoCallFrame* protoCallFrame, JSFunction* function, int argumentCountIncludingThis, JSScope* scope, const ArgList& args)
     1008CallFrameClosure Interpreter::prepareForRepeatCall(FunctionExecutable* functionExecutable, CallFrame* callFrame, ProtoCallFrame* protoCallFrame, JSFunction* function, int argumentCountIncludingThis, JSScope* scope, JSValue* args)
    10091009{
    10101010    VM& vm = *scope->vm();
     
    10261026    size_t argsCount = argumentCountIncludingThis;
    10271027
    1028     protoCallFrame->init(newCodeBlock, function, jsUndefined(), argsCount, args.data());
     1028    protoCallFrame->init(newCodeBlock, function, jsUndefined(), argsCount, args);
    10291029    // Return the successful closure:
    10301030    CallFrameClosure result = { callFrame, protoCallFrame, function, functionExecutable, &vm, scope, newCodeBlock->numParameters(), argumentCountIncludingThis };
  • trunk/Source/JavaScriptCore/interpreter/Interpreter.h

    r212618 r212665  
    11/*
    2  * Copyright (C) 2008-2017 Apple Inc. All rights reserved.
     2 * Copyright (C) 2008, 2013, 2015-2016 Apple Inc. All rights reserved.
    33 * Copyright (C) 2012 Research In Motion Limited. All rights reserved.
    44 *
     
    155155        enum ExecutionFlag { Normal, InitializeAndReturn };
    156156
    157         CallFrameClosure prepareForRepeatCall(FunctionExecutable*, CallFrame*, ProtoCallFrame*, JSFunction*, int argumentCountIncludingThis, JSScope*, const ArgList&);
     157        CallFrameClosure prepareForRepeatCall(FunctionExecutable*, CallFrame*, ProtoCallFrame*, JSFunction*, int argumentCountIncludingThis, JSScope*, JSValue*);
    158158
    159159        JSValue execute(CallFrameClosure&);
  • trunk/Source/JavaScriptCore/interpreter/ProtoCallFrame.h

    r212618 r212665  
    11/*
    2  * Copyright (C) 2013-2017 Apple Inc. All Rights Reserved.
     2 * Copyright (C) 2013 Apple Inc. All Rights Reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    2727
    2828#include "Register.h"
    29 #include <wtf/ForbidHeapAllocation.h>
    3029
    3130namespace JSC {
    3231
    3332struct JS_EXPORT_PRIVATE ProtoCallFrame {
    34     WTF_FORBID_HEAP_ALLOCATION;
    35 public:
    3633    Register codeBlockValue;
    3734    Register calleeValue;
  • trunk/Source/JavaScriptCore/runtime/ArgList.cpp

    r212618 r212665  
    11/*
    2  *  Copyright (C) 2003-2017 Apple Inc. All rights reserved.
     2 *  Copyright (C) 2003, 2004, 2005, 2006, 2007, 2009, 2016 Apple Inc. All rights reserved.
    33 *
    44 *  This library is free software; you can redistribute it and/or
     
    6464}
    6565
    66 void MarkedArgumentBuffer::slowEnsureCapacity(size_t requestedCapacity)
    67 {
    68     int newCapacity = Checked<int>(requestedCapacity).unsafeGet();
    69     expandCapacity(newCapacity);
    70 }
    71 
    7266void MarkedArgumentBuffer::expandCapacity()
    7367{
    7468    int newCapacity = (Checked<int>(m_capacity) * 2).unsafeGet();
    75     expandCapacity(newCapacity);
    76 }
    77 
    78 void MarkedArgumentBuffer::expandCapacity(int newCapacity)
    79 {
    80     ASSERT(m_capacity < newCapacity);
    8169    size_t size = (Checked<size_t>(newCapacity) * sizeof(EncodedJSValue)).unsafeGet();
    8270    EncodedJSValue* newBuffer = static_cast<EncodedJSValue*>(fastMalloc(size));
  • trunk/Source/JavaScriptCore/runtime/ArgList.h

    r212620 r212665  
    11/*
    22 *  Copyright (C) 1999-2001 Harri Porten (porten@kde.org)
    3  *  Copyright (C) 2003-2017 Apple Inc. All rights reserved.
     3 *  Copyright (C) 2003, 2007, 2008, 2009, 2016 Apple Inc. All rights reserved.
    44 *
    55 *  This library is free software; you can redistribute it and/or
     
    2323
    2424#include "CallFrame.h"
    25 #include <wtf/ForbidHeapAllocation.h>
    2625#include <wtf/HashSet.h>
    2726
     
    3029class MarkedArgumentBuffer {
    3130    WTF_MAKE_NONCOPYABLE(MarkedArgumentBuffer);
    32     WTF_FORBID_HEAP_ALLOCATION;
    3331    friend class VM;
    3432    friend class ArgList;
     
    9795    static void markLists(SlotVisitor&, ListSet&);
    9896
    99     void ensureCapacity(size_t requestedCapacity)
    100     {
    101         if (requestedCapacity > static_cast<size_t>(m_capacity))
    102             slowEnsureCapacity(requestedCapacity);
    103     }
    104 
    10597private:
    10698    void expandCapacity();
    107     void expandCapacity(int newCapacity);
    108     void slowEnsureCapacity(size_t requestedCapacity);
    10999
    110100    void addMarkSet(JSValue);
  • trunk/Source/JavaScriptCore/runtime/StringPrototype.cpp

    r212618 r212665  
    11/*
    22 *  Copyright (C) 1999-2001 Harri Porten (porten@kde.org)
    3  *  Copyright (C) 2004-2017 Apple Inc. All rights reserved.
     3 *  Copyright (C) 2004-2008, 2013, 2016 Apple Inc. All rights reserved.
    44 *  Copyright (C) 2009 Torch Mobile, Inc.
    55 *  Copyright (C) 2015 Jordan Harband (ljharb@gmail.com)
     
    540540
    541541                unsigned i = 0;
    542                 cachedCall.clearArguments();
    543542                for (; i < regExp->numSubpatterns() + 1; ++i) {
    544543                    int matchStart = ovector[i * 2];
     
    546545
    547546                    if (matchStart < 0)
    548                         cachedCall.appendArgument(jsUndefined());
     547                        cachedCall.setArgument(i, jsUndefined());
    549548                    else
    550                         cachedCall.appendArgument(jsSubstring(&vm, source, matchStart, matchLen));
     549                        cachedCall.setArgument(i, jsSubstring(&vm, source, matchStart, matchLen));
    551550                }
    552551
    553                 cachedCall.appendArgument(jsNumber(result.start));
    554                 cachedCall.appendArgument(string);
     552                cachedCall.setArgument(i++, jsNumber(result.start));
     553                cachedCall.setArgument(i++, string);
    555554
    556555                cachedCall.setThis(jsUndefined());
     
    580579
    581580                unsigned i = 0;
    582                 cachedCall.clearArguments();
    583581                for (; i < regExp->numSubpatterns() + 1; ++i) {
    584582                    int matchStart = ovector[i * 2];
     
    586584
    587585                    if (matchStart < 0)
    588                         cachedCall.appendArgument(jsUndefined());
     586                        cachedCall.setArgument(i, jsUndefined());
    589587                    else
    590                         cachedCall.appendArgument(jsSubstring(&vm, source, matchStart, matchLen));
     588                        cachedCall.setArgument(i, jsSubstring(&vm, source, matchStart, matchLen));
    591589                }
    592590
    593                 cachedCall.appendArgument(jsNumber(result.start));
    594                 cachedCall.appendArgument(string);
     591                cachedCall.setArgument(i++, jsNumber(result.start));
     592                cachedCall.setArgument(i++, string);
    595593
    596594                cachedCall.setThis(jsUndefined());
  • trunk/Source/JavaScriptCore/runtime/VM.cpp

    r212618 r212665  
    181181    , m_atomicStringTable(vmType == Default ? wtfThreadData().atomicStringTable() : new AtomicStringTable)
    182182    , propertyNames(nullptr)
    183     , emptyList(new ArgList)
     183    , emptyList(new MarkedArgumentBuffer)
    184184    , machineCodeBytesPerBytecodeWordForBaselineJIT(std::make_unique<SimpleStats>())
    185185    , customGetterSetterFunctionMap(*this)
  • trunk/Source/JavaScriptCore/runtime/VM.h

    r212618 r212665  
    386386    TemplateRegistryKeyTable m_templateRegistryKeytable;
    387387    CommonIdentifiers* propertyNames;
    388     const ArgList* emptyList;
     388    const MarkedArgumentBuffer* emptyList; // Lists are supposed to be allocated on the stack to have their elements properly marked, which is not the case here - but this list has nothing to mark.
    389389    SmallStrings smallStrings;
    390390    NumericStrings numericStrings;
  • trunk/Source/WTF/ChangeLog

    r212627 r212665  
     12017-02-20  Commit Queue  <commit-queue@webkit.org>
     2
     3        Unreviewed, rolling out r212618.
     4        https://bugs.webkit.org/show_bug.cgi?id=168609
     5
     6        "Appears to cause PLT regression" (Requested by mlam on
     7        #webkit).
     8
     9        Reverted changeset:
     10
     11        "CachedCall should let GC know to keep its arguments alive."
     12        https://bugs.webkit.org/show_bug.cgi?id=168567
     13        http://trac.webkit.org/changeset/212618
     14
    1152017-02-20  Carlos Garcia Campos  <cgarcia@igalia.com>
    216
  • trunk/Source/WTF/WTF.xcodeproj/project.pbxproj

    r212618 r212665  
    369369                EB95E1F0161A72410089A2F5 /* ByteOrder.h in Headers */ = {isa = PBXBuildFile; fileRef = EB95E1EF161A72410089A2F5 /* ByteOrder.h */; };
    370370                FE8225311B2A1E5B00BA68FD /* NakedPtr.h in Headers */ = {isa = PBXBuildFile; fileRef = FE8225301B2A1E5B00BA68FD /* NakedPtr.h */; };
    371                 FE86A8751E59440200111BBF /* ForbidHeapAllocation.h in Headers */ = {isa = PBXBuildFile; fileRef = FE86A8741E59440200111BBF /* ForbidHeapAllocation.h */; };
    372371                FE8925B01D00DAEC0046907E /* Indenter.h in Headers */ = {isa = PBXBuildFile; fileRef = FE8925AF1D00DAEC0046907E /* Indenter.h */; };
    373372                FEDACD3D1630F83F00C69634 /* StackStats.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FEDACD3B1630F83F00C69634 /* StackStats.cpp */; };
     
    753752                F72BBDB107FA424886178B9E /* SymbolImpl.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SymbolImpl.cpp; sourceTree = "<group>"; };
    754753                FE8225301B2A1E5B00BA68FD /* NakedPtr.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NakedPtr.h; sourceTree = "<group>"; };
    755                 FE86A8741E59440200111BBF /* ForbidHeapAllocation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ForbidHeapAllocation.h; sourceTree = "<group>"; };
    756754                FE8925AF1D00DAEC0046907E /* Indenter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Indenter.h; sourceTree = "<group>"; };
    757755                FEDACD3B1630F83F00C69634 /* StackStats.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = StackStats.cpp; sourceTree = "<group>"; };
     
    965963                                0F9D335C165DBA73005AD387 /* FilePrintStream.h */,
    966964                                0F2B66A517B6B4F700A7AE3F /* FlipBytes.h */,
    967                                 FE86A8741E59440200111BBF /* ForbidHeapAllocation.h */,
    968965                                A8A472A6151A825A004123FF /* Forward.h */,
    969966                                83F2BADE1CF9524E003E99C3 /* Function.h */,
     
    14221419                                1A1D8B9C173186CE00141DA4 /* FunctionDispatcher.h in Headers */,
    14231420                                A8A473CA151A825B004123FF /* GetPtr.h in Headers */,
    1424                                 FE86A8751E59440200111BBF /* ForbidHeapAllocation.h in Headers */,
    14251421                                0FEC84AF1BD825310080FF74 /* GraphNodeWorklist.h in Headers */,
    14261422                                2C05385415BC819000F21B96 /* GregorianDateTime.h in Headers */,
Note: See TracChangeset for help on using the changeset viewer.