Changeset 212665 in webkit
- Timestamp:
- Feb 20, 2017 12:30:43 PM (7 years ago)
- Location:
- trunk/Source
- Files:
-
- 1 deleted
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r212640 r212665 1 2017-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 1 15 2017-02-19 Mark Lam <mark.lam@apple.com> 2 16 -
trunk/Source/JavaScriptCore/interpreter/CachedCall.h
r212618 r212665 1 1 /* 2 * Copyright (C) 2009 -2017Apple Inc. All rights reserved.2 * Copyright (C) 2009, 2013, 2016 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 34 34 #include "VMEntryScope.h" 35 35 #include "VMInlines.h" 36 #include <wtf/ForbidHeapAllocation.h>37 36 38 37 namespace JSC { 39 38 class CachedCall { 40 WTF_MAKE_NONCOPYABLE(CachedCall); 41 WTF_FORBID_HEAP_ALLOCATION; 39 WTF_MAKE_NONCOPYABLE(CachedCall); WTF_MAKE_FAST_ALLOCATED; 42 40 public: 43 41 CachedCall(CallFrame* callFrame, JSFunction* function, int argumentCount) … … 52 50 ASSERT(!function->isHostFunctionNonInline()); 53 51 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()); 56 54 } else 57 55 throwStackOverflowError(callFrame, scope); … … 62 60 { 63 61 ASSERT(m_valid); 64 ASSERT(m_arguments.size() == static_cast<size_t>(m_protoCallFrame.argumentCount()));65 62 return m_interpreter->execute(m_closure); 66 63 } 67 64 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); } 71 66 72 67 private: … … 76 71 VMEntryScope m_entryScope; 77 72 ProtoCallFrame m_protoCallFrame; 78 MarkedArgumentBufferm_arguments;73 Vector<JSValue> m_arguments; 79 74 CallFrameClosure m_closure; 80 75 }; -
trunk/Source/JavaScriptCore/interpreter/CallFrame.h
r212618 r212665 2 2 * Copyright (C) 1999-2001 Harri Porten (porten@kde.org) 3 3 * Copyright (C) 2001 Peter Kelly (pmk@post.com) 4 * Copyright (C) 2003 -2017Apple Inc. All rights reserved.4 * Copyright (C) 2003, 2007-2008, 2011, 2013-2016 Apple Inc. All rights reserved. 5 5 * 6 6 * This library is free software; you can redistribute it and/or … … 120 120 AtomicStringTable* atomicStringTable() const { return vm().atomicStringTable(); } 121 121 const CommonIdentifiers& propertyNames() const { return *vm().propertyNames; } 122 const ArgList& emptyList() const { return *vm().emptyList; }122 const MarkedArgumentBuffer& emptyList() const { return *vm().emptyList; } 123 123 Interpreter* interpreter() { return vm().interpreter; } 124 124 Heap* heap() { return &vm().heap; } -
trunk/Source/JavaScriptCore/interpreter/Interpreter.cpp
r212618 r212665 1 1 /* 2 * Copyright (C) 2008-201 7Apple Inc. All rights reserved.2 * Copyright (C) 2008-2010, 2012-2016 Apple Inc. All rights reserved. 3 3 * Copyright (C) 2008 Cameron Zwarich <cwzwarich@uwaterloo.ca> 4 4 * … … 1006 1006 } 1007 1007 1008 CallFrameClosure Interpreter::prepareForRepeatCall(FunctionExecutable* functionExecutable, CallFrame* callFrame, ProtoCallFrame* protoCallFrame, JSFunction* function, int argumentCountIncludingThis, JSScope* scope, const ArgList&args)1008 CallFrameClosure Interpreter::prepareForRepeatCall(FunctionExecutable* functionExecutable, CallFrame* callFrame, ProtoCallFrame* protoCallFrame, JSFunction* function, int argumentCountIncludingThis, JSScope* scope, JSValue* args) 1009 1009 { 1010 1010 VM& vm = *scope->vm(); … … 1026 1026 size_t argsCount = argumentCountIncludingThis; 1027 1027 1028 protoCallFrame->init(newCodeBlock, function, jsUndefined(), argsCount, args .data());1028 protoCallFrame->init(newCodeBlock, function, jsUndefined(), argsCount, args); 1029 1029 // Return the successful closure: 1030 1030 CallFrameClosure result = { callFrame, protoCallFrame, function, functionExecutable, &vm, scope, newCodeBlock->numParameters(), argumentCountIncludingThis }; -
trunk/Source/JavaScriptCore/interpreter/Interpreter.h
r212618 r212665 1 1 /* 2 * Copyright (C) 2008 -2017Apple Inc. All rights reserved.2 * Copyright (C) 2008, 2013, 2015-2016 Apple Inc. All rights reserved. 3 3 * Copyright (C) 2012 Research In Motion Limited. All rights reserved. 4 4 * … … 155 155 enum ExecutionFlag { Normal, InitializeAndReturn }; 156 156 157 CallFrameClosure prepareForRepeatCall(FunctionExecutable*, CallFrame*, ProtoCallFrame*, JSFunction*, int argumentCountIncludingThis, JSScope*, const ArgList&);157 CallFrameClosure prepareForRepeatCall(FunctionExecutable*, CallFrame*, ProtoCallFrame*, JSFunction*, int argumentCountIncludingThis, JSScope*, JSValue*); 158 158 159 159 JSValue execute(CallFrameClosure&); -
trunk/Source/JavaScriptCore/interpreter/ProtoCallFrame.h
r212618 r212665 1 1 /* 2 * Copyright (C) 2013 -2017Apple Inc. All Rights Reserved.2 * Copyright (C) 2013 Apple Inc. All Rights Reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 27 27 28 28 #include "Register.h" 29 #include <wtf/ForbidHeapAllocation.h>30 29 31 30 namespace JSC { 32 31 33 32 struct JS_EXPORT_PRIVATE ProtoCallFrame { 34 WTF_FORBID_HEAP_ALLOCATION;35 public:36 33 Register codeBlockValue; 37 34 Register calleeValue; -
trunk/Source/JavaScriptCore/runtime/ArgList.cpp
r212618 r212665 1 1 /* 2 * Copyright (C) 2003 -2017Apple Inc. All rights reserved.2 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2009, 2016 Apple Inc. All rights reserved. 3 3 * 4 4 * This library is free software; you can redistribute it and/or … … 64 64 } 65 65 66 void MarkedArgumentBuffer::slowEnsureCapacity(size_t requestedCapacity)67 {68 int newCapacity = Checked<int>(requestedCapacity).unsafeGet();69 expandCapacity(newCapacity);70 }71 72 66 void MarkedArgumentBuffer::expandCapacity() 73 67 { 74 68 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);81 69 size_t size = (Checked<size_t>(newCapacity) * sizeof(EncodedJSValue)).unsafeGet(); 82 70 EncodedJSValue* newBuffer = static_cast<EncodedJSValue*>(fastMalloc(size)); -
trunk/Source/JavaScriptCore/runtime/ArgList.h
r212620 r212665 1 1 /* 2 2 * Copyright (C) 1999-2001 Harri Porten (porten@kde.org) 3 * Copyright (C) 2003 -2017Apple Inc. All rights reserved.3 * Copyright (C) 2003, 2007, 2008, 2009, 2016 Apple Inc. All rights reserved. 4 4 * 5 5 * This library is free software; you can redistribute it and/or … … 23 23 24 24 #include "CallFrame.h" 25 #include <wtf/ForbidHeapAllocation.h>26 25 #include <wtf/HashSet.h> 27 26 … … 30 29 class MarkedArgumentBuffer { 31 30 WTF_MAKE_NONCOPYABLE(MarkedArgumentBuffer); 32 WTF_FORBID_HEAP_ALLOCATION;33 31 friend class VM; 34 32 friend class ArgList; … … 97 95 static void markLists(SlotVisitor&, ListSet&); 98 96 99 void ensureCapacity(size_t requestedCapacity)100 {101 if (requestedCapacity > static_cast<size_t>(m_capacity))102 slowEnsureCapacity(requestedCapacity);103 }104 105 97 private: 106 98 void expandCapacity(); 107 void expandCapacity(int newCapacity);108 void slowEnsureCapacity(size_t requestedCapacity);109 99 110 100 void addMarkSet(JSValue); -
trunk/Source/JavaScriptCore/runtime/StringPrototype.cpp
r212618 r212665 1 1 /* 2 2 * Copyright (C) 1999-2001 Harri Porten (porten@kde.org) 3 * Copyright (C) 2004-20 17Apple Inc. All rights reserved.3 * Copyright (C) 2004-2008, 2013, 2016 Apple Inc. All rights reserved. 4 4 * Copyright (C) 2009 Torch Mobile, Inc. 5 5 * Copyright (C) 2015 Jordan Harband (ljharb@gmail.com) … … 540 540 541 541 unsigned i = 0; 542 cachedCall.clearArguments();543 542 for (; i < regExp->numSubpatterns() + 1; ++i) { 544 543 int matchStart = ovector[i * 2]; … … 546 545 547 546 if (matchStart < 0) 548 cachedCall. appendArgument(jsUndefined());547 cachedCall.setArgument(i, jsUndefined()); 549 548 else 550 cachedCall. appendArgument(jsSubstring(&vm, source, matchStart, matchLen));549 cachedCall.setArgument(i, jsSubstring(&vm, source, matchStart, matchLen)); 551 550 } 552 551 553 cachedCall. appendArgument(jsNumber(result.start));554 cachedCall. appendArgument(string);552 cachedCall.setArgument(i++, jsNumber(result.start)); 553 cachedCall.setArgument(i++, string); 555 554 556 555 cachedCall.setThis(jsUndefined()); … … 580 579 581 580 unsigned i = 0; 582 cachedCall.clearArguments();583 581 for (; i < regExp->numSubpatterns() + 1; ++i) { 584 582 int matchStart = ovector[i * 2]; … … 586 584 587 585 if (matchStart < 0) 588 cachedCall. appendArgument(jsUndefined());586 cachedCall.setArgument(i, jsUndefined()); 589 587 else 590 cachedCall. appendArgument(jsSubstring(&vm, source, matchStart, matchLen));588 cachedCall.setArgument(i, jsSubstring(&vm, source, matchStart, matchLen)); 591 589 } 592 590 593 cachedCall. appendArgument(jsNumber(result.start));594 cachedCall. appendArgument(string);591 cachedCall.setArgument(i++, jsNumber(result.start)); 592 cachedCall.setArgument(i++, string); 595 593 596 594 cachedCall.setThis(jsUndefined()); -
trunk/Source/JavaScriptCore/runtime/VM.cpp
r212618 r212665 181 181 , m_atomicStringTable(vmType == Default ? wtfThreadData().atomicStringTable() : new AtomicStringTable) 182 182 , propertyNames(nullptr) 183 , emptyList(new ArgList)183 , emptyList(new MarkedArgumentBuffer) 184 184 , machineCodeBytesPerBytecodeWordForBaselineJIT(std::make_unique<SimpleStats>()) 185 185 , customGetterSetterFunctionMap(*this) -
trunk/Source/JavaScriptCore/runtime/VM.h
r212618 r212665 386 386 TemplateRegistryKeyTable m_templateRegistryKeytable; 387 387 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. 389 389 SmallStrings smallStrings; 390 390 NumericStrings numericStrings; -
trunk/Source/WTF/ChangeLog
r212627 r212665 1 2017-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 1 15 2017-02-20 Carlos Garcia Campos <cgarcia@igalia.com> 2 16 -
trunk/Source/WTF/WTF.xcodeproj/project.pbxproj
r212618 r212665 369 369 EB95E1F0161A72410089A2F5 /* ByteOrder.h in Headers */ = {isa = PBXBuildFile; fileRef = EB95E1EF161A72410089A2F5 /* ByteOrder.h */; }; 370 370 FE8225311B2A1E5B00BA68FD /* NakedPtr.h in Headers */ = {isa = PBXBuildFile; fileRef = FE8225301B2A1E5B00BA68FD /* NakedPtr.h */; }; 371 FE86A8751E59440200111BBF /* ForbidHeapAllocation.h in Headers */ = {isa = PBXBuildFile; fileRef = FE86A8741E59440200111BBF /* ForbidHeapAllocation.h */; };372 371 FE8925B01D00DAEC0046907E /* Indenter.h in Headers */ = {isa = PBXBuildFile; fileRef = FE8925AF1D00DAEC0046907E /* Indenter.h */; }; 373 372 FEDACD3D1630F83F00C69634 /* StackStats.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FEDACD3B1630F83F00C69634 /* StackStats.cpp */; }; … … 753 752 F72BBDB107FA424886178B9E /* SymbolImpl.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SymbolImpl.cpp; sourceTree = "<group>"; }; 754 753 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>"; };756 754 FE8925AF1D00DAEC0046907E /* Indenter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Indenter.h; sourceTree = "<group>"; }; 757 755 FEDACD3B1630F83F00C69634 /* StackStats.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = StackStats.cpp; sourceTree = "<group>"; }; … … 965 963 0F9D335C165DBA73005AD387 /* FilePrintStream.h */, 966 964 0F2B66A517B6B4F700A7AE3F /* FlipBytes.h */, 967 FE86A8741E59440200111BBF /* ForbidHeapAllocation.h */,968 965 A8A472A6151A825A004123FF /* Forward.h */, 969 966 83F2BADE1CF9524E003E99C3 /* Function.h */, … … 1422 1419 1A1D8B9C173186CE00141DA4 /* FunctionDispatcher.h in Headers */, 1423 1420 A8A473CA151A825B004123FF /* GetPtr.h in Headers */, 1424 FE86A8751E59440200111BBF /* ForbidHeapAllocation.h in Headers */,1425 1421 0FEC84AF1BD825310080FF74 /* GraphNodeWorklist.h in Headers */, 1426 1422 2C05385415BC819000F21B96 /* GregorianDateTime.h in Headers */,
Note: See TracChangeset
for help on using the changeset viewer.