Changeset 203081 in webkit
- Timestamp:
- Jul 11, 2016, 1:48:15 PM (9 years ago)
- Location:
- trunk/Source/JavaScriptCore
- Files:
-
- 33 edited
- 3 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/CMakeLists.txt
r202987 r203081 508 508 509 509 interpreter/AbstractPC.cpp 510 interpreter/CLoopStack.cpp 510 511 interpreter/CallFrame.cpp 511 512 interpreter/Interpreter.cpp 512 interpreter/JSStack.cpp513 513 interpreter/ProtoCallFrame.cpp 514 514 interpreter/ShadowChicken.cpp -
trunk/Source/JavaScriptCore/ChangeLog
r203076 r203081 1 2016-07-11 Mark Lam <mark.lam@apple.com> 2 3 Refactor JSStack to only be the stack data structure for the C Loop. 4 https://bugs.webkit.org/show_bug.cgi?id=159545 5 6 Reviewed by Geoffrey Garen. 7 8 Changes made: 9 1. Renamed JSStack to CLoopStack. 10 2. Made all of CLoopStack code to conditional on #if !ENABLE(JIT) i.e. they will 11 only be in effect for the C Loop build. 12 3. Changed clients of JSStack to use new equivalent VM APIs: 13 a. JSStack::ensureCapacityFor() => VM::ensureStackCapacityFor() 14 b. JSStack::committedByteCount() => VM::committedStackByteCount() 15 4. Made VM::updateReservedZoneSize() call CLoopStack::setReservedZoneSize() 16 instead of calling it from all the clients of VM::updateReservedZoneSize(). 17 5. Removed all unnecessary references to JSStack. 18 19 * CMakeLists.txt: 20 * JavaScriptCore.xcodeproj/project.pbxproj: 21 * assembler/MaxFrameExtentForSlowPathCall.h: 22 * bytecode/BytecodeConventions.h: 23 * dfg/DFGGraph.h: 24 * dfg/DFGOSREntry.cpp: 25 (JSC::DFG::prepareOSREntry): 26 * ftl/FTLOSREntry.cpp: 27 (JSC::FTL::prepareOSREntry): 28 * heap/Heap.cpp: 29 (JSC::Heap::finalizeUnconditionalFinalizers): 30 (JSC::Heap::willStartIterating): 31 (JSC::Heap::gatherJSStackRoots): 32 (JSC::Heap::stack): Deleted. 33 * heap/Heap.h: 34 * interpreter/CLoopStack.cpp: Copied from Source/JavaScriptCore/interpreter/JSStack.cpp. 35 (JSC::commitSize): 36 (JSC::CLoopStack::CLoopStack): 37 (JSC::CLoopStack::~CLoopStack): 38 (JSC::CLoopStack::grow): 39 (JSC::CLoopStack::gatherConservativeRoots): 40 (JSC::CLoopStack::sanitizeStack): 41 (JSC::CLoopStack::releaseExcessCapacity): 42 (JSC::CLoopStack::addToCommittedByteCount): 43 (JSC::CLoopStack::setReservedZoneSize): 44 (JSC::CLoopStack::committedByteCount): 45 (JSC::JSStack::JSStack): Deleted. 46 (JSC::JSStack::~JSStack): Deleted. 47 (JSC::JSStack::growSlowCase): Deleted. 48 (JSC::JSStack::gatherConservativeRoots): Deleted. 49 (JSC::JSStack::sanitizeStack): Deleted. 50 (JSC::JSStack::releaseExcessCapacity): Deleted. 51 (JSC::JSStack::addToCommittedByteCount): Deleted. 52 (JSC::JSStack::setReservedZoneSize): Deleted. 53 (JSC::JSStack::lowAddress): Deleted. 54 (JSC::JSStack::highAddress): Deleted. 55 (JSC::JSStack::committedByteCount): Deleted. 56 * interpreter/CLoopStack.h: Copied from Source/JavaScriptCore/interpreter/JSStack.h. 57 (JSC::CLoopStack::containsAddress): 58 (JSC::CLoopStack::lowAddress): 59 (JSC::CLoopStack::highAddress): 60 (JSC::CLoopStack::reservationTop): 61 (JSC::JSStack::containsAddress): Deleted. 62 (JSC::JSStack::lowAddress): Deleted. 63 (JSC::JSStack::highAddress): Deleted. 64 (JSC::JSStack::reservationTop): Deleted. 65 * interpreter/CLoopStackInlines.h: Copied from Source/JavaScriptCore/interpreter/JSStackInlines.h. 66 (JSC::CLoopStack::ensureCapacityFor): 67 (JSC::CLoopStack::topOfFrameFor): 68 (JSC::CLoopStack::topOfStack): 69 (JSC::CLoopStack::shrink): 70 (JSC::CLoopStack::setCLoopStackLimit): 71 (JSC::JSStack::ensureCapacityFor): Deleted. 72 (JSC::JSStack::topOfFrameFor): Deleted. 73 (JSC::JSStack::topOfStack): Deleted. 74 (JSC::JSStack::shrink): Deleted. 75 (JSC::JSStack::grow): Deleted. 76 (JSC::JSStack::setCLoopStackLimit): Deleted. 77 * interpreter/CallFrame.cpp: 78 (JSC::CallFrame::unsafeCallSiteIndex): 79 (JSC::CallFrame::currentVPC): 80 (JSC::CallFrame::stack): Deleted. 81 * interpreter/CallFrame.h: 82 (JSC::ExecState::callerFrameAndPC): 83 (JSC::ExecState::unsafeCallerFrameAndPC): 84 * interpreter/Interpreter.cpp: 85 (JSC::sizeOfVarargs): 86 (JSC::sizeFrameForForwardArguments): 87 (JSC::sizeFrameForVarargs): 88 (JSC::Interpreter::Interpreter): 89 * interpreter/Interpreter.h: 90 (JSC::Interpreter::cloopStack): 91 (JSC::Interpreter::getOpcode): 92 (JSC::Interpreter::isCallBytecode): 93 (JSC::Interpreter::stack): Deleted. 94 * interpreter/JSStack.cpp: Removed. 95 * interpreter/JSStack.h: Removed. 96 * interpreter/JSStackInlines.h: Removed. 97 * interpreter/StackVisitor.cpp: 98 (JSC::StackVisitor::Frame::dump): 99 * jit/JIT.h: 100 * jit/JITOperations.cpp: 101 * jit/JSInterfaceJIT.h: 102 * jit/SpecializedThunkJIT.h: 103 * jit/ThunkGenerators.cpp: 104 * llint/LLIntOffsetsExtractor.cpp: 105 * llint/LLIntSlowPaths.cpp: 106 (JSC::LLInt::LLINT_SLOW_PATH_DECL): 107 (JSC::LLInt::llint_stack_check_at_vm_entry): 108 * llint/LLIntThunks.cpp: 109 * llint/LowLevelInterpreter.cpp: 110 (JSC::CLoop::execute): 111 * runtime/CommonSlowPaths.cpp: 112 (JSC::SLOW_PATH_DECL): 113 * runtime/CommonSlowPaths.h: 114 (JSC::CommonSlowPaths::arityCheckFor): 115 * runtime/ErrorHandlingScope.cpp: 116 (JSC::ErrorHandlingScope::ErrorHandlingScope): 117 (JSC::ErrorHandlingScope::~ErrorHandlingScope): 118 * runtime/JSGlobalObject.h: 119 * runtime/MemoryStatistics.cpp: 120 (JSC::globalMemoryStatistics): 121 * runtime/StackAlignment.h: 122 * runtime/VM.cpp: 123 (JSC::VM::VM): 124 (JSC::VM::updateReservedZoneSize): 125 (JSC::sanitizeStackForVM): 126 (JSC::VM::committedStackByteCount): 127 * runtime/VM.h: 128 (JSC::VM::reservedZoneSize): 129 (JSC::VM::osStackLimitWithReserve): 130 (JSC::VM::addressOfOSStackLimitWithReserve): 131 * runtime/VMInlines.h: 132 (JSC::VM::ensureStackCapacityFor): 133 (JSC::VM::shouldTriggerTermination): 134 1 135 2016-07-11 Keith Miller <keith_miller@apple.com> 2 136 -
trunk/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj
r202975 r203081 974 974 1428082D107EC0570013E7B2 /* CallData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCA62DFE0E2826230004F30D /* CallData.cpp */; }; 975 975 1428082E107EC0570013E7B2 /* ConstructData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCA62DFF0E2826310004F30D /* ConstructData.cpp */; }; 976 1428083A107EC0750013E7B2 /* JSStack.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1429D85B0ED218E900B89619 /* JSStack.cpp */; };976 1428083A107EC0750013E7B2 /* CLoopStack.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1429D85B0ED218E900B89619 /* CLoopStack.cpp */; }; 977 977 14280841107EC0930013E7B2 /* RegExp.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F692A87D0255597D01FF60F7 /* RegExp.cpp */; }; 978 978 14280842107EC0930013E7B2 /* RegExpConstructor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCD202BD0E1706A7002C7E82 /* RegExpConstructor.cpp */; }; … … 1141 1141 2AF7382D18BBBF92008A5A37 /* StructureIDTable.h in Headers */ = {isa = PBXBuildFile; fileRef = 2AF7382B18BBBF92008A5A37 /* StructureIDTable.h */; settings = {ATTRIBUTES = (Private, ); }; }; 1142 1142 371D842D17C98B6E00ECF994 /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 371D842C17C98B6E00ECF994 /* libz.dylib */; }; 1143 412952771D2CF6BC00E78B89 /* builtins_generate_internals_wrapper_header.py in Headers */ = {isa = PBXBuildFile; fileRef = 412952731D2CF6AC00E78B89 /* builtins_generate_internals_wrapper_header.py */; settings = {ATTRIBUTES = (Private, ); }; }; 1144 412952781D2CF6BC00E78B89 /* builtins_generate_internals_wrapper_implementation.py in Headers */ = {isa = PBXBuildFile; fileRef = 412952741D2CF6AC00E78B89 /* builtins_generate_internals_wrapper_implementation.py */; settings = {ATTRIBUTES = (Private, ); }; }; 1145 412952791D2CF6BC00E78B89 /* builtins_generate_wrapper_header.py in Headers */ = {isa = PBXBuildFile; fileRef = 412952751D2CF6AC00E78B89 /* builtins_generate_wrapper_header.py */; settings = {ATTRIBUTES = (Private, ); }; }; 1146 4129527A1D2CF6BC00E78B89 /* builtins_generate_wrapper_implementation.py in Headers */ = {isa = PBXBuildFile; fileRef = 412952761D2CF6AC00E78B89 /* builtins_generate_wrapper_implementation.py */; settings = {ATTRIBUTES = (Private, ); }; }; 1143 1147 41359CF30FDD89AD00206180 /* DateConversion.h in Headers */ = {isa = PBXBuildFile; fileRef = D21202290AD4310C00ED79B6 /* DateConversion.h */; }; 1144 1148 41DEA1321B9F3163006D65DD /* BuiltinUtils.h in Headers */ = {isa = PBXBuildFile; fileRef = 41DEA1311B9F3154006D65DD /* BuiltinUtils.h */; settings = {ATTRIBUTES = (Private, ); }; }; … … 1475 1479 99DA00A91BD5993100F4575C /* builtins_generate_separate_header.py in Headers */ = {isa = PBXBuildFile; fileRef = 99DA00A01BD5992700F4575C /* builtins_generate_separate_header.py */; settings = {ATTRIBUTES = (Private, ); }; }; 1476 1480 99DA00AA1BD5993100F4575C /* builtins_generate_separate_implementation.py in Headers */ = {isa = PBXBuildFile; fileRef = 99DA00A11BD5992700F4575C /* builtins_generate_separate_implementation.py */; settings = {ATTRIBUTES = (Private, ); }; }; 1477 412952771D2CF6BC00E78B89 /* builtins_generate_internals_wrapper_header.py in Resources */ = {isa = PBXBuildFile; fileRef = 412952731D2CF6AC00E78B89 /* builtins_generate_internals_wrapper_header.py */; settings = {ATTRIBUTES = (Private, ); }; };1478 412952781D2CF6BC00E78B89 /* builtins_generate_internals_wrapper_implementation.py in Resources */ = {isa = PBXBuildFile; fileRef = 412952741D2CF6AC00E78B89 /* builtins_generate_internals_wrapper_implementation.py */; settings = {ATTRIBUTES = (Private, ); }; };1479 412952791D2CF6BC00E78B89 /* builtins_generate_wrapper_header.py in Resources */ = {isa = PBXBuildFile; fileRef = 412952751D2CF6AC00E78B89 /* builtins_generate_wrapper_header.py */; settings = {ATTRIBUTES = (Private, ); }; };1480 4129527A1D2CF6BC00E78B89 /* builtins_generate_wrapper_implementation.py in Resources */ = {isa = PBXBuildFile; fileRef = 412952761D2CF6AC00E78B89 /* builtins_generate_wrapper_implementation.py */; settings = {ATTRIBUTES = (Private, ); }; };1481 1481 99DA00AF1BD5994E00F4575C /* generate-js-builtins.py in Headers */ = {isa = PBXBuildFile; fileRef = 99DA00AC1BD5993E00F4575C /* generate-js-builtins.py */; settings = {ATTRIBUTES = (Private, ); }; }; 1482 1482 99DA00B01BD5994E00F4575C /* lazywriter.py in Headers */ = {isa = PBXBuildFile; fileRef = 99DA00AD1BD5993E00F4575C /* lazywriter.py */; settings = {ATTRIBUTES = (Private, ); }; }; … … 1777 1777 A7C0C4AD1681067E0017011D /* JSScriptRef.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A7C0C4AA167C08CD0017011D /* JSScriptRef.cpp */; }; 1778 1778 A7C1E8E4112E72EF00A37F98 /* JITPropertyAccess32_64.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A7C1E8C8112E701C00A37F98 /* JITPropertyAccess32_64.cpp */; }; 1779 A7C1EAF017987AB600299DB2 /* JSStackInlines.h in Headers */ = {isa = PBXBuildFile; fileRef = A7C1EAEB17987AB600299DB2 /* JSStackInlines.h */; };1779 A7C1EAF017987AB600299DB2 /* CLoopStackInlines.h in Headers */ = {isa = PBXBuildFile; fileRef = A7C1EAEB17987AB600299DB2 /* CLoopStackInlines.h */; }; 1780 1780 A7C1EAF117987AB600299DB2 /* StackVisitor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A7C1EAEC17987AB600299DB2 /* StackVisitor.cpp */; }; 1781 1781 A7C1EAF217987AB600299DB2 /* StackVisitor.h in Headers */ = {isa = PBXBuildFile; fileRef = A7C1EAED17987AB600299DB2 /* StackVisitor.h */; settings = {ATTRIBUTES = (Private, ); }; }; … … 1899 1899 BC18C45B0E16F5CD00B34460 /* RegExpObject.h in Headers */ = {isa = PBXBuildFile; fileRef = F692A87C0255597D01FF60F7 /* RegExpObject.h */; settings = {ATTRIBUTES = (Private, ); }; }; 1900 1900 BC18C45D0E16F5CD00B34460 /* Register.h in Headers */ = {isa = PBXBuildFile; fileRef = 149B24FF0D8AF6D1009CB8C7 /* Register.h */; settings = {ATTRIBUTES = (Private, ); }; }; 1901 BC18C45E0E16F5CD00B34460 /* JSStack.h in Headers */ = {isa = PBXBuildFile; fileRef = 14D792640DAA03FB001A9F05 /* JSStack.h */; settings = {ATTRIBUTES = (Private, ); }; };1901 BC18C45E0E16F5CD00B34460 /* CLoopStack.h in Headers */ = {isa = PBXBuildFile; fileRef = 14D792640DAA03FB001A9F05 /* CLoopStack.h */; settings = {ATTRIBUTES = (Private, ); }; }; 1902 1902 BC18C4630E16F5CD00B34460 /* SourceProvider.h in Headers */ = {isa = PBXBuildFile; fileRef = 65E866ED0DD59AFA00A2B2A1 /* SourceProvider.h */; settings = {ATTRIBUTES = (Private, ); }; }; 1903 1903 BC18C4640E16F5CD00B34460 /* SourceCode.h in Headers */ = {isa = PBXBuildFile; fileRef = 65E866EE0DD59AFA00A2B2A1 /* SourceCode.h */; settings = {ATTRIBUTES = (Private, ); }; }; … … 3151 3151 1429D77B0ED20D7300B89619 /* Interpreter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Interpreter.h; sourceTree = "<group>"; }; 3152 3152 1429D7D30ED2128200B89619 /* Interpreter.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Interpreter.cpp; sourceTree = "<group>"; }; 3153 1429D85B0ED218E900B89619 /* JSStack.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSStack.cpp; sourceTree = "<group>"; };3153 1429D85B0ED218E900B89619 /* CLoopStack.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CLoopStack.cpp; sourceTree = "<group>"; }; 3154 3154 1429D8770ED21ACD00B89619 /* ExceptionHelpers.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ExceptionHelpers.cpp; sourceTree = "<group>"; }; 3155 3155 1429D8DB0ED2205B00B89619 /* CallFrame.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CallFrame.cpp; sourceTree = "<group>"; }; … … 3233 3233 14D2F3D8139F4BE200491031 /* MarkedSpace.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MarkedSpace.cpp; sourceTree = "<group>"; }; 3234 3234 14D2F3D9139F4BE200491031 /* MarkedSpace.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MarkedSpace.h; sourceTree = "<group>"; }; 3235 14D792640DAA03FB001A9F05 /* JSStack.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSStack.h; sourceTree = "<group>"; };3235 14D792640DAA03FB001A9F05 /* CLoopStack.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CLoopStack.h; sourceTree = "<group>"; }; 3236 3236 14D844A216AA2C7000A65AF0 /* PrototypeMap.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PrototypeMap.cpp; sourceTree = "<group>"; }; 3237 3237 14D844A316AA2C7000A65AF0 /* PrototypeMap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PrototypeMap.h; sourceTree = "<group>"; }; … … 4008 4008 A7C0C4AB167C08CD0017011D /* JSScriptRefPrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSScriptRefPrivate.h; sourceTree = "<group>"; }; 4009 4009 A7C1E8C8112E701C00A37F98 /* JITPropertyAccess32_64.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JITPropertyAccess32_64.cpp; sourceTree = "<group>"; }; 4010 A7C1EAEB17987AB600299DB2 /* JSStackInlines.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSStackInlines.h; sourceTree = "<group>"; };4010 A7C1EAEB17987AB600299DB2 /* CLoopStackInlines.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CLoopStackInlines.h; sourceTree = "<group>"; }; 4011 4011 A7C1EAEC17987AB600299DB2 /* StackVisitor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = StackVisitor.cpp; sourceTree = "<group>"; }; 4012 4012 A7C1EAED17987AB600299DB2 /* StackVisitor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StackVisitor.h; sourceTree = "<group>"; }; … … 5001 5001 0F55F0F114D1063600AC7649 /* AbstractPC.cpp */, 5002 5002 0F55F0F214D1063600AC7649 /* AbstractPC.h */, 5003 1429D85B0ED218E900B89619 /* CLoopStack.cpp */, 5004 14D792640DAA03FB001A9F05 /* CLoopStack.h */, 5005 A7C1EAEB17987AB600299DB2 /* CLoopStackInlines.h */, 5003 5006 A7F8690E0F9584A100558697 /* CachedCall.h */, 5004 5007 1429D8DB0ED2205B00B89619 /* CallFrame.cpp */, … … 5007 5010 1429D7D30ED2128200B89619 /* Interpreter.cpp */, 5008 5011 1429D77B0ED20D7300B89619 /* Interpreter.h */, 5009 1429D85B0ED218E900B89619 /* JSStack.cpp */,5010 14D792640DAA03FB001A9F05 /* JSStack.h */,5011 A7C1EAEB17987AB600299DB2 /* JSStackInlines.h */,5012 5012 65FB5116184EE9BC00C12B70 /* ProtoCallFrame.cpp */, 5013 5013 65FB5115184EE8F800C12B70 /* ProtoCallFrame.h */, … … 7806 7806 A7299D9E17D12837005F5FF9 /* JSSet.h in Headers */, 7807 7807 A790DD70182F499700588807 /* JSSetIterator.h in Headers */, 7808 BC18C45E0E16F5CD00B34460 /* JSStack.h in Headers */,7809 A7C1EAF017987AB600299DB2 /* JSStackInlines.h in Headers */,7808 BC18C45E0E16F5CD00B34460 /* CLoopStack.h in Headers */, 7809 A7C1EAF017987AB600299DB2 /* CLoopStackInlines.h in Headers */, 7810 7810 BC18C4270E16F5CD00B34460 /* JSString.h in Headers */, 7811 7811 86E85539111B9968001AF51E /* JSStringBuilder.h in Headers */, … … 9219 9219 A7299D9D17D12837005F5FF9 /* JSSet.cpp in Sources */, 9220 9220 A790DD6F182F499700588807 /* JSSetIterator.cpp in Sources */, 9221 1428083A107EC0750013E7B2 /* JSStack.cpp in Sources */,9221 1428083A107EC0750013E7B2 /* CLoopStack.cpp in Sources */, 9222 9222 147F39D5107EC37600427A48 /* JSString.cpp in Sources */, 9223 9223 70EC0EC21AA0D7DA00B6AAFA /* JSStringIterator.cpp in Sources */, -
trunk/Source/JavaScriptCore/assembler/MaxFrameExtentForSlowPathCall.h
r170147 r203081 1 1 /* 2 * Copyright (C) 2013 Apple Inc. All rights reserved.2 * Copyright (C) 2013, 2016 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 27 27 #define MaxFrameExtentForSlowPathCall_h 28 28 29 #include "JSStack.h"30 29 #include "Register.h" 31 30 #include "StackAlignment.h" -
trunk/Source/JavaScriptCore/bytecode/BytecodeConventions.h
r130726 r203081 1 1 /* 2 * Copyright (C) 2012 Apple Inc. All rights reserved.2 * Copyright (C) 2012, 2016 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 28 28 29 29 // Register numbers used in bytecode operations have different meaning according to their ranges: 30 // 0x80000000-0xFFFFFFFF Negative indices from the CallFrame pointer are entries in the call frame , see JSStack.h.30 // 0x80000000-0xFFFFFFFF Negative indices from the CallFrame pointer are entries in the call frame. 31 31 // 0x00000000-0x3FFFFFFF Forwards indices from the CallFrame pointer are local vars and temporaries with the function's callframe. 32 32 // 0x40000000-0x7FFFFFFF Positive indices from 0x40000000 specify entries in the constant pool on the CodeBlock. -
trunk/Source/JavaScriptCore/dfg/DFGGraph.h
r203006 r203081 1 1 /* 2 * Copyright (C) 2011-201 5Apple Inc. All rights reserved.2 * Copyright (C) 2011-2016 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 42 42 #include "DFGScannable.h" 43 43 #include "FullBytecodeLiveness.h" 44 #include "JSStack.h"45 44 #include "MethodOfGettingAValueProfile.h" 46 45 #include <unordered_map> -
trunk/Source/JavaScriptCore/dfg/DFGOSREntry.cpp
r203006 r203081 34 34 #include "DFGNode.h" 35 35 #include "JIT.h" 36 #include "JSStackInlines.h"37 36 #include "JSCInlines.h" 37 #include "VMInlines.h" 38 38 #include <wtf/CommaPrinter.h> 39 39 … … 245 245 246 246 unsigned frameSizeForCheck = jitCode->common.requiredRegisterCountForExecutionAndExit(); 247 if ( !vm->interpreter->stack().ensureCapacityFor(&exec->registers()[virtualRegisterForLocal(frameSizeForCheck - 1).offset()])) {247 if (UNLIKELY(!vm->ensureStackCapacityFor(&exec->registers()[virtualRegisterForLocal(frameSizeForCheck - 1).offset()]))) { 248 248 if (Options::verboseOSR()) 249 249 dataLogF(" OSR failed because stack growth failed.\n"); -
trunk/Source/JavaScriptCore/ftl/FTLOSREntry.cpp
r192937 r203081 1 1 /* 2 * Copyright (C) 2013 , 2014Apple Inc. All rights reserved.2 * Copyright (C) 2013-2014, 2016 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 31 31 #include "DFGJITCode.h" 32 32 #include "FTLForOSREntryJITCode.h" 33 #include "JSStackInlines.h"34 33 #include "OperandsInlines.h" 35 34 #include "JSCInlines.h" 35 #include "VMInlines.h" 36 36 37 37 #if ENABLE(FTL_JIT) … … 93 93 94 94 int stackFrameSize = entryCode->common.requiredRegisterCountForExecutionAndExit(); 95 if ( !vm.interpreter->stack().ensureCapacityFor(&exec->registers()[virtualRegisterForLocal(stackFrameSize - 1).offset()])) {95 if (UNLIKELY(!vm.ensureStackCapacityFor(&exec->registers()[virtualRegisterForLocal(stackFrameSize - 1).offset()]))) { 96 96 if (Options::verboseOSR()) 97 97 dataLog(" OSR failed because stack growth failed.\n"); -
trunk/Source/JavaScriptCore/heap/Heap.cpp
r203000 r203081 487 487 } 488 488 489 inline JSStack& Heap::stack()490 {491 return m_vm->interpreter->stack();492 }493 494 489 void Heap::willStartIterating() 495 490 { … … 682 677 #if !ENABLE(JIT) 683 678 GCPHASE(GatherJSStackRoots); 684 stack().gatherConservativeRoots(roots, m_jitStubRoutines, m_codeBlocks);679 m_vm->interpreter->cloopStack().gatherConservativeRoots(roots, m_jitStubRoutines, m_codeBlocks); 685 680 #else 686 681 UNUSED_PARAM(roots); -
trunk/Source/JavaScriptCore/heap/Heap.h
r202827 r203081 67 67 class JITStubRoutine; 68 68 class JSCell; 69 class JSStack;70 69 class JSValue; 71 70 class LLIntOffsetsExtractor; … … 356 355 bool shouldDoFullCollection(HeapOperation requestedCollectionType) const; 357 356 358 JSStack& stack();359 360 357 void incrementDeferralDepth(); 361 358 void decrementDeferralDepth(); -
trunk/Source/JavaScriptCore/interpreter/CLoopStack.cpp
r203080 r203081 28 28 29 29 #include "config.h" 30 #include " JSStackInlines.h"30 #include "CLoopStack.h" 31 31 32 #if !ENABLE(JIT) 33 34 #include "CLoopStackInlines.h" 32 35 #include "ConservativeRoots.h" 33 36 #include "Interpreter.h" … … 38 41 namespace JSC { 39 42 40 #if !ENABLE(JIT)41 43 static size_t committedBytesCount = 0; 42 44 … … 48 50 49 51 static StaticLock stackStatisticsMutex; 50 #endif // !ENABLE(JIT)51 52 52 JSStack::JSStack(VM& vm)53 CLoopStack::CLoopStack(VM& vm) 53 54 : m_vm(vm) 54 55 , m_topCallFrame(vm.topCallFrame) 55 #if !ENABLE(JIT)56 56 , m_end(0) 57 57 , m_reservedZoneSizeInRegisters(0) 58 #endif59 58 { 60 #if !ENABLE(JIT)61 59 size_t capacity = Options::maxPerThreadStackUsage(); 62 60 ASSERT(capacity && isPageAligned(capacity)); … … 67 65 68 66 m_lastStackTop = baseOfStack(); 69 #endif // !ENABLE(JIT)70 67 71 68 m_topCallFrame = 0; 72 69 } 73 70 74 #if !ENABLE(JIT) 75 JSStack::~JSStack() 71 CLoopStack::~CLoopStack() 76 72 { 77 73 ptrdiff_t sizeToDecommit = reinterpret_cast<char*>(highAddress()) - reinterpret_cast<char*>(m_commitTop); … … 81 77 } 82 78 83 bool JSStack::growSlowCase(Register* newTopOfStack)79 bool CLoopStack::grow(Register* newTopOfStack) 84 80 { 85 81 Register* newTopOfStackWithReservedZone = newTopOfStack - m_reservedZoneSizeInRegisters; … … 109 105 } 110 106 111 void JSStack::gatherConservativeRoots(ConservativeRoots& conservativeRoots, JITStubRoutineSet& jitStubRoutines, CodeBlockSet& codeBlocks)107 void CLoopStack::gatherConservativeRoots(ConservativeRoots& conservativeRoots, JITStubRoutineSet& jitStubRoutines, CodeBlockSet& codeBlocks) 112 108 { 113 109 conservativeRoots.add(topOfStack() + 1, highAddress(), jitStubRoutines, codeBlocks); 114 110 } 115 111 116 void JSStack::sanitizeStack()112 void CLoopStack::sanitizeStack() 117 113 { 118 114 #if !ASAN_ENABLED … … 129 125 } 130 126 131 void JSStack::releaseExcessCapacity()127 void CLoopStack::releaseExcessCapacity() 132 128 { 133 129 Register* highAddressWithReservedZone = highAddress() - m_reservedZoneSizeInRegisters; … … 138 134 } 139 135 140 void JSStack::addToCommittedByteCount(long byteCount)136 void CLoopStack::addToCommittedByteCount(long byteCount) 141 137 { 142 138 LockHolder locker(stackStatisticsMutex); … … 145 141 } 146 142 147 void JSStack::setReservedZoneSize(size_t reservedZoneSize)143 void CLoopStack::setReservedZoneSize(size_t reservedZoneSize) 148 144 { 149 145 m_reservedZoneSizeInRegisters = reservedZoneSize / sizeof(Register); 150 146 if (m_commitTop >= (m_end + 1) - m_reservedZoneSizeInRegisters) 151 growSlowCase(m_end + 1); 152 } 153 #endif // !ENABLE(JIT) 154 155 #if ENABLE(JIT) 156 Register* JSStack::lowAddress() const 157 { 158 ASSERT(wtfThreadData().stack().isGrowingDownward()); 159 return reinterpret_cast<Register*>(m_vm.osStackLimitWithReserve()); 147 grow(m_end + 1); 160 148 } 161 149 162 Register* JSStack::highAddress() const 150 size_t CLoopStack::committedByteCount() 163 151 { 164 ASSERT(wtfThreadData().stack().isGrowingDownward());165 return reinterpret_cast<Register*>(wtfThreadData().stack().origin());166 }167 #endif // ENABLE(JIT)168 169 size_t JSStack::committedByteCount()170 {171 #if !ENABLE(JIT)172 152 LockHolder locker(stackStatisticsMutex); 173 153 return committedBytesCount; 174 #else175 // When using the C stack, we don't know how many stack pages are actually176 // committed. So, we use the current stack usage as an estimate.177 ASSERT(wtfThreadData().stack().isGrowingDownward());178 int8_t* current = reinterpret_cast<int8_t*>(¤t);179 int8_t* high = reinterpret_cast<int8_t*>(wtfThreadData().stack().origin());180 return high - current;181 #endif182 154 } 183 155 184 156 } // namespace JSC 157 158 #endif // !ENABLE(JIT) -
trunk/Source/JavaScriptCore/interpreter/CLoopStack.h
r203080 r203081 27 27 */ 28 28 29 #ifndef JSStack_h 30 #define JSStack_h 29 #pragma once 30 31 #if !ENABLE(JIT) 31 32 32 33 #include "Register.h" … … 43 44 class LLIntOffsetsExtractor; 44 45 45 class JSStack {46 WTF_MAKE_NONCOPYABLE( JSStack);46 class CLoopStack { 47 WTF_MAKE_NONCOPYABLE(CLoopStack); 47 48 public: 48 49 // Allow 8k of excess registers before we start trying to reap the stack 49 50 static const ptrdiff_t maxExcessCapacity = 8 * 1024; 50 51 51 JSStack(VM&); 52 CLoopStack(VM&); 53 ~CLoopStack(); 52 54 53 55 bool ensureCapacityFor(Register* newTopOfStack); … … 55 57 bool containsAddress(Register* address) { return (lowAddress() <= address && address < highAddress()); } 56 58 static size_t committedByteCount(); 57 58 #if !ENABLE(JIT)59 ~JSStack();60 59 61 60 void gatherConservativeRoots(ConservativeRoots&, JITStubRoutineSet&, CodeBlockSet&); … … 72 71 73 72 inline Register* topOfStack(); 74 #endif // ENABLE(JIT)75 73 76 74 private: 77 75 78 #if !ENABLE(JIT)79 76 Register* lowAddress() const 80 77 { … … 86 83 return reinterpret_cast_ptr<Register*>(static_cast<char*>(m_reservation.base()) + m_reservation.size()); 87 84 } 88 #else89 Register* lowAddress() const;90 Register* highAddress() const;91 #endif // !ENABLE(JIT)92 85 93 #if !ENABLE(JIT)94 86 inline Register* topOfFrameFor(CallFrame*); 95 87 … … 101 93 102 94 bool grow(Register* newTopOfStack); 103 bool growSlowCase(Register* newTopOfStack);104 95 void shrink(Register* newTopOfStack); 105 96 void releaseExcessCapacity(); … … 107 98 108 99 void setCLoopStackLimit(Register* newTopOfStack); 109 #endif // !ENABLE(JIT)110 100 111 101 VM& m_vm; 112 102 CallFrame*& m_topCallFrame; 113 #if !ENABLE(JIT)114 103 Register* m_end; 115 104 Register* m_commitTop; … … 117 106 Register* m_lastStackTop; 118 107 ptrdiff_t m_reservedZoneSizeInRegisters; 119 #endif // !ENABLE(JIT)120 108 121 109 friend class LLIntOffsetsExtractor; … … 124 112 } // namespace JSC 125 113 126 #endif // JSStack_h114 #endif // !ENABLE(JIT) -
trunk/Source/JavaScriptCore/interpreter/CLoopStackInlines.h
r203080 r203081 24 24 */ 25 25 26 #ifndef JSStackInlines_h 27 #define JSStackInlines_h 26 #pragma once 28 27 28 #if !ENABLE(JIT) 29 30 #include "CLoopStack.h" 29 31 #include "CallFrame.h" 30 32 #include "CodeBlock.h" 31 #include "JSStack.h"32 33 #include "VM.h" 33 34 34 35 namespace JSC { 35 36 36 inline bool JSStack::ensureCapacityFor(Register* newTopOfStack)37 inline bool CLoopStack::ensureCapacityFor(Register* newTopOfStack) 37 38 { 38 #if !ENABLE(JIT) 39 Register* newEnd = newTopOfStack - 1; 40 if (newEnd >= m_end) 41 return true; 39 42 return grow(newTopOfStack); 40 #else41 ASSERT(wtfThreadData().stack().isGrowingDownward());42 return newTopOfStack >= m_vm.osStackLimitWithReserve();43 #endif44 43 } 45 44 46 #if !ENABLE(JIT) 47 48 inline Register* JSStack::topOfFrameFor(CallFrame* frame) 45 inline Register* CLoopStack::topOfFrameFor(CallFrame* frame) 49 46 { 50 47 if (UNLIKELY(!frame)) … … 53 50 } 54 51 55 inline Register* JSStack::topOfStack()52 inline Register* CLoopStack::topOfStack() 56 53 { 57 54 return topOfFrameFor(m_topCallFrame); 58 55 } 59 56 60 inline void JSStack::shrink(Register* newTopOfStack)57 inline void CLoopStack::shrink(Register* newTopOfStack) 61 58 { 62 59 Register* newEnd = newTopOfStack - 1; … … 67 64 // invoke std::max() with it as an argument. To work around this, we first 68 65 // assign the constant to a local variable, and use the local instead. 69 ptrdiff_t maxExcessCapacity = JSStack::maxExcessCapacity;66 ptrdiff_t maxExcessCapacity = CLoopStack::maxExcessCapacity; 70 67 ptrdiff_t maxExcessInRegisters = std::max(maxExcessCapacity, m_reservedZoneSizeInRegisters); 71 68 if (m_end == baseOfStack() && (highAddress() - m_commitTop) >= maxExcessInRegisters) … … 73 70 } 74 71 75 inline bool JSStack::grow(Register* newTopOfStack) 76 { 77 Register* newEnd = newTopOfStack - 1; 78 if (newEnd >= m_end) 79 return true; 80 return growSlowCase(newTopOfStack); 81 } 82 83 inline void JSStack::setCLoopStackLimit(Register* newTopOfStack) 72 inline void CLoopStack::setCLoopStackLimit(Register* newTopOfStack) 84 73 { 85 74 Register* newEnd = newTopOfStack - 1; … … 88 77 } 89 78 90 #endif // !ENABLE(JIT)91 92 79 } // namespace JSC 93 80 94 #endif // JSStackInlines_h81 #endif // !ENABLE(JIT) -
trunk/Source/JavaScriptCore/interpreter/CallFrame.cpp
r203006 r203081 1 1 /* 2 * Copyright (C) 2008, 2013 , 2014Apple Inc. All Rights Reserved.2 * Copyright (C) 2008, 2013-2014, 2016 Apple Inc. All Rights Reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 104 104 } 105 105 106 #ifndef NDEBUG107 JSStack* CallFrame::stack()108 {109 return &interpreter()->stack();110 }111 112 #endif113 114 106 #if USE(JSVALUE32_64) 115 107 Instruction* CallFrame::currentVPC() const -
trunk/Source/JavaScriptCore/interpreter/CallFrame.h
r203006 r203081 271 271 private: 272 272 273 #ifndef NDEBUG274 JSStack* stack();275 #endif276 273 ExecState(); 277 274 ~ExecState(); … … 302 299 const CallerFrameAndPC& callerFrameAndPC() const { return *reinterpret_cast<const CallerFrameAndPC*>(this); } 303 300 SUPPRESS_ASAN const CallerFrameAndPC& unsafeCallerFrameAndPC() const { return *reinterpret_cast<const CallerFrameAndPC*>(this); } 304 305 #if !ENABLE(JIT)306 friend class JSStack;307 #endif308 301 }; 309 302 -
trunk/Source/JavaScriptCore/interpreter/Interpreter.cpp
r203006 r203081 49 49 #include "JSLexicalEnvironment.h" 50 50 #include "JSModuleEnvironment.h" 51 #include "JSStackInlines.h"52 51 #include "JSString.h" 53 52 #include "JSWithScope.h" … … 236 235 } 237 236 238 unsigned sizeFrameForForwardArguments(CallFrame* callFrame, JSStack* stack, unsigned numUsedStackSlots)237 unsigned sizeFrameForForwardArguments(CallFrame* callFrame, VM& vm, unsigned numUsedStackSlots) 239 238 { 240 239 unsigned length = callFrame->argumentCount(); 241 240 CallFrame* calleeFrame = calleeFrameForVarargs(callFrame, numUsedStackSlots, length + 1); 242 if ( !stack->ensureCapacityFor(calleeFrame->registers()))241 if (UNLIKELY(!vm.ensureStackCapacityFor(calleeFrame->registers()))) 243 242 throwStackOverflowError(callFrame); 244 243 … … 246 245 } 247 246 248 unsigned sizeFrameForVarargs(CallFrame* callFrame, JSStack* stack, JSValue arguments, unsigned numUsedStackSlots, uint32_t firstVarArgOffset)247 unsigned sizeFrameForVarargs(CallFrame* callFrame, VM& vm, JSValue arguments, unsigned numUsedStackSlots, uint32_t firstVarArgOffset) 249 248 { 250 249 unsigned length = sizeOfVarargs(callFrame, arguments, firstVarArgOffset); 251 250 252 251 CallFrame* calleeFrame = calleeFrameForVarargs(callFrame, numUsedStackSlots, length + 1); 253 if ( length > maxArguments || !stack->ensureCapacityFor(calleeFrame->registers())) {252 if (UNLIKELY(length > maxArguments || !vm.ensureStackCapacityFor(calleeFrame->registers()))) { 254 253 throwStackOverflowError(callFrame); 255 254 return 0; … … 324 323 Interpreter::Interpreter(VM& vm) 325 324 : m_vm(vm) 326 , m_stack(vm) 325 #if !ENABLE(JIT) 326 , m_cloopStack(vm) 327 #endif 327 328 , m_errorHandlingModeReentry(0) 328 329 #if !ASSERT_DISABLED -
trunk/Source/JavaScriptCore/interpreter/Interpreter.h
r203006 r203081 35 35 #include "JSCell.h" 36 36 #include "JSObject.h" 37 #include "JSStack.h"38 37 #include "Opcode.h" 39 38 #include "SourceProvider.h" … … 42 41 #include <wtf/HashMap.h> 43 42 #include <wtf/text/StringBuilder.h> 43 44 #if !ENABLE(JIT) 45 #include "CLoopStack.h" 46 #endif 47 44 48 45 49 namespace JSC { … … 181 185 void initialize(); 182 186 183 JSStack& stack() { return m_stack; } 187 #if !ENABLE(JIT) 188 CLoopStack& cloopStack() { return m_cloopStack; } 189 #endif 184 190 185 191 Opcode getOpcode(OpcodeID id) … … 242 248 243 249 VM& m_vm; 244 JSStack m_stack; 250 #if !ENABLE(JIT) 251 CLoopStack m_cloopStack; 252 #endif 245 253 int m_errorHandlingModeReentry; 246 254 … … 274 282 unsigned sizeOfVarargs(CallFrame* exec, JSValue arguments, uint32_t firstVarArgOffset); 275 283 static const unsigned maxArguments = 0x10000; 276 unsigned sizeFrameForVarargs(CallFrame* exec, JSStack*, JSValue arguments, unsigned numUsedStackSlots, uint32_t firstVarArgOffset);277 unsigned sizeFrameForForwardArguments(CallFrame* exec, JSStack*, unsigned numUsedStackSlots);284 unsigned sizeFrameForVarargs(CallFrame* exec, VM&, JSValue arguments, unsigned numUsedStackSlots, uint32_t firstVarArgOffset); 285 unsigned sizeFrameForForwardArguments(CallFrame* exec, VM&, unsigned numUsedStackSlots); 278 286 void loadVarargs(CallFrame* execCaller, VirtualRegister firstElementDest, JSValue source, uint32_t offset, uint32_t length); 279 287 void setupVarargsFrame(CallFrame* execCaller, CallFrame* execCallee, JSValue arguments, uint32_t firstVarArgOffset, uint32_t length); -
trunk/Source/JavaScriptCore/interpreter/StackVisitor.cpp
r202847 r203081 425 425 indent--; 426 426 } 427 out.print(indent, "vmEntryFrame: ", RawPointer(vmEntryFrame()), "\n"); 427 428 indent--; 428 429 } -
trunk/Source/JavaScriptCore/jit/JIT.h
r203006 r203081 60 60 class Interpreter; 61 61 class JSScope; 62 class JSStack;63 62 class MarkedAllocator; 64 63 class Register; -
trunk/Source/JavaScriptCore/jit/JITOperations.cpp
r202890 r203081 52 52 #include "JSLexicalEnvironment.h" 53 53 #include "JSPropertyNameEnumerator.h" 54 #include "JSStackInlines.h"55 54 #include "JSWithScope.h" 56 55 #include "ObjectConstructor.h" … … 130 129 { 131 130 VM* vm = &exec->vm(); 132 JSStack& stack = vm->interpreter->stack(); 133 134 int32_t missingArgCount = CommonSlowPaths::arityCheckFor(exec, &stack, CodeForCall); 131 132 int32_t missingArgCount = CommonSlowPaths::arityCheckFor(exec, *vm, CodeForCall); 135 133 if (missingArgCount < 0) { 136 134 VMEntryFrame* vmEntryFrame = vm->topVMEntryFrame; … … 146 144 { 147 145 VM* vm = &exec->vm(); 148 JSStack& stack = vm->interpreter->stack(); 149 150 int32_t missingArgCount = CommonSlowPaths::arityCheckFor(exec, &stack, CodeForConstruct); 146 147 int32_t missingArgCount = CommonSlowPaths::arityCheckFor(exec, *vm, CodeForConstruct); 151 148 if (missingArgCount < 0) { 152 149 VMEntryFrame* vmEntryFrame = vm->topVMEntryFrame; … … 1925 1922 VM& vm = exec->vm(); 1926 1923 NativeCallFrameTracer tracer(&vm, exec); 1927 JSStack* stack = &exec->interpreter()->stack(); 1928 return sizeFrameForForwardArguments(exec, stack, numUsedStackSlots); 1924 return sizeFrameForForwardArguments(exec, vm, numUsedStackSlots); 1929 1925 } 1930 1926 … … 1933 1929 VM& vm = exec->vm(); 1934 1930 NativeCallFrameTracer tracer(&vm, exec); 1935 JSStack* stack = &exec->interpreter()->stack();1936 1931 JSValue arguments = JSValue::decode(encodedArguments); 1937 return sizeFrameForVarargs(exec, stack, arguments, numUsedStackSlots, firstVarArgOffset);1932 return sizeFrameForVarargs(exec, vm, arguments, numUsedStackSlots, firstVarArgOffset); 1938 1933 } 1939 1934 -
trunk/Source/JavaScriptCore/jit/JSInterfaceJIT.h
r203006 r203081 1 1 /* 2 * Copyright (C) 2010 Apple Inc. All rights reserved.2 * Copyright (C) 2010, 2016 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 34 34 #include "JITOperations.h" 35 35 #include "JSCJSValue.h" 36 #include "JSStack.h"37 36 #include "JSString.h" 38 37 #include "MacroAssembler.h" -
trunk/Source/JavaScriptCore/jit/SpecializedThunkJIT.h
r203006 r203081 1 1 /* 2 * Copyright (C) 2010 Apple Inc. All rights reserved.2 * Copyright (C) 2010, 2016 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 33 33 #include "JITInlines.h" 34 34 #include "JSInterfaceJIT.h" 35 #include "JSStack.h"36 35 #include "LinkBuffer.h" 37 36 -
trunk/Source/JavaScriptCore/jit/ThunkGenerators.cpp
r203006 r203081 1 1 /* 2 * Copyright (C) 2010, 2012 , 2013,2014, 2016 Apple Inc. All rights reserved.2 * Copyright (C) 2010, 2012-2014, 2016 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 32 32 #include "JSArray.h" 33 33 #include "JSBoundFunction.h" 34 #include "JSStack.h"35 34 #include "MathCommon.h" 36 35 #include "MaxFrameExtentForSlowPathCall.h" -
trunk/Source/JavaScriptCore/llint/LLIntOffsetsExtractor.cpp
r201335 r203081 43 43 #include "JSModuleRecord.h" 44 44 #include "JSObject.h" 45 #include "JSStack.h"46 45 #include "JSString.h" 47 46 #include "JSTypeInfo.h" -
trunk/Source/JavaScriptCore/llint/LLIntSlowPaths.cpp
r203006 r203081 47 47 #include "JSGeneratorFunction.h" 48 48 #include "JSGlobalObjectFunctions.h" 49 #include "JSStackInlines.h"50 49 #include "JSString.h" 51 50 #include "JSWithScope.h" … … 499 498 // throw the StackOverflowError unconditionally. 500 499 #if !ENABLE(JIT) 501 ASSERT(!vm.interpreter-> stack().containsAddress(exec->topOfFrame()));502 if (LIKELY(vm. interpreter->stack().ensureCapacityFor(exec->topOfFrame())))500 ASSERT(!vm.interpreter->cloopStack().containsAddress(exec->topOfFrame())); 501 if (LIKELY(vm.ensureStackCapacityFor(exec->topOfFrame()))) 503 502 LLINT_RETURN_TWO(pc, 0); 504 503 #endif … … 1353 1352 1354 1353 unsigned numUsedStackSlots = -pc[5].u.operand; 1355 unsigned length = sizeFrameForVarargs(exec, &vm.interpreter->stack(),1354 unsigned length = sizeFrameForVarargs(exec, vm, 1356 1355 LLINT_OP_C(4).jsValue(), numUsedStackSlots, pc[6].u.operand); 1357 1356 LLINT_CALL_CHECK_EXCEPTION(exec, exec); … … 1372 1371 unsigned numUsedStackSlots = -pc[5].u.operand; 1373 1372 1374 unsigned arguments = sizeFrameForForwardArguments(exec, &vm.interpreter->stack(), numUsedStackSlots);1373 unsigned arguments = sizeFrameForForwardArguments(exec, vm, numUsedStackSlots); 1375 1374 LLINT_CALL_CHECK_EXCEPTION(exec, exec); 1376 1375 … … 1630 1629 extern "C" SlowPathReturnType llint_stack_check_at_vm_entry(VM* vm, Register* newTopOfStack) 1631 1630 { 1632 bool success = vm-> interpreter->stack().ensureCapacityFor(newTopOfStack);1631 bool success = vm->ensureStackCapacityFor(newTopOfStack); 1633 1632 return encodeResult(reinterpret_cast<void*>(success), 0); 1634 1633 } -
trunk/Source/JavaScriptCore/llint/LLIntThunks.cpp
r200879 r203081 1 1 /* 2 * Copyright (C) 2012 , 2013Apple Inc. All rights reserved.2 * Copyright (C) 2012-2013, 2016 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 33 33 #include "JSInterfaceJIT.h" 34 34 #include "JSObject.h" 35 #include "JSStackInlines.h"36 35 #include "LLIntCLoop.h" 37 36 #include "LinkBuffer.h" -
trunk/Source/JavaScriptCore/llint/LowLevelInterpreter.cpp
r186277 r203081 1 1 /* 2 * Copyright (C) 2012, 2014 Apple Inc. All rights reserved.2 * Copyright (C) 2012, 2014, 2016 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 331 331 332 332 lr.opcode = getOpcode(llint_return_to_host); 333 sp.vp = vm->interpreter-> stack().topOfStack() + 1;333 sp.vp = vm->interpreter->cloopStack().topOfStack() + 1; 334 334 cfr.callFrame = vm->topCallFrame; 335 335 #ifndef NDEBUG -
trunk/Source/JavaScriptCore/runtime/CommonSlowPaths.cpp
r202680 r203081 179 179 { 180 180 BEGIN(); 181 int slotsToAdd = CommonSlowPaths::arityCheckFor(exec, &vm.interpreter->stack(), CodeForCall);181 int slotsToAdd = CommonSlowPaths::arityCheckFor(exec, vm, CodeForCall); 182 182 if (slotsToAdd < 0) { 183 183 exec = exec->callerFrame(); … … 192 192 { 193 193 BEGIN(); 194 int slotsToAdd = CommonSlowPaths::arityCheckFor(exec, &vm.interpreter->stack(), CodeForConstruct);194 int slotsToAdd = CommonSlowPaths::arityCheckFor(exec, vm, CodeForConstruct); 195 195 if (slotsToAdd < 0) { 196 196 exec = exec->callerFrame(); -
trunk/Source/JavaScriptCore/runtime/CommonSlowPaths.h
r203006 r203081 1 1 /* 2 * Copyright (C) 2011-2013, 2015 Apple Inc. All rights reserved.2 * Copyright (C) 2011-2013, 2015-2016 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 30 30 #include "CodeSpecializationKind.h" 31 31 #include "ExceptionHelpers.h" 32 #include "JSStackInlines.h"33 32 #include "SlowPathReturnType.h" 34 33 #include "StackAlignment.h" 35 34 #include "Symbol.h" 36 #include "VM .h"35 #include "VMInlines.h" 37 36 #include <wtf/StdLibExtras.h> 38 37 … … 53 52 }; 54 53 55 ALWAYS_INLINE int arityCheckFor(ExecState* exec, JSStack* stack, CodeSpecializationKind kind)54 ALWAYS_INLINE int arityCheckFor(ExecState* exec, VM& vm, CodeSpecializationKind kind) 56 55 { 57 56 JSFunction* callee = jsCast<JSFunction*>(exec->callee()); … … 66 65 int paddedStackSpace = alignedFrameSizeForParameters - frameSize; 67 66 68 if ( !stack->ensureCapacityFor(exec->registers() - paddedStackSpace % stackAlignmentRegisters()))67 if (UNLIKELY(!vm.ensureStackCapacityFor(exec->registers() - paddedStackSpace % stackAlignmentRegisters()))) 69 68 return -1; 70 69 return paddedStackSpace; -
trunk/Source/JavaScriptCore/runtime/ErrorHandlingScope.cpp
r170147 r203081 1 1 /* 2 * Copyright (C) 2014 Apple Inc. All rights reserved.2 * Copyright (C) 2014, 2016 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 27 27 #include "ErrorHandlingScope.h" 28 28 29 #include "Interpreter.h"30 29 #include "Options.h" 31 30 #include "VM.h" … … 39 38 size_t newReservedZoneSize = Options::errorModeReservedZoneSize(); 40 39 m_savedReservedZoneSize = m_vm.updateReservedZoneSize(newReservedZoneSize); 41 #if !ENABLE(JIT)42 m_vm.interpreter->stack().setReservedZoneSize(newReservedZoneSize);43 #endif44 40 } 45 41 … … 48 44 RELEASE_ASSERT(m_vm.stackPointerAtVMEntry()); 49 45 m_vm.updateReservedZoneSize(m_savedReservedZoneSize); 50 #if !ENABLE(JIT)51 m_vm.interpreter->stack().setReservedZoneSize(m_savedReservedZoneSize);52 #endif53 46 } 54 47 -
trunk/Source/JavaScriptCore/runtime/JSGlobalObject.h
r203006 r203081 78 78 class JSPromiseConstructor; 79 79 class JSPromisePrototype; 80 class JSStack;81 80 class JSTypedArrayViewConstructor; 82 81 class JSTypedArrayViewPrototype; -
trunk/Source/JavaScriptCore/runtime/MemoryStatistics.cpp
r192626 r203081 1 1 /* 2 * Copyright (C) 2010 Apple Inc. All rights reserved.2 * Copyright (C) 2010, 2016 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 29 29 #include "ExecutableAllocator.h" 30 30 #include "VM.h" 31 #include "JSStack.h"32 31 33 32 namespace JSC { … … 37 36 GlobalMemoryStatistics stats; 38 37 39 stats.stackBytes = JSStack::committedByteCount();38 stats.stackBytes = VM::committedStackByteCount(); 40 39 #if ENABLE(ASSEMBLER) 41 40 stats.JITBytes = ExecutableAllocator::committedByteCount(); -
trunk/Source/JavaScriptCore/runtime/StackAlignment.h
r203006 r203081 1 1 /* 2 * Copyright (C) 2013 Apple Inc. All rights reserved.2 * Copyright (C) 2013, 2016 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 28 28 29 29 #include "JSCJSValue.h" 30 #include "JSStack.h"31 30 #include <wtf/MathExtras.h> 32 31 -
trunk/Source/JavaScriptCore/runtime/VM.cpp
r202992 r203081 107 107 #include <wtf/text/SymbolRegistry.h> 108 108 109 #if !ENABLE(JIT) 110 #include "CLoopStack.h" 111 #endif 112 109 113 #if ENABLE(DFG_JIT) 110 114 #include "ConservativeRoots.h" … … 195 199 StackBounds stack = wtfThreadData().stack(); 196 200 updateReservedZoneSize(Options::reservedZoneSize()); 197 #if !ENABLE(JIT)198 interpreter->stack().setReservedZoneSize(Options::reservedZoneSize());199 #endif200 201 setLastStackTop(stack.origin()); 201 202 … … 617 618 size_t oldReservedZoneSize = m_reservedZoneSize; 618 619 m_reservedZoneSize = reservedZoneSize; 620 #if !ENABLE(JIT) 621 interpreter->cloopStack().setReservedZoneSize(reservedZoneSize); 622 #endif 619 623 620 624 updateStackLimit(); … … 840 844 logSanitizeStack(vm); 841 845 #if !ENABLE(JIT) 842 vm->interpreter-> stack().sanitizeStack();846 vm->interpreter->cloopStack().sanitizeStack(); 843 847 #else 844 848 sanitizeStackForVMImpl(vm); … … 846 850 } 847 851 852 size_t VM::committedStackByteCount() 853 { 854 #if ENABLE(JIT) 855 // When using the C stack, we don't know how many stack pages are actually 856 // committed. So, we use the current stack usage as an estimate. 857 ASSERT(wtfThreadData().stack().isGrowingDownward()); 858 int8_t* current = reinterpret_cast<int8_t*>(¤t); 859 int8_t* high = reinterpret_cast<int8_t*>(wtfThreadData().stack().origin()); 860 return high - current; 861 #else 862 return CLoopStack::committedByteCount(); 863 #endif 864 } 865 848 866 } // namespace JSC -
trunk/Source/JavaScriptCore/runtime/VM.h
r202992 r203081 95 95 class NativeExecutable; 96 96 class RegExpCache; 97 class Register; 97 98 class RegisterAtOffsetList; 98 99 #if ENABLE(SAMPLING_PROFILER) … … 462 463 size_t updateReservedZoneSize(size_t reservedZoneSize); 463 464 465 static size_t committedStackByteCount(); 466 inline bool ensureStackCapacityFor(Register* newTopOfStack); 467 464 468 void* osStackLimitWithReserve() { return m_osStackLimitWithReserve; } 465 469 void** addressOfOSStackLimitWithReserve() { return &m_osStackLimitWithReserve; } -
trunk/Source/JavaScriptCore/runtime/VMInlines.h
r200658 r203081 31 31 #include "Watchdog.h" 32 32 33 #if !ENABLE(JIT) 34 #include "CLoopStackInlines.h" 35 #endif 36 33 37 namespace JSC { 34 38 39 bool VM::ensureStackCapacityFor(Register* newTopOfStack) 40 { 41 #if ENABLE(JIT) 42 ASSERT(wtfThreadData().stack().isGrowingDownward()); 43 return newTopOfStack >= m_osStackLimitWithReserve; 44 #else 45 return interpreter->cloopStack().ensureCapacityFor(newTopOfStack); 46 #endif 47 48 } 49 35 50 bool VM::shouldTriggerTermination(ExecState* exec) 36 51 {
Note:
See TracChangeset
for help on using the changeset viewer.