From d227fc870c7a697500a3c900c31baf05fb9a8524 Mon Sep 17 00:00:00 2001 From: Ben Murdoch Date: Tue, 18 Aug 2009 15:36:45 +0100 Subject: [PATCH] Merge WebKit r47420 --- JavaScriptCore/API/JSCallbackConstructor.h | 2 +- JavaScriptCore/API/JSCallbackFunction.cpp | 1 + JavaScriptCore/API/JSCallbackFunction.h | 2 +- JavaScriptCore/API/JSObjectRef.cpp | 1 + JavaScriptCore/Android.mk | 1 + JavaScriptCore/ChangeLog | 1226 ++++++ .../Configurations/FeatureDefines.xcconfig | 4 +- JavaScriptCore/GNUmakefile.am | 11 +- JavaScriptCore/JavaScriptCore.exp | 13 +- JavaScriptCore/JavaScriptCore.pri | 11 +- .../JavaScriptCore/JavaScriptCore.def | 21 +- .../JavaScriptCore/JavaScriptCore.vcproj | 4 + .../JavaScriptCore/JavaScriptCoreCommon.vsprops | 2 +- .../JavaScriptCore/JavaScriptCoreGenerated.vcproj | 6 +- .../JavaScriptCore/JavaScriptCore_debug.def | 21 +- .../JavaScriptCore.vcproj/WTF/WTFCommon.vsprops | 52 +- .../JavaScriptCore.vcproj/jsc/jscCommon.vsprops | 2 +- .../testapi/testapiCommon.vsprops | 2 +- .../JavaScriptCore.xcodeproj/project.pbxproj | 18 +- JavaScriptCore/assembler/ARMAssembler.cpp | 21 +- JavaScriptCore/assembler/ARMAssembler.h | 24 +- JavaScriptCore/assembler/ARMv7Assembler.h | 1 - JavaScriptCore/assembler/AbstractMacroAssembler.h | 10 - .../assembler/AssemblerBufferWithConstantPool.h | 25 +- JavaScriptCore/assembler/MacroAssemblerARM.h | 30 +- JavaScriptCore/assembler/X86Assembler.h | 1 - JavaScriptCore/bytecode/CodeBlock.cpp | 98 +- JavaScriptCore/bytecode/CodeBlock.h | 93 +- JavaScriptCore/bytecode/EvalCodeCache.h | 36 +- JavaScriptCore/bytecode/SamplingTool.cpp | 2 +- JavaScriptCore/bytecompiler/BytecodeGenerator.cpp | 50 +- JavaScriptCore/bytecompiler/BytecodeGenerator.h | 20 +- JavaScriptCore/debugger/Debugger.cpp | 66 +- JavaScriptCore/debugger/Debugger.h | 28 +- JavaScriptCore/debugger/DebuggerCallFrame.cpp | 16 +- JavaScriptCore/interpreter/CachedCall.h | 2 +- JavaScriptCore/interpreter/CallFrameClosure.h | 2 +- JavaScriptCore/interpreter/Interpreter.cpp | 125 +- JavaScriptCore/interpreter/Interpreter.h | 16 +- JavaScriptCore/jit/JIT.cpp | 4 +- JavaScriptCore/jit/JIT.h | 67 +- JavaScriptCore/jit/JITCall.cpp | 6 + JavaScriptCore/jit/JITInlineMethods.h | 33 + JavaScriptCore/jit/JITOpcodes.cpp | 34 +- JavaScriptCore/jit/JITPropertyAccess.cpp | 21 + JavaScriptCore/jit/JITStubs.cpp | 46 +- JavaScriptCore/jit/JITStubs.h | 6 +- JavaScriptCore/parser/Grammar.y | 486 +-- JavaScriptCore/parser/Lexer.cpp | 101 +- JavaScriptCore/parser/Lexer.h | 8 +- JavaScriptCore/parser/NodeConstructors.h | 17 +- JavaScriptCore/parser/Nodes.cpp | 186 +- JavaScriptCore/parser/Nodes.h | 154 +- JavaScriptCore/parser/Parser.h | 63 +- JavaScriptCore/profiler/ProfileGenerator.cpp | 1 + JavaScriptCore/profiler/Profiler.cpp | 23 +- JavaScriptCore/runtime/Arguments.h | 12 +- JavaScriptCore/runtime/ArrayConstructor.cpp | 14 +- JavaScriptCore/runtime/ArrayConstructor.h | 2 +- JavaScriptCore/runtime/ArrayPrototype.cpp | 12 +- JavaScriptCore/runtime/BooleanObject.h | 5 + JavaScriptCore/runtime/BooleanPrototype.cpp | 4 +- JavaScriptCore/runtime/CallData.h | 4 +- JavaScriptCore/runtime/Collector.cpp | 52 +- JavaScriptCore/runtime/CommonIdentifiers.h | 1 + JavaScriptCore/runtime/Completion.cpp | 21 +- JavaScriptCore/runtime/ConstructData.h | 4 +- JavaScriptCore/runtime/DateConstructor.cpp | 2 +- JavaScriptCore/runtime/DatePrototype.cpp | 64 +- JavaScriptCore/runtime/Error.cpp | 6 + JavaScriptCore/runtime/Error.h | 1 + JavaScriptCore/runtime/ExceptionHelpers.cpp | 10 +- JavaScriptCore/runtime/Executable.cpp | 216 + JavaScriptCore/runtime/Executable.h | 268 ++ JavaScriptCore/runtime/FunctionConstructor.cpp | 32 +- JavaScriptCore/runtime/FunctionConstructor.h | 4 - JavaScriptCore/runtime/FunctionPrototype.cpp | 15 +- JavaScriptCore/runtime/FunctionPrototype.h | 2 +- JavaScriptCore/runtime/InternalFunction.h | 2 +- JavaScriptCore/runtime/JSAPIValueWrapper.h | 1 + JavaScriptCore/runtime/JSActivation.cpp | 14 +- JavaScriptCore/runtime/JSActivation.h | 10 +- JavaScriptCore/runtime/JSArray.cpp | 20 +- JavaScriptCore/runtime/JSArray.h | 73 + JavaScriptCore/runtime/JSByteArray.cpp | 2 +- JavaScriptCore/runtime/JSCell.h | 26 +- JavaScriptCore/runtime/JSFunction.cpp | 42 +- JavaScriptCore/runtime/JSFunction.h | 57 +- JavaScriptCore/runtime/JSGlobalData.cpp | 9 +- JavaScriptCore/runtime/JSGlobalData.h | 5 +- JavaScriptCore/runtime/JSGlobalObject.cpp | 10 +- JavaScriptCore/runtime/JSGlobalObject.h | 5 +- JavaScriptCore/runtime/JSGlobalObjectFunctions.cpp | 14 +- JavaScriptCore/runtime/JSNumberCell.h | 2 +- JavaScriptCore/runtime/JSONObject.cpp | 9 + JavaScriptCore/runtime/JSONObject.h | 2 +- JavaScriptCore/runtime/JSObject.cpp | 31 +- JavaScriptCore/runtime/JSObject.h | 37 +- JavaScriptCore/runtime/JSString.h | 2 +- JavaScriptCore/runtime/JSType.h | 1 - JavaScriptCore/runtime/JSValue.h | 2 +- JavaScriptCore/runtime/MarkStack.h | 21 +- JavaScriptCore/runtime/MarkStackWin.cpp | 6 +- JavaScriptCore/runtime/MathObject.h | 2 +- JavaScriptCore/runtime/NumberConstructor.h | 2 +- JavaScriptCore/runtime/NumberObject.h | 5 + JavaScriptCore/runtime/ObjectConstructor.cpp | 1 + JavaScriptCore/runtime/PropertySlot.cpp | 3 +- JavaScriptCore/runtime/RegExpConstructor.cpp | 3 +- JavaScriptCore/runtime/RegExpConstructor.h | 2 +- JavaScriptCore/runtime/RegExpObject.h | 2 +- JavaScriptCore/runtime/RegExpPrototype.cpp | 13 +- JavaScriptCore/runtime/ScopeChain.cpp | 2 +- .../StringObjectThatMasqueradesAsUndefined.h | 2 +- JavaScriptCore/runtime/StringPrototype.cpp | 19 +- JavaScriptCore/runtime/TypeInfo.h | 3 +- JavaScriptCore/runtime/UString.cpp | 92 +- JavaScriptCore/runtime/UString.h | 4 +- JavaScriptCore/wtf/FastMalloc.cpp | 30 +- JavaScriptCore/wtf/FastMalloc.h | 42 +- JavaScriptCore/wtf/Platform.h | 74 +- JavaScriptCore/wtf/PossiblyNull.h | 59 + JavaScriptCore/wtf/SegmentedVector.h | 3 + JavaScriptCore/wtf/haiku/MainThreadHaiku.cpp | 1 + JavaScriptCore/yarr/RegexInterpreter.cpp | 226 +- WEBKIT_MERGE_REVISION | 2 +- WebCore/Android.derived.mk | 741 ---- WebCore/Android.mk | 36 +- WebCore/ChangeLog | 4246 +++++++++++++++++++- WebCore/Configurations/FeatureDefines.xcconfig | 5 +- WebCore/DerivedSources.cpp | 4 + WebCore/DerivedSources.make | 11 +- WebCore/ForwardingHeaders/parser/Parser.h | 4 - .../runtime/CollectorHeapIterator.h | 4 - WebCore/ForwardingHeaders/wtf/PossiblyNull.h | 4 + WebCore/GNUmakefile.am | 90 +- WebCore/WebCore.gypi | 18 +- WebCore/WebCore.order | 1 - WebCore/WebCore.pro | 115 +- WebCore/WebCore.vcproj/QTMovieWin.vcproj | 6 +- WebCore/WebCore.vcproj/WebCore.vcproj | 306 +- WebCore/WebCore.vcproj/WebCoreCURL.vsprops | 1 + WebCore/WebCore.vcproj/WebCoreCommon.vsprops | 6 +- WebCore/WebCore.vcproj/WebCoreGenerated.vcproj | 4 +- WebCore/WebCore.vcproj/build-generated-files.sh | 2 +- WebCore/WebCore.xcodeproj/project.pbxproj | 154 +- WebCore/WebCorePrefix.h | 14 +- WebCore/WebCoreSources.bkl | 9 + WebCore/accessibility/AXObjectCache.cpp | 62 +- WebCore/accessibility/AXObjectCache.h | 19 +- WebCore/accessibility/AccessibilityObject.cpp | 49 + WebCore/accessibility/AccessibilityObject.h | 13 +- .../accessibility/AccessibilityRenderObject.cpp | 29 +- .../gtk/AccessibilityObjectWrapperAtk.cpp | 2 +- .../mac/AccessibilityObjectWrapper.mm | 20 +- WebCore/accessibility/win/AXObjectCacheWin.cpp | 39 + WebCore/bindings/js/JSAudioConstructor.cpp | 1 + WebCore/bindings/js/JSCSSRuleListCustom.cpp | 47 + .../bindings/js/JSCSSStyleDeclarationCustom.cpp | 19 +- WebCore/bindings/js/JSDOMBinding.cpp | 41 +- WebCore/bindings/js/JSDOMBinding.h | 3 +- WebCore/bindings/js/JSDOMWindowCustom.cpp | 11 + .../bindings/js/JSDesktopNotificationsCustom.cpp | 90 + WebCore/bindings/js/JSDocumentCustom.cpp | 10 +- WebCore/bindings/js/JSElementCustom.cpp | 16 +- WebCore/bindings/js/JSEventSourceConstructor.cpp | 91 + WebCore/bindings/js/JSEventSourceConstructor.h | 55 + WebCore/bindings/js/JSEventSourceCustom.cpp | 89 + WebCore/bindings/js/JSEventTarget.cpp | 32 +- WebCore/bindings/js/JSGeolocationCustom.cpp | 9 +- WebCore/bindings/js/JSHTMLCanvasElementCustom.cpp | 45 + WebCore/bindings/js/JSHTMLInputElementCustom.cpp | 1 + WebCore/bindings/js/JSHistoryCustom.cpp | 1 + WebCore/bindings/js/JSImageConstructor.cpp | 1 + WebCore/bindings/js/JSInspectorBackendCustom.cpp | 185 +- WebCore/bindings/js/JSLazyEventListener.cpp | 1 + WebCore/bindings/js/JSLocationCustom.cpp | 1 + .../bindings/js/JSMessageChannelConstructor.cpp | 1 + WebCore/bindings/js/JSNodeFilterCustom.cpp | 2 +- WebCore/bindings/js/JSOptionConstructor.cpp | 1 + WebCore/bindings/js/JSStyleSheetCustom.cpp | 9 +- WebCore/bindings/js/JSStyleSheetListCustom.cpp | 14 +- WebCore/bindings/js/JSWebSocketConstructor.cpp | 1 + WebCore/bindings/js/JSWebSocketCustom.cpp | 1 + WebCore/bindings/js/JSWorkerConstructor.cpp | 1 + WebCore/bindings/js/JSWorkerContextCustom.cpp | 11 + .../bindings/js/JSXMLHttpRequestConstructor.cpp | 1 + WebCore/bindings/js/JSXMLHttpRequestCustom.cpp | 4 +- WebCore/bindings/js/JSXSLTProcessorCustom.cpp | 6 +- WebCore/bindings/js/ScriptControllerHaiku.cpp | 2 +- WebCore/bindings/js/ScriptObjectQuarantine.cpp | 6 +- WebCore/bindings/js/ScriptObjectQuarantine.h | 3 +- WebCore/bindings/js/ScriptValue.cpp | 7 + WebCore/bindings/js/ScriptValue.h | 1 + WebCore/bindings/scripts/CodeGeneratorJS.pm | 10 +- WebCore/bindings/scripts/CodeGeneratorV8.pm | 48 +- WebCore/bindings/v8/ScriptObjectQuarantine.cpp | 6 +- WebCore/bindings/v8/ScriptObjectQuarantine.h | 3 +- WebCore/bindings/v8/ScriptValue.h | 7 +- WebCore/bindings/v8/V8Binding.cpp | 10 +- WebCore/bindings/v8/custom/V8CustomBinding.h | 13 +- WebCore/bindings/v8/custom/V8DOMWindowCustom.cpp | 25 +- .../v8/custom/V8InspectorBackendCustom.cpp | 120 +- WebCore/bridge/jni/jni_jsobject.mm | 7 +- WebCore/bridge/npapi.h | 8 + WebCore/bridge/objc/objc_runtime.mm | 2 +- WebCore/bridge/qt/qt_instance.cpp | 16 +- WebCore/bridge/qt/qt_instance.h | 2 +- WebCore/bridge/qt/qt_runtime.cpp | 11 +- WebCore/bridge/qt/qt_runtime.h | 2 +- WebCore/bridge/runtime_method.cpp | 4 +- WebCore/css/CSSCanvasValue.cpp | 8 +- WebCore/css/CSSImageGeneratorValue.cpp | 26 +- WebCore/css/CSSImageGeneratorValue.h | 5 +- WebCore/css/CSSImportRule.cpp | 19 +- WebCore/css/CSSParser.cpp | 27 + WebCore/css/CSSPrimitiveValue.cpp | 4 +- WebCore/css/CSSPrimitiveValue.h | 2 +- WebCore/css/CSSPrimitiveValueMappings.h | 7 + WebCore/css/CSSRuleList.idl | 3 +- WebCore/css/CSSSelector.cpp | 5 +- WebCore/css/CSSSelector.h | 1 + WebCore/css/CSSStyleDeclaration.idl | 3 +- WebCore/css/CSSStyleSelector.cpp | 118 +- WebCore/css/CSSValueKeywords.in | 1 + WebCore/css/StyleSheetList.idl | 3 +- WebCore/css/WCSSPropertyNames.in | 4 + WebCore/css/WCSSValueKeywords.in | 1 + WebCore/css/html.css | 4 + WebCore/dom/Attr.cpp | 27 +- WebCore/dom/Attr.h | 41 +- WebCore/dom/Attribute.cpp | 6 +- WebCore/dom/CDATASection.cpp | 17 +- WebCore/dom/CDATASection.h | 12 +- WebCore/dom/CharacterData.cpp | 19 +- WebCore/dom/CharacterData.h | 35 +- WebCore/dom/Comment.cpp | 23 +- WebCore/dom/Comment.h | 14 +- WebCore/dom/ContainerNode.cpp | 19 +- WebCore/dom/ContainerNode.h | 9 +- WebCore/dom/DocPtr.h | 114 - WebCore/dom/Document.cpp | 55 +- WebCore/dom/Document.h | 233 +- WebCore/dom/DocumentFragment.cpp | 18 +- WebCore/dom/DocumentFragment.h | 7 +- WebCore/dom/DocumentType.cpp | 14 +- WebCore/dom/DocumentType.h | 4 +- WebCore/dom/EditingText.cpp | 25 +- WebCore/dom/EditingText.h | 13 +- WebCore/dom/Element.cpp | 4 +- WebCore/dom/Element.h | 59 +- WebCore/dom/Element.idl | 1 + WebCore/dom/EntityReference.cpp | 11 +- WebCore/dom/EntityReference.h | 4 +- WebCore/dom/EventNames.h | 1 + WebCore/dom/EventTarget.cpp | 12 + WebCore/dom/EventTarget.h | 7 + WebCore/dom/Node.cpp | 93 +- WebCore/dom/Node.h | 49 +- WebCore/dom/Notation.cpp | 16 +- WebCore/dom/Notation.h | 17 +- WebCore/dom/ProcessingInstruction.cpp | 25 +- WebCore/dom/ProcessingInstruction.h | 39 +- WebCore/dom/Range.cpp | 2 +- WebCore/dom/StyledElement.cpp | 22 +- WebCore/dom/Text.cpp | 80 +- WebCore/dom/Text.h | 27 +- WebCore/dom/XMLTokenizer.cpp | 2 +- WebCore/dom/XMLTokenizerLibxml2.cpp | 4 +- WebCore/dom/XMLTokenizerQt.cpp | 4 +- WebCore/dom/make_names.pl | 377 +- WebCore/editing/CompositeEditCommand.cpp | 2 +- WebCore/editing/CreateLinkCommand.cpp | 2 +- WebCore/editing/DeleteButtonController.cpp | 6 +- WebCore/editing/EditorCommand.cpp | 7 +- WebCore/editing/SplitTextNodeCommand.cpp | 2 +- WebCore/editing/haiku/EditorHaiku.cpp | 5 +- WebCore/editing/markup.cpp | 2 +- WebCore/html/CollectionType.h | 1 + WebCore/html/HTMLAreaElement.cpp | 5 +- WebCore/html/HTMLAreaElement.h | 3 +- WebCore/html/HTMLBodyElement.cpp | 32 +- WebCore/html/HTMLBodyElement.h | 2 + WebCore/html/HTMLBodyElement.idl | 8 +- WebCore/html/HTMLCanvasElement.h | 34 +- WebCore/html/HTMLCanvasElement.idl | 3 +- WebCore/html/HTMLCollection.cpp | 9 + WebCore/html/HTMLDataListElement.cpp | 60 + WebCore/html/HTMLDataListElement.h | 55 + WebCore/html/HTMLDataListElement.idl | 38 + WebCore/html/HTMLDocument.cpp | 4 +- WebCore/html/HTMLDocument.h | 10 +- WebCore/html/HTMLElement.cpp | 60 +- WebCore/html/HTMLElement.h | 9 - WebCore/html/HTMLEmbedElement.idl | 12 +- WebCore/html/HTMLFormControlElement.cpp | 5 + WebCore/html/HTMLFormControlElement.h | 1 + WebCore/html/HTMLFormElement.cpp | 11 + WebCore/html/HTMLFormElement.h | 2 + WebCore/html/HTMLFrameElement.cpp | 19 +- WebCore/html/HTMLFrameElement.h | 7 +- WebCore/html/HTMLFrameElement.idl | 14 +- WebCore/html/HTMLFrameElementBase.cpp | 17 +- WebCore/html/HTMLFrameElementBase.h | 8 +- WebCore/html/HTMLFrameSetElement.cpp | 32 +- WebCore/html/HTMLFrameSetElement.h | 2 + WebCore/html/HTMLFrameSetElement.idl | 4 +- WebCore/html/HTMLIFrameElement.cpp | 4 +- WebCore/html/HTMLIFrameElement.idl | 22 +- WebCore/html/HTMLImageElement.cpp | 50 +- WebCore/html/HTMLImageElement.h | 15 +- WebCore/html/HTMLKeygenElement.cpp | 2 +- WebCore/html/HTMLObjectElement.idl | 28 +- WebCore/html/HTMLOptionElement.cpp | 2 +- WebCore/html/HTMLParser.cpp | 7 +- WebCore/html/HTMLTagNames.in | 1 + WebCore/html/HTMLViewSourceDocument.cpp | 33 +- WebCore/html/HTMLViewSourceDocument.h | 23 +- WebCore/html/canvas/CanvasRenderingContext2D.cpp | 11 +- WebCore/html/canvas/CanvasRenderingContext2D.h | 2 +- WebCore/html/canvas/CanvasRenderingContext2D.idl | 3 +- WebCore/inspector/InspectorBackend.cpp | 100 +- WebCore/inspector/InspectorBackend.h | 24 +- WebCore/inspector/InspectorBackend.idl | 29 +- WebCore/inspector/InspectorController.cpp | 85 +- WebCore/inspector/InspectorController.h | 24 +- WebCore/inspector/InspectorDOMAgent.cpp | 112 +- WebCore/inspector/InspectorDOMAgent.h | 17 +- WebCore/inspector/InspectorDOMStorageResource.cpp | 2 +- WebCore/inspector/InspectorFrontend.cpp | 68 +- WebCore/inspector/InspectorFrontend.h | 19 +- WebCore/inspector/JavaScriptDebugServer.cpp | 61 +- WebCore/inspector/front-end/ConsoleView.js | 165 +- WebCore/inspector/front-end/CookieItemsView.js | 329 ++ WebCore/inspector/front-end/DOMAgent.js | 214 +- WebCore/inspector/front-end/DOMStorageItemsView.js | 17 +- WebCore/inspector/front-end/DataGrid.js | 11 + WebCore/inspector/front-end/DatabasesPanel.js | 89 +- WebCore/inspector/front-end/Drawer.js | 6 + WebCore/inspector/front-end/ElementsPanel.js | 434 +- WebCore/inspector/front-end/ElementsTreeOutline.js | 49 +- WebCore/inspector/front-end/Images/cookie.png | Bin 0 -> 776 bytes WebCore/inspector/front-end/InjectedScript.js | 464 ++- .../inspector/front-end/ObjectPropertiesSection.js | 13 +- WebCore/inspector/front-end/ObjectProxy.js | 9 +- WebCore/inspector/front-end/Panel.js | 12 - WebCore/inspector/front-end/ProfileView.js | 28 +- WebCore/inspector/front-end/ProfilesPanel.js | 22 +- .../inspector/front-end/PropertiesSidebarPane.js | 8 +- WebCore/inspector/front-end/ResourcesPanel.js | 28 +- WebCore/inspector/front-end/ScriptsPanel.js | 36 +- WebCore/inspector/front-end/SourceFrame.js | 6 +- WebCore/inspector/front-end/StatusBarButton.js | 118 + WebCore/inspector/front-end/StylesSidebarPane.js | 152 +- WebCore/inspector/front-end/WebKit.qrc | 3 + WebCore/inspector/front-end/inspector.css | 32 +- WebCore/inspector/front-end/inspector.html | 2 + WebCore/inspector/front-end/inspector.js | 45 +- WebCore/inspector/front-end/treeoutline.js | 17 +- WebCore/inspector/front-end/utilities.js | 64 +- WebCore/loader/CachedFont.cpp | 10 +- WebCore/loader/DocumentLoader.cpp | 11 - WebCore/loader/DocumentLoader.h | 5 - WebCore/loader/DocumentThreadableLoader.cpp | 241 +- WebCore/loader/DocumentThreadableLoader.h | 28 +- WebCore/loader/EmptyClients.h | 4 + WebCore/loader/FTPDirectoryDocument.cpp | 8 +- WebCore/loader/FTPDirectoryDocument.h | 4 +- WebCore/loader/FrameLoader.cpp | 36 +- WebCore/loader/FrameLoader.h | 2 + WebCore/loader/ImageDocument.h | 4 +- WebCore/loader/MediaDocument.h | 13 +- WebCore/loader/PlaceholderDocument.h | 2 +- WebCore/loader/PluginDocument.h | 4 +- WebCore/loader/TextDocument.h | 4 +- WebCore/loader/ThreadableLoader.cpp | 12 +- WebCore/loader/ThreadableLoader.h | 32 +- WebCore/loader/WorkerThreadableLoader.cpp | 20 +- WebCore/loader/WorkerThreadableLoader.h | 12 +- WebCore/loader/loader.cpp | 4 +- WebCore/manual-tests/gtk/copy-htmltext.html | 24 + ...yboard_select_elements_with_same_beginning.html | 29 + .../manual-tests/wml/select-onpick-event-crash.wml | 12 + WebCore/notifications/Notification.cpp | 234 ++ WebCore/notifications/Notification.h | 118 + WebCore/notifications/Notification.idl | 54 + WebCore/notifications/NotificationCenter.cpp | 60 + WebCore/notifications/NotificationCenter.h | 80 + WebCore/notifications/NotificationCenter.idl | 43 + WebCore/notifications/NotificationContents.h | 60 + WebCore/notifications/NotificationPresenter.h | 80 + WebCore/page/Chrome.cpp | 7 + WebCore/page/Chrome.h | 7 + WebCore/page/ChromeClient.h | 8 + WebCore/page/DOMWindow.cpp | 40 + WebCore/page/DOMWindow.h | 10 + WebCore/page/DOMWindow.idl | 10 +- WebCore/page/EventHandler.cpp | 8 +- WebCore/page/EventSource.cpp | 372 ++ WebCore/page/EventSource.h | 146 + WebCore/page/EventSource.idl | 65 + WebCore/page/Geolocation.cpp | 1 + WebCore/page/Navigator.cpp | 20 +- WebCore/page/Navigator.h | 5 + WebCore/page/Navigator.idl | 4 + WebCore/page/Page.h | 7 + WebCore/page/PositionOptions.h | 2 +- WebCore/page/SecurityOrigin.cpp | 27 +- WebCore/page/SecurityOrigin.h | 6 + WebCore/page/animation/AnimationBase.cpp | 169 +- WebCore/page/haiku/DragControllerHaiku.cpp | 5 +- WebCore/page/haiku/EventHandlerHaiku.cpp | 11 +- WebCore/platform/ContextMenuItem.h | 4 + WebCore/platform/Cookie.h | 60 + WebCore/platform/CookieJar.h | 8 +- WebCore/platform/CrossThreadCopier.h | 4 + WebCore/platform/Cursor.h | 5 + WebCore/platform/DragData.h | 3 + WebCore/platform/DragImage.h | 4 + WebCore/platform/Pasteboard.h | 5 +- WebCore/platform/PlatformKeyboardEvent.h | 8 + WebCore/platform/PlatformMenuDescription.h | 4 + WebCore/platform/PlatformMouseEvent.h | 8 + WebCore/platform/PlatformWheelEvent.h | 8 + WebCore/platform/PopupMenu.h | 6 + WebCore/platform/TreeShared.h | 15 +- WebCore/platform/Widget.h | 5 + WebCore/platform/chromium/PopupMenuChromium.cpp | 37 +- WebCore/platform/graphics/BitmapImage.h | 12 +- WebCore/platform/graphics/Color.h | 9 + WebCore/platform/graphics/FloatPoint.h | 9 + WebCore/platform/graphics/FloatRect.h | 9 + WebCore/platform/graphics/FontDescription.h | 2 + WebCore/platform/graphics/GraphicsContext.cpp | 49 +- WebCore/platform/graphics/GraphicsContext.h | 42 +- WebCore/platform/graphics/GraphicsLayer.cpp | 3 +- WebCore/platform/graphics/GraphicsLayer.h | 12 +- WebCore/platform/graphics/GraphicsLayerClient.h | 7 +- WebCore/platform/graphics/Icon.h | 2 + WebCore/platform/graphics/ImageBuffer.h | 12 +- .../ImageSourceCairo.cpp => ImageSource.cpp} | 61 +- WebCore/platform/graphics/ImageSource.h | 6 + WebCore/platform/graphics/IntPoint.h | 5 + WebCore/platform/graphics/IntRect.h | 5 + WebCore/platform/graphics/IntSize.h | 7 + WebCore/platform/graphics/Path.h | 3 + WebCore/platform/graphics/Pattern.h | 3 + WebCore/platform/graphics/SimpleFontData.h | 4 + .../graphics/cairo/GraphicsContextCairo.cpp | 172 +- .../platform/graphics/cairo/ImageBufferCairo.cpp | 69 +- WebCore/platform/graphics/cg/GraphicsContextCG.cpp | 346 +- WebCore/platform/graphics/cg/ImageBufferCG.cpp | 61 +- .../platform/graphics/filters/FEColorMatrix.cpp | 4 +- WebCore/platform/graphics/haiku/ColorHaiku.cpp | 54 + .../platform/graphics/haiku/FloatPointHaiku.cpp | 48 + WebCore/platform/graphics/haiku/FloatRectHaiku.cpp | 48 + WebCore/platform/graphics/haiku/GradientHaiku.cpp | 53 + .../graphics/haiku/GraphicsContextHaiku.cpp | 536 +++ WebCore/platform/graphics/haiku/IntPointHaiku.cpp | 48 + WebCore/platform/graphics/haiku/IntRectHaiku.cpp | 48 + WebCore/platform/graphics/haiku/IntSizeHaiku.cpp | 48 + WebCore/platform/graphics/haiku/PathHaiku.cpp | 161 + WebCore/platform/graphics/mac/FontMacATSUI.mm | 8 +- WebCore/platform/graphics/mac/GraphicsLayerCA.h | 6 +- WebCore/platform/graphics/mac/GraphicsLayerCA.mm | 27 +- WebCore/platform/graphics/mac/SimpleFontDataMac.mm | 4 +- WebCore/platform/graphics/qt/GraphicsContextQt.cpp | 239 +- WebCore/platform/graphics/qt/ImageBufferQt.cpp | 65 +- WebCore/platform/graphics/skia/ImageBufferSkia.cpp | 55 +- WebCore/platform/graphics/skia/ImageSourceSkia.cpp | 238 -- .../platform/graphics/skia/PlatformContextSkia.cpp | 2 +- WebCore/platform/graphics/wince/ColorWince.cpp | 38 + WebCore/platform/graphics/wince/GradientWince.cpp | 52 + .../graphics/wince/MediaPlayerPrivateWince.h | 129 + .../platform/graphics/wince/MediaPlayerProxy.cpp | 145 + WebCore/platform/graphics/wince/MediaPlayerProxy.h | 70 + WebCore/platform/graphics/wince/PathWince.cpp | 163 + .../platform/graphics/wince/PlatformPathWince.cpp | 810 ++++ .../platform/graphics/wince/PlatformPathWince.h | 178 + .../platform/graphics/wince/WinceGraphicsExtras.h | 39 + WebCore/platform/graphics/wx/ImageBufferWx.cpp | 15 +- WebCore/platform/graphics/wx/ImageSourceWx.cpp | 226 -- WebCore/platform/gtk/ClipboardGtk.cpp | 69 +- WebCore/platform/gtk/ClipboardGtk.h | 4 +- WebCore/platform/gtk/PasteboardGtk.cpp | 11 +- WebCore/platform/gtk/PasteboardHelper.h | 1 + WebCore/platform/haiku/ClipboardHaiku.cpp | 36 +- WebCore/platform/haiku/ContextMenuHaiku.cpp | 40 +- WebCore/platform/haiku/CookieJarHaiku.cpp | 19 +- WebCore/platform/haiku/DragDataHaiku.cpp | 7 +- WebCore/platform/haiku/LocalizedStringsHaiku.cpp | 346 ++ WebCore/platform/haiku/LoggingHaiku.cpp | 48 + WebCore/platform/haiku/RenderThemeHaiku.cpp | 178 + WebCore/platform/haiku/RenderThemeHaiku.h | 70 + WebCore/platform/haiku/ScrollbarThemeHaiku.cpp | 164 + WebCore/platform/haiku/ScrollbarThemeHaiku.h | 55 + WebCore/platform/haiku/SharedBufferHaiku.cpp | 55 + WebCore/platform/haiku/TemporaryLinkStubs.cpp | 58 +- WebCore/platform/image-decoders/ImageDecoder.cpp | 103 + WebCore/platform/image-decoders/ImageDecoder.h | 30 +- .../image-decoders/ico/ICOImageDecoder.cpp | 17 +- .../image-decoders/jpeg/JPEGImageDecoder.cpp | 86 +- .../image-decoders/jpeg/JPEGImageDecoder.h | 11 + .../image-decoders/png/PNGImageDecoder.cpp | 36 +- WebCore/platform/mac/CookieJar.mm | 49 + WebCore/platform/network/cf/DNSCFNet.cpp | 27 +- .../network/chromium/CookieJarChromium.cpp | 13 + WebCore/platform/network/curl/CookieJarCurl.cpp | 13 + .../network/curl/ResourceHandleManager.cpp | 65 +- .../platform/network/curl/ResourceHandleManager.h | 2 + WebCore/platform/network/soup/CookieJarSoup.cpp | 13 + .../platform/network/soup/ResourceHandleSoup.cpp | 63 +- WebCore/platform/network/win/CookieJarCFNetWin.cpp | 13 + WebCore/platform/network/win/CookieJarWin.cpp | 14 +- WebCore/platform/qt/CookieJarQt.cpp | 13 + WebCore/platform/qt/FileSystemQt.cpp | 2 +- WebCore/platform/text/PlatformString.h | 9 + WebCore/platform/text/UnicodeRange.h | 4 + .../haiku/TextBreakIteratorInternalICUHaiku.cpp | 6 + WebCore/platform/text/mac/TextCodecMac.cpp | 4 +- WebCore/platform/win/PopupMenuWin.cpp | 5 + WebCore/platform/wince/CursorWince.cpp | 109 + WebCore/platform/wince/DragDataWince.cpp | 90 + WebCore/platform/wince/DragImageWince.cpp | 63 + WebCore/platform/wince/EditorWince.cpp | 43 + WebCore/platform/wince/FileChooserWince.cpp | 60 + WebCore/platform/wince/FileSystemWince.cpp | 283 ++ WebCore/platform/wince/KURLWince.cpp | 30 + WebCore/platform/wince/KeygenWince.cpp | 101 + WebCore/platform/wince/MIMETypeRegistryWince.cpp | 135 + WebCore/platform/wince/PasteboardWince.cpp | 315 ++ WebCore/platform/wince/SearchPopupMenuWince.cpp | 53 + WebCore/platform/wince/SharedTimerWince.cpp | 130 + WebCore/platform/wince/SystemTimeWince.cpp | 39 + WebCore/plugins/win/PaintHooks.asm | 50 + WebCore/plugins/win/PluginViewWin.cpp | 46 +- WebCore/rendering/HitTestResult.cpp | 2 +- WebCore/rendering/InlineFlowBox.cpp | 26 +- WebCore/rendering/MediaControlElements.cpp | 60 +- WebCore/rendering/RenderBlock.cpp | 81 +- WebCore/rendering/RenderBlock.h | 6 +- WebCore/rendering/RenderBox.cpp | 61 +- WebCore/rendering/RenderBox.h | 4 +- WebCore/rendering/RenderButton.cpp | 4 +- WebCore/rendering/RenderFieldset.cpp | 3 +- WebCore/rendering/RenderFlexibleBox.cpp | 23 +- WebCore/rendering/RenderHTMLCanvas.cpp | 7 +- WebCore/rendering/RenderImage.cpp | 2 +- WebCore/rendering/RenderInline.cpp | 12 - WebCore/rendering/RenderLayer.cpp | 52 +- WebCore/rendering/RenderLayer.h | 4 + WebCore/rendering/RenderLayerBacking.cpp | 134 +- WebCore/rendering/RenderLayerBacking.h | 26 +- WebCore/rendering/RenderLayerCompositor.cpp | 24 +- WebCore/rendering/RenderLayerCompositor.h | 3 +- WebCore/rendering/RenderListItem.h | 4 +- WebCore/rendering/RenderMarquee.cpp | 7 +- WebCore/rendering/RenderObject.cpp | 24 +- WebCore/rendering/RenderObject.h | 13 + WebCore/rendering/RenderReplaced.cpp | 2 +- WebCore/rendering/RenderTable.cpp | 21 +- WebCore/rendering/RenderText.cpp | 2 +- WebCore/rendering/RenderTextFragment.cpp | 4 +- WebCore/rendering/RenderThemeChromiumMac.h | 1 + WebCore/rendering/RenderThemeChromiumMac.mm | 30 + WebCore/rendering/RenderThemeChromiumSkia.cpp | 4 + WebCore/rendering/style/FillLayer.h | 6 +- WebCore/rendering/style/RenderStyleConstants.h | 7 +- WebCore/storage/Database.cpp | 20 +- WebCore/storage/Database.h | 5 +- WebCore/storage/DatabaseThread.cpp | 5 + WebCore/storage/DatabaseThread.h | 6 + WebCore/storage/SQLTransaction.cpp | 42 +- WebCore/storage/SQLTransaction.h | 3 + WebCore/storage/SQLTransactionCoordinator.cpp | 102 + WebCore/storage/SQLTransactionCoordinator.h | 56 + WebCore/storage/Storage.h | 1 + WebCore/storage/StorageNamespace.h | 1 + WebCore/storage/StorageNamespaceImpl.cpp | 5 + WebCore/storage/StorageNamespaceImpl.h | 1 + WebCore/svg/SVGColor.cpp | 4 +- WebCore/svg/SVGColor.h | 4 +- WebCore/svg/SVGDocument.h | 10 +- WebCore/svg/SVGElementInstance.cpp | 5 +- WebCore/svg/SVGElementInstance.h | 22 +- WebCore/svg/SVGUseElement.cpp | 14 +- WebCore/svg/graphics/SVGResourceMasker.cpp | 6 +- WebCore/webcore-wx.bkl | 1 - WebCore/wml/WMLAnchorElement.cpp | 4 +- WebCore/wml/WMLCardElement.cpp | 2 - WebCore/wml/WMLDoElement.cpp | 13 +- WebCore/wml/WMLDocument.cpp | 4 +- WebCore/wml/WMLDocument.h | 4 +- WebCore/wml/WMLGoElement.cpp | 18 +- WebCore/wml/WMLGoElement.h | 2 +- WebCore/wml/WMLIntrinsicEventHandler.cpp | 2 +- WebCore/wml/WMLOptionElement.cpp | 4 + WebCore/wml/WMLPageState.cpp | 1 - WebCore/wml/WMLPageState.h | 4 - WebCore/wml/WMLPrevElement.cpp | 9 +- WebCore/wml/WMLPrevElement.h | 2 +- WebCore/wml/WMLRefreshElement.cpp | 11 +- WebCore/wml/WMLRefreshElement.h | 2 +- WebCore/wml/WMLSelectElement.cpp | 6 +- WebCore/wml/WMLSelectElement.h | 3 + WebCore/wml/WMLTaskElement.h | 2 +- WebCore/workers/DedicatedWorkerContext.cpp | 17 - WebCore/workers/DedicatedWorkerContext.h | 6 - WebCore/workers/DedicatedWorkerThread.cpp | 2 +- WebCore/workers/DefaultSharedWorkerRepository.cpp | 141 +- WebCore/workers/DefaultSharedWorkerRepository.h | 28 +- WebCore/workers/SharedWorkerContext.cpp | 12 - WebCore/workers/SharedWorkerContext.h | 5 - WebCore/workers/SharedWorkerRepository.h | 8 +- WebCore/workers/SharedWorkerThread.cpp | 8 +- WebCore/workers/SharedWorkerThread.h | 4 +- WebCore/workers/Worker.cpp | 2 +- WebCore/workers/WorkerContext.cpp | 30 +- WebCore/workers/WorkerContext.h | 10 +- WebCore/workers/WorkerContext.idl | 7 + WebCore/workers/WorkerObjectProxy.h | 15 +- WebCore/workers/WorkerReportingProxy.h | 61 + WebCore/workers/WorkerScriptLoader.cpp | 17 +- WebCore/workers/WorkerScriptLoader.h | 4 +- WebCore/workers/WorkerThread.cpp | 3 +- WebCore/workers/WorkerThread.h | 15 +- WebCore/xml/XMLHttpRequest.cpp | 323 +- WebCore/xml/XMLHttpRequest.h | 20 +- WebCore/xml/XPathNamespace.cpp | 10 +- WebCore/xml/XPathNamespace.h | 13 +- WebCore/xml/XSLTProcessor.cpp | 4 +- WebKitTools/Scripts/make-js-test-wrappers | 175 - WebKitTools/Scripts/modules/commiters_unittest.py | 52 - 633 files changed, 22594 insertions(+), 7208 deletions(-) create mode 100644 JavaScriptCore/runtime/Executable.cpp create mode 100644 JavaScriptCore/runtime/Executable.h create mode 100644 JavaScriptCore/wtf/PossiblyNull.h delete mode 100644 WebCore/ForwardingHeaders/parser/Parser.h delete mode 100644 WebCore/ForwardingHeaders/runtime/CollectorHeapIterator.h create mode 100644 WebCore/ForwardingHeaders/wtf/PossiblyNull.h create mode 100644 WebCore/bindings/js/JSCSSRuleListCustom.cpp create mode 100644 WebCore/bindings/js/JSDesktopNotificationsCustom.cpp create mode 100644 WebCore/bindings/js/JSEventSourceConstructor.cpp create mode 100644 WebCore/bindings/js/JSEventSourceConstructor.h create mode 100644 WebCore/bindings/js/JSEventSourceCustom.cpp create mode 100644 WebCore/bindings/js/JSHTMLCanvasElementCustom.cpp create mode 100644 WebCore/css/WCSSPropertyNames.in create mode 100644 WebCore/css/WCSSValueKeywords.in delete mode 100644 WebCore/dom/DocPtr.h create mode 100644 WebCore/html/HTMLDataListElement.cpp create mode 100644 WebCore/html/HTMLDataListElement.h create mode 100644 WebCore/html/HTMLDataListElement.idl create mode 100644 WebCore/inspector/front-end/CookieItemsView.js create mode 100644 WebCore/inspector/front-end/Images/cookie.png create mode 100644 WebCore/inspector/front-end/StatusBarButton.js create mode 100644 WebCore/manual-tests/gtk/copy-htmltext.html create mode 100644 WebCore/manual-tests/keyboard_select_elements_with_same_beginning.html create mode 100644 WebCore/manual-tests/wml/select-onpick-event-crash.wml create mode 100644 WebCore/notifications/Notification.cpp create mode 100644 WebCore/notifications/Notification.h create mode 100644 WebCore/notifications/Notification.idl create mode 100644 WebCore/notifications/NotificationCenter.cpp create mode 100644 WebCore/notifications/NotificationCenter.h create mode 100644 WebCore/notifications/NotificationCenter.idl create mode 100644 WebCore/notifications/NotificationContents.h create mode 100644 WebCore/notifications/NotificationPresenter.h create mode 100644 WebCore/page/EventSource.cpp create mode 100644 WebCore/page/EventSource.h create mode 100644 WebCore/page/EventSource.idl create mode 100644 WebCore/platform/Cookie.h rename WebCore/platform/graphics/{cairo/ImageSourceCairo.cpp => ImageSource.cpp} (82%) create mode 100644 WebCore/platform/graphics/haiku/ColorHaiku.cpp create mode 100644 WebCore/platform/graphics/haiku/FloatPointHaiku.cpp create mode 100644 WebCore/platform/graphics/haiku/FloatRectHaiku.cpp create mode 100644 WebCore/platform/graphics/haiku/GradientHaiku.cpp create mode 100644 WebCore/platform/graphics/haiku/GraphicsContextHaiku.cpp create mode 100644 WebCore/platform/graphics/haiku/IntPointHaiku.cpp create mode 100644 WebCore/platform/graphics/haiku/IntRectHaiku.cpp create mode 100644 WebCore/platform/graphics/haiku/IntSizeHaiku.cpp create mode 100644 WebCore/platform/graphics/haiku/PathHaiku.cpp delete mode 100644 WebCore/platform/graphics/skia/ImageSourceSkia.cpp create mode 100644 WebCore/platform/graphics/wince/ColorWince.cpp create mode 100644 WebCore/platform/graphics/wince/GradientWince.cpp create mode 100644 WebCore/platform/graphics/wince/MediaPlayerPrivateWince.h create mode 100644 WebCore/platform/graphics/wince/MediaPlayerProxy.cpp create mode 100644 WebCore/platform/graphics/wince/MediaPlayerProxy.h create mode 100644 WebCore/platform/graphics/wince/PathWince.cpp create mode 100644 WebCore/platform/graphics/wince/PlatformPathWince.cpp create mode 100644 WebCore/platform/graphics/wince/PlatformPathWince.h create mode 100644 WebCore/platform/graphics/wince/WinceGraphicsExtras.h delete mode 100644 WebCore/platform/graphics/wx/ImageSourceWx.cpp create mode 100644 WebCore/platform/haiku/LocalizedStringsHaiku.cpp create mode 100644 WebCore/platform/haiku/LoggingHaiku.cpp create mode 100644 WebCore/platform/haiku/RenderThemeHaiku.cpp create mode 100644 WebCore/platform/haiku/RenderThemeHaiku.h create mode 100644 WebCore/platform/haiku/ScrollbarThemeHaiku.cpp create mode 100644 WebCore/platform/haiku/ScrollbarThemeHaiku.h create mode 100644 WebCore/platform/haiku/SharedBufferHaiku.cpp create mode 100644 WebCore/platform/image-decoders/ImageDecoder.cpp create mode 100644 WebCore/platform/wince/CursorWince.cpp create mode 100644 WebCore/platform/wince/DragDataWince.cpp create mode 100644 WebCore/platform/wince/DragImageWince.cpp create mode 100644 WebCore/platform/wince/EditorWince.cpp create mode 100644 WebCore/platform/wince/FileChooserWince.cpp create mode 100644 WebCore/platform/wince/FileSystemWince.cpp create mode 100644 WebCore/platform/wince/KURLWince.cpp create mode 100644 WebCore/platform/wince/KeygenWince.cpp create mode 100644 WebCore/platform/wince/MIMETypeRegistryWince.cpp create mode 100644 WebCore/platform/wince/PasteboardWince.cpp create mode 100644 WebCore/platform/wince/SearchPopupMenuWince.cpp create mode 100644 WebCore/platform/wince/SharedTimerWince.cpp create mode 100644 WebCore/platform/wince/SystemTimeWince.cpp create mode 100644 WebCore/plugins/win/PaintHooks.asm create mode 100644 WebCore/storage/SQLTransactionCoordinator.cpp create mode 100644 WebCore/storage/SQLTransactionCoordinator.h create mode 100644 WebCore/workers/WorkerReportingProxy.h delete mode 100755 WebKitTools/Scripts/make-js-test-wrappers delete mode 100644 WebKitTools/Scripts/modules/commiters_unittest.py diff --git a/JavaScriptCore/API/JSCallbackConstructor.h b/JavaScriptCore/API/JSCallbackConstructor.h index 1f0624911..1e28aafcc 100644 --- a/JavaScriptCore/API/JSCallbackConstructor.h +++ b/JavaScriptCore/API/JSCallbackConstructor.h @@ -41,7 +41,7 @@ public: static PassRefPtr createStructure(JSValue proto) { - return Structure::create(proto, TypeInfo(ObjectType, ImplementsHasInstance | HasStandardGetOwnPropertySlot)); + return Structure::create(proto, TypeInfo(ObjectType, ImplementsHasInstance | HasStandardGetOwnPropertySlot | HasDefaultMark)); } private: diff --git a/JavaScriptCore/API/JSCallbackFunction.cpp b/JavaScriptCore/API/JSCallbackFunction.cpp index 1b3217b40..b7dd76858 100644 --- a/JavaScriptCore/API/JSCallbackFunction.cpp +++ b/JavaScriptCore/API/JSCallbackFunction.cpp @@ -28,6 +28,7 @@ #include "JSCallbackFunction.h" #include "APICast.h" +#include "CodeBlock.h" #include "JSFunction.h" #include "FunctionPrototype.h" #include diff --git a/JavaScriptCore/API/JSCallbackFunction.h b/JavaScriptCore/API/JSCallbackFunction.h index 7dd87b59b..3a17fa2de 100644 --- a/JavaScriptCore/API/JSCallbackFunction.h +++ b/JavaScriptCore/API/JSCallbackFunction.h @@ -41,7 +41,7 @@ public: // refactor the code so this override isn't necessary static PassRefPtr createStructure(JSValue proto) { - return Structure::create(proto, TypeInfo(ObjectType, HasStandardGetOwnPropertySlot)); + return Structure::create(proto, TypeInfo(ObjectType, HasStandardGetOwnPropertySlot | HasDefaultMark)); } private: diff --git a/JavaScriptCore/API/JSObjectRef.cpp b/JavaScriptCore/API/JSObjectRef.cpp index 87d36ec4f..06ef578a8 100644 --- a/JavaScriptCore/API/JSObjectRef.cpp +++ b/JavaScriptCore/API/JSObjectRef.cpp @@ -28,6 +28,7 @@ #include "JSObjectRef.h" #include "APICast.h" +#include "CodeBlock.h" #include "DateConstructor.h" #include "ErrorConstructor.h" #include "FunctionConstructor.h" diff --git a/JavaScriptCore/Android.mk b/JavaScriptCore/Android.mk index 6973fa14d..c27c703e0 100644 --- a/JavaScriptCore/Android.mk +++ b/JavaScriptCore/Android.mk @@ -108,6 +108,7 @@ LOCAL_SRC_FILES := \ runtime/ErrorInstance.cpp \ runtime/ErrorPrototype.cpp \ runtime/ExceptionHelpers.cpp \ + runtime/Executable.cpp \ runtime/FunctionConstructor.cpp \ runtime/FunctionPrototype.cpp \ runtime/GetterSetter.cpp \ diff --git a/JavaScriptCore/ChangeLog b/JavaScriptCore/ChangeLog index 1afea5fc6..f67d27d61 100644 --- a/JavaScriptCore/ChangeLog +++ b/JavaScriptCore/ChangeLog @@ -1,3 +1,1229 @@ +2009-08-17 Gavin Barraclough + + Reviewed by Sam Weinig. + + No, silly runtime, AST nodes are not for you. + + We still use AST nodes (ScopeNodes, particularly FunctionBodyNodes) within + the runtime, which means that these nodes must be persisted outside of the + arena, contain both parser & runtime data, etc. This is all a bit of a mess. + + Move functionality into a new FunctionExecutable class. + + * API/JSCallbackFunction.cpp: + * API/JSObjectRef.cpp: + * JavaScriptCore.exp: + * JavaScriptCore.xcodeproj/project.pbxproj: + * bytecode/CodeBlock.cpp: + (JSC::CodeBlock::CodeBlock): + (JSC::CodeBlock::markAggregate): + (JSC::CodeBlock::reparseForExceptionInfoIfNecessary): + (JSC::CodeBlock::lineNumberForBytecodeOffset): + (JSC::CodeBlock::shrinkToFit): + * bytecode/CodeBlock.h: + (JSC::CodeBlock::getBytecodeIndex): + (JSC::CodeBlock::discardBytecode): + (JSC::CodeBlock::instructionCount): + (JSC::CodeBlock::getJITCode): + (JSC::CodeBlock::executablePool): + (JSC::CodeBlock::ownerExecutable): + (JSC::CodeBlock::extractExceptionInfo): + (JSC::CodeBlock::addFunctionDecl): + (JSC::CodeBlock::functionDecl): + (JSC::CodeBlock::numberOfFunctionDecls): + (JSC::CodeBlock::addFunctionExpr): + (JSC::CodeBlock::functionExpr): + (JSC::GlobalCodeBlock::GlobalCodeBlock): + (JSC::ProgramCodeBlock::ProgramCodeBlock): + (JSC::EvalCodeBlock::EvalCodeBlock): + (JSC::FunctionCodeBlock::FunctionCodeBlock): + (JSC::NativeCodeBlock::NativeCodeBlock): + * bytecode/EvalCodeCache.h: + * bytecode/SamplingTool.cpp: + (JSC::SamplingTool::doRun): + * bytecompiler/BytecodeGenerator.cpp: + (JSC::BytecodeGenerator::BytecodeGenerator): + (JSC::BytecodeGenerator::emitNewFunction): + (JSC::BytecodeGenerator::emitNewFunctionExpression): + * bytecompiler/BytecodeGenerator.h: + * debugger/Debugger.cpp: + (JSC::Debugger::recompileAllJSFunctions): + * interpreter/CachedCall.h: + (JSC::CachedCall::CachedCall): + * interpreter/CallFrameClosure.h: + * interpreter/Interpreter.cpp: + (JSC::Interpreter::unwindCallFrame): + (JSC::Interpreter::throwException): + (JSC::Interpreter::execute): + (JSC::Interpreter::prepareForRepeatCall): + (JSC::Interpreter::debug): + (JSC::Interpreter::privateExecute): + (JSC::Interpreter::retrieveLastCaller): + * interpreter/Interpreter.h: + * jit/JIT.cpp: + (JSC::JIT::privateCompile): + * jit/JIT.h: + (JSC::JIT::compile): + * jit/JITOpcodes.cpp: + (JSC::JIT::privateCompileCTIMachineTrampolines): + (JSC::JIT::emit_op_new_func): + (JSC::JIT::emit_op_new_func_exp): + * jit/JITStubs.cpp: + (JSC::DEFINE_STUB_FUNCTION): + * jit/JITStubs.h: + (JSC::): + * parser/Nodes.cpp: + (JSC::FunctionBodyNode::reparseDataIfNecessary): + * parser/Nodes.h: + (JSC::EvalNode::partialDestroyData): + * parser/Parser.h: + * profiler/ProfileGenerator.cpp: + * profiler/Profiler.cpp: + (JSC::Profiler::createCallIdentifier): + (JSC::createCallIdentifierFromFunctionImp): + * runtime/Arguments.h: + (JSC::Arguments::getArgumentsData): + (JSC::Arguments::Arguments): + (JSC::JSActivation::copyRegisters): + * runtime/ArrayPrototype.cpp: + (JSC::isNumericCompareFunction): + * runtime/CallData.h: + (JSC::): + * runtime/Collector.cpp: + (JSC::Heap::collect): + * runtime/ConstructData.h: + (JSC::): + * runtime/ExceptionHelpers.cpp: + (JSC::createUndefinedVariableError): + (JSC::createInvalidParamError): + (JSC::createNotAConstructorError): + (JSC::createNotAFunctionError): + (JSC::createNotAnObjectError): + * runtime/Executable.cpp: Added. + (JSC::EvalExecutable::generateBytecode): + (JSC::ProgramExecutable::generateBytecode): + (JSC::FunctionExecutable::generateBytecode): + (JSC::EvalExecutable::generateJITCode): + (JSC::ProgramExecutable::generateJITCode): + (JSC::FunctionExecutable::generateJITCode): + (JSC::FunctionExecutable::isHostFunction): + (JSC::FunctionExecutable::markAggregate): + (JSC::FunctionExecutable::reparseExceptionInfo): + (JSC::EvalExecutable::reparseExceptionInfo): + (JSC::FunctionExecutable::recompile): + (JSC::FunctionExecutable::FunctionExecutable): + * runtime/Executable.h: + (JSC::ExecutableBase::~ExecutableBase): + (JSC::ExecutableBase::ExecutableBase): + (JSC::ExecutableBase::source): + (JSC::ExecutableBase::sourceID): + (JSC::ExecutableBase::lastLine): + (JSC::ExecutableBase::usesEval): + (JSC::ExecutableBase::usesArguments): + (JSC::ExecutableBase::needsActivation): + (JSC::ExecutableBase::astNode): + (JSC::ExecutableBase::generatedJITCode): + (JSC::ExecutableBase::getExecutablePool): + (JSC::EvalExecutable::EvalExecutable): + (JSC::EvalExecutable::bytecode): + (JSC::EvalExecutable::varStack): + (JSC::EvalExecutable::evalNode): + (JSC::EvalExecutable::jitCode): + (JSC::ProgramExecutable::ProgramExecutable): + (JSC::ProgramExecutable::reparseExceptionInfo): + (JSC::ProgramExecutable::bytecode): + (JSC::ProgramExecutable::programNode): + (JSC::ProgramExecutable::jitCode): + (JSC::FunctionExecutable::FunctionExecutable): + (JSC::FunctionExecutable::name): + (JSC::FunctionExecutable::bytecode): + (JSC::FunctionExecutable::generatedBytecode): + (JSC::FunctionExecutable::usesEval): + (JSC::FunctionExecutable::usesArguments): + (JSC::FunctionExecutable::parameterCount): + (JSC::FunctionExecutable::paramString): + (JSC::FunctionExecutable::isGenerated): + (JSC::FunctionExecutable::body): + (JSC::FunctionExecutable::jitCode): + (JSC::FunctionExecutable::createNativeThunk): + * runtime/FunctionConstructor.cpp: + (JSC::constructFunction): + * runtime/FunctionPrototype.cpp: + (JSC::functionProtoFuncToString): + * runtime/JSActivation.cpp: + (JSC::JSActivation::JSActivation): + (JSC::JSActivation::markChildren): + (JSC::JSActivation::isDynamicScope): + (JSC::JSActivation::argumentsGetter): + * runtime/JSActivation.h: + (JSC::JSActivation::JSActivationData::JSActivationData): + * runtime/JSFunction.cpp: + (JSC::JSFunction::isHostFunction): + (JSC::JSFunction::JSFunction): + (JSC::JSFunction::~JSFunction): + (JSC::JSFunction::markChildren): + (JSC::JSFunction::getCallData): + (JSC::JSFunction::call): + (JSC::JSFunction::lengthGetter): + (JSC::JSFunction::getConstructData): + (JSC::JSFunction::construct): + * runtime/JSFunction.h: + (JSC::JSFunction::executable): + (JSC::FunctionExecutable::make): + * runtime/JSGlobalData.cpp: + (JSC::JSGlobalData::JSGlobalData): + (JSC::JSGlobalData::numericCompareFunction): + * runtime/JSGlobalData.h: + +2009-08-17 Mark Rowe + + Reviewed by Darin Adler. + + Fix 300,000+ leaks seen during the regression tests. + + EvalCodeCache::get was heap-allocating an EvalExecutable instance without adopting the initial reference. + While fixing this we noticed that EvalExecutable was a RefCounted type that was sometimes stack allocated. + To make this cleaner and to prevent clients from attempting to ref a stack-allocated instance, we move the + refcounting down to a new CacheableEvalExecutable class that derives from EvalExecutable. EvalCodeCache::get + now uses CacheableEvalExecutable::create and avoids the leak. + + * bytecode/EvalCodeCache.h: + (JSC::EvalCodeCache::get): + * interpreter/Interpreter.cpp: + (JSC::Interpreter::callEval): + * runtime/Executable.h: + (JSC::CacheableEvalExecutable::create): + (JSC::CacheableEvalExecutable::CacheableEvalExecutable): + +2009-08-17 Oliver Hunt + + RS=Mark Rowe. + + REGRESSION (r47292): Prototype.js is broken by ES5 Arguments changes + https://bugs.webkit.org/show_bug.cgi?id=28341 + + + Reverting r47292. Alas Prototype.js breaks with Arguments inheriting + from Array as ES5 attempted. Prototype.js defines $A in terms of a + function it places on (among other global objects) the Array prototype, + thus breaking $A for arrays. + + * runtime/Arguments.h: + (JSC::Arguments::Arguments): + * runtime/JSGlobalObject.cpp: + (JSC::JSGlobalObject::reset): + (JSC::JSGlobalObject::markChildren): + * runtime/JSGlobalObject.h: + (JSC::JSGlobalObject::JSGlobalObjectData::JSGlobalObjectData): + * runtime/ObjectPrototype.cpp: + (JSC::ObjectPrototype::ObjectPrototype): + * runtime/ObjectPrototype.h: + * tests/mozilla/ecma_3/Function/arguments-001.js: + +2009-08-17 Peter Kasting + + Reviewed by Steve Falkenburg. + + https://bugs.webkit.org/show_bug.cgi?id=27323 + Only add Cygwin to the path when it isn't already there. This avoids + causing problems for people who purposefully have non-Cygwin versions of + executables like svn in front of the Cygwin ones in their paths. + + * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreCommon.vsprops: + * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreGenerated.vcproj: + * JavaScriptCore.vcproj/WTF/WTFCommon.vsprops: + * JavaScriptCore.vcproj/jsc/jscCommon.vsprops: + * JavaScriptCore.vcproj/testapi/testapiCommon.vsprops: + +2009-08-17 Xan Lopez + + Reviewed by Mark Rowe. + + Fix build with FAST_MALLOC_MATCH_VALIDATION enabled. + + * wtf/FastMalloc.cpp: + (WTF::fastMalloc): + (WTF::fastCalloc): + (WTF::fastRealloc): + +2009-08-16 Holger Hans Peter Freyther + + Reviewed by Mark Rowe. + + Fix crash on ./ecma_2/RegExp/exec-002.js. + https://bugs.webkit.org/show_bug.cgi?id=28353 + + Change the order of freeParenthesesDisjunctionContext and + popParenthesesDisjunctionContext on all call sites as the pop + method is accessing backTrack->lastContext which is the context + that is about to be freed. + + * yarr/RegexInterpreter.cpp: + (JSC::Yarr::Interpreter::parenthesesDoBacktrack): + (JSC::Yarr::Interpreter::backtrackParentheses): + +2009-08-16 Holger Hans Peter Freyther + + Reviewed by Mark Rowe. + + https://bugs.webkit.org/show_bug.cgi?id=28352 + + Fix coding style violations. Use m_ for C++ class members. Remove + trailing whitespace on empty lines. + + * yarr/RegexInterpreter.cpp: + (JSC::Yarr::Interpreter::ParenthesesDisjunctionContext::ParenthesesDisjunctionContext): + (JSC::Yarr::Interpreter::tryConsumeCharacter): + (JSC::Yarr::Interpreter::tryConsumeBackReference): + (JSC::Yarr::Interpreter::parenthesesDoBacktrack): + (JSC::Yarr::Interpreter::backtrackParentheses): + (JSC::Yarr::ByteCompiler::ByteCompiler): + (JSC::Yarr::ByteCompiler::compile): + (JSC::Yarr::ByteCompiler::checkInput): + (JSC::Yarr::ByteCompiler::assertionBOL): + (JSC::Yarr::ByteCompiler::assertionEOL): + (JSC::Yarr::ByteCompiler::assertionWordBoundary): + (JSC::Yarr::ByteCompiler::atomPatternCharacter): + (JSC::Yarr::ByteCompiler::atomCharacterClass): + (JSC::Yarr::ByteCompiler::atomBackReference): + (JSC::Yarr::ByteCompiler::atomParenthesesSubpatternBegin): + (JSC::Yarr::ByteCompiler::atomParentheticalAssertionBegin): + (JSC::Yarr::ByteCompiler::popParenthesesStack): + (JSC::Yarr::ByteCompiler::closeAlternative): + (JSC::Yarr::ByteCompiler::closeBodyAlternative): + (JSC::Yarr::ByteCompiler::atomParenthesesEnd): + (JSC::Yarr::ByteCompiler::regexBegin): + (JSC::Yarr::ByteCompiler::alterantiveBodyDisjunction): + (JSC::Yarr::ByteCompiler::alterantiveDisjunction): + (JSC::Yarr::ByteCompiler::emitDisjunction): + +2009-08-15 Mark Rowe + + Fix the build with JIT disabled. + + * runtime/Arguments.h: Only compile the jitCode method when the JIT is enabled. + * runtime/Executable.h: Include PrototypeFunction.h so the compiler knows what + NativeFunctionWrapper is when the JIT is disabled. + +2009-08-15 Adam Bergkvist + + Reviewed by Sam Weinig. + + Added ENABLE_EVENTSOURCE flag. + https://bugs.webkit.org/show_bug.cgi?id=14997 + + * Configurations/FeatureDefines.xcconfig: + +2009-08-14 Gavin Barraclough + + Reviewed by NOBODY (build fix). + + * parser/Parser.h: + (JSC::EvalExecutable::parse): + (JSC::ProgramExecutable::parse): + * runtime/Executable.h: + +2009-08-14 Gavin Barraclough + + Reviewed by Oliver Hunt. + + Remove AST nodes from use within the Runtime (outside of parsing), stage 1 + https://bugs.webkit.org/show_bug.cgi?id=28330 + + Remove the EvalNode and ProgramNode from use in the runtime. They still exist + after this patch, but are hidden behind EvalExecutable and FunctionExecutable, + and are also still reachable behind CodeBlock::m_ownerNode. + + The next step will be to beat back FunctionBodyNode in the same fashion. + Then remove the usage via CodeBlock, then only construct these nodes only on + demand during bytecode generation. + + * JavaScriptCore.xcodeproj/project.pbxproj: + * bytecode/CodeBlock.h: + (JSC::GlobalCodeBlock::GlobalCodeBlock): + (JSC::GlobalCodeBlock::~GlobalCodeBlock): + (JSC::ProgramCodeBlock::ProgramCodeBlock): + (JSC::EvalCodeBlock::EvalCodeBlock): + (JSC::FunctionCodeBlock::FunctionCodeBlock): + (JSC::NativeCodeBlock::NativeCodeBlock): + * bytecode/EvalCodeCache.h: + (JSC::EvalCodeCache::get): + * debugger/Debugger.cpp: + (JSC::evaluateInGlobalCallFrame): + * debugger/DebuggerCallFrame.cpp: + (JSC::DebuggerCallFrame::evaluate): + * interpreter/Interpreter.cpp: + (JSC::Interpreter::callEval): + (JSC::Interpreter::execute): + * interpreter/Interpreter.h: + * parser/Nodes.cpp: + (JSC::FunctionBodyNode::createNativeThunk): + (JSC::FunctionBodyNode::generateBytecode): + (JSC::FunctionBodyNode::bytecodeForExceptionInfoReparse): + * parser/Parser.h: + (JSC::Parser::parse): + (JSC::Parser::reparse): + (JSC::Parser::parseFunctionFromGlobalCode): + (JSC::::parse): + * runtime/Completion.cpp: + (JSC::checkSyntax): + (JSC::evaluate): + * runtime/Error.cpp: + (JSC::throwError): + * runtime/Error.h: + * runtime/Executable.h: Added. + (JSC::TemplateExecutable::TemplateExecutable): + (JSC::TemplateExecutable::markAggregate): + (JSC::TemplateExecutable::sourceURL): + (JSC::TemplateExecutable::lineNo): + (JSC::TemplateExecutable::bytecode): + (JSC::TemplateExecutable::jitCode): + (JSC::EvalExecutable::EvalExecutable): + (JSC::ProgramExecutable::ProgramExecutable): + * runtime/FunctionConstructor.cpp: + (JSC::constructFunction): + * runtime/FunctionConstructor.h: + * runtime/JSGlobalData.cpp: + (JSC::JSGlobalData::numericCompareFunction): + * runtime/JSGlobalObject.cpp: + (JSC::JSGlobalObject::~JSGlobalObject): + (JSC::JSGlobalObject::markChildren): + * runtime/JSGlobalObject.h: + (JSC::JSGlobalObject::codeBlocks): + * runtime/JSGlobalObjectFunctions.cpp: + (JSC::globalFuncEval): + +2009-08-14 Darin Adler + + Reviewed by Sam Weinig. + + Rename the confusing isObject() to inherits(). + It still works on non-objects, returning false. + + * runtime/ArrayConstructor.cpp: + (JSC::arrayConstructorIsArray): Removed unneeded isObject call + and updated remaining isObject call to new name, inherits. + + * runtime/JSCell.h: Renamed isObject() to inherits() + but more importantly, made it non-virtual (it was already inline) + so it is now as fast as JSObject::inherits was. + + * runtime/JSObject.h: Removed inherits function since the one + in the base class is fine as-is. Also made various JSCell functions + that should not be called on JSObject uncallable by making them + both private and not implemented. + (JSC::JSCell::inherits): Updated name. + (JSC::JSValue::inherits): Ditto. + + * debugger/Debugger.cpp: + (JSC::Debugger::recompileAllJSFunctions): + * interpreter/Interpreter.cpp: + (JSC::Interpreter::unwindCallFrame): + * runtime/ArrayPrototype.cpp: + (JSC::arrayProtoFuncToString): + (JSC::arrayProtoFuncToLocaleString): + (JSC::arrayProtoFuncConcat): + * runtime/BooleanPrototype.cpp: + (JSC::booleanProtoFuncToString): + (JSC::booleanProtoFuncValueOf): + * runtime/DateConstructor.cpp: + (JSC::constructDate): + * runtime/DatePrototype.cpp: + (JSC::dateProtoFuncToString): + (JSC::dateProtoFuncToUTCString): + (JSC::dateProtoFuncToISOString): + (JSC::dateProtoFuncToDateString): + (JSC::dateProtoFuncToTimeString): + (JSC::dateProtoFuncToLocaleString): + (JSC::dateProtoFuncToLocaleDateString): + (JSC::dateProtoFuncToLocaleTimeString): + (JSC::dateProtoFuncGetTime): + (JSC::dateProtoFuncGetFullYear): + (JSC::dateProtoFuncGetUTCFullYear): + (JSC::dateProtoFuncToGMTString): + (JSC::dateProtoFuncGetMonth): + (JSC::dateProtoFuncGetUTCMonth): + (JSC::dateProtoFuncGetDate): + (JSC::dateProtoFuncGetUTCDate): + (JSC::dateProtoFuncGetDay): + (JSC::dateProtoFuncGetUTCDay): + (JSC::dateProtoFuncGetHours): + (JSC::dateProtoFuncGetUTCHours): + (JSC::dateProtoFuncGetMinutes): + (JSC::dateProtoFuncGetUTCMinutes): + (JSC::dateProtoFuncGetSeconds): + (JSC::dateProtoFuncGetUTCSeconds): + (JSC::dateProtoFuncGetMilliSeconds): + (JSC::dateProtoFuncGetUTCMilliseconds): + (JSC::dateProtoFuncGetTimezoneOffset): + (JSC::dateProtoFuncSetTime): + (JSC::setNewValueFromTimeArgs): + (JSC::setNewValueFromDateArgs): + (JSC::dateProtoFuncSetYear): + (JSC::dateProtoFuncGetYear): + * runtime/FunctionPrototype.cpp: + (JSC::functionProtoFuncToString): + * runtime/JSActivation.cpp: + (JSC::JSActivation::argumentsGetter): + * runtime/JSValue.h: + * runtime/RegExpConstructor.cpp: + (JSC::constructRegExp): + * runtime/RegExpPrototype.cpp: + (JSC::regExpProtoFuncTest): + (JSC::regExpProtoFuncExec): + (JSC::regExpProtoFuncCompile): + (JSC::regExpProtoFuncToString): + * runtime/ScopeChain.cpp: + (JSC::ScopeChain::localDepth): + * runtime/StringPrototype.cpp: + (JSC::stringProtoFuncReplace): + (JSC::stringProtoFuncToString): + (JSC::stringProtoFuncMatch): + (JSC::stringProtoFuncSearch): + (JSC::stringProtoFuncSplit): + Updated to new name, inherits, from old name, isObject. + +2009-07-31 Harald Fernengel + + Reviewed by Simon Hausmann. + + Adding QNX as a platform. Currently only tested with Qt. + + https://bugs.webkit.org/show_bug.cgi?id=27885 + + * JavaScriptCore/runtime/Collector.cpp: Added retrieving of stack base + since QNX doesn't have the pthread _nt functions + * JavaScriptCore/wtf/Platform.h: Added WTF_PLATFORM_QNX and corresponding + defines + * WebCore/bridge/npapi.h: Build fix for missing typedefs on QNX + +2009-08-14 Gabor Loki + + Reviewed by Simon Hausmann. + + Currently generic ARM and ARMv7 platforms work only with JSVALUE32 + https://bugs.webkit.org/show_bug.cgi?id=28300 + + * wtf/Platform.h: + +2009-08-14 Gabor Loki + + Reviewed by Simon Hausmann. + + Enable JIT on ARM for QT by default + https://bugs.webkit.org/show_bug.cgi?id=28259 + + * wtf/Platform.h: + +2009-08-14 Gabor Loki + + Reviewed by Simon Hausmann. + + Enable YARR_JIT on ARM for QT by default + https://bugs.webkit.org/show_bug.cgi?id=28259 + + * wtf/Platform.h: + +2009-08-14 Oliver Hunt + + Reviewed by Gavin Barraclough. + + [ES5] Arguments object should inherit from Array + https://bugs.webkit.org/show_bug.cgi?id=28298 + + Make the Arguments object conform to the behaviour specified in ES5. + The simple portion of this is to make Arguments use Array.prototype + as its prototype rather than Object.prototype. + + The spec then requires us to set instance.constructor to the pristine + Object constructor, and instance.toString and instance.toLocaleString + to the pristine versions from Object.prototype. To do this we now + make the ObjectPrototype constructor return its toString and + toLocaleString functions (similar to the call and apply functions + from FunctionPrototype). + + Oddly enough this reports itself as a slight win, but given the code + isn't hit in the tests that claim to have improved I put this down to + code motion. + + * runtime/Arguments.h: + (JSC::Arguments::Arguments): + (JSC::Arguments::initializeStandardProperties): + * runtime/JSGlobalObject.cpp: + (JSC::JSGlobalObject::reset): + (JSC::JSGlobalObject::markChildren): + * runtime/JSGlobalObject.h: + (JSC::JSGlobalObject::JSGlobalObjectData::JSGlobalObjectData): + (JSC::JSGlobalObject::objectConstructor): + (JSC::JSGlobalObject::objectToStringFunction): + (JSC::JSGlobalObject::objectToLocaleStringFunction): + * runtime/ObjectPrototype.cpp: + (JSC::ObjectPrototype::ObjectPrototype): + * runtime/ObjectPrototype.h: + * tests/mozilla/ecma_3/Function/arguments-001.js: + Update test to new es5 behaviour + +2009-08-14 Oliver Hunt + + Reviewed by NOBODY (Build fix). + + Remove MarkStack::drain from the JSC exports file + + MarkStack::drain is now marked inline, the including it in the exports file + produces an ld warning + + * JavaScriptCore.exp: + +2009-08-13 Sam Weinig + + Reviewed by Oliver Hunt. + + Remove accidentally left in debugging statement. + + * runtime/JSArray.h: + (JSC::MarkStack::drain): + +2009-08-13 Oliver Hunt + + Reviewed by Maciej Stachowiak. + + [ES5] Implement Array.isArray + https://bugs.webkit.org/show_bug.cgi?id=28296 + + Add support for Array.isArray to the Array constructor + + * runtime/ArrayConstructor.cpp: + (JSC::ArrayConstructor::ArrayConstructor): + (JSC::arrayConstructorIsArray): + * runtime/ArrayConstructor.h: + * runtime/CommonIdentifiers.h: + * runtime/JSArray.h: + (JSC::MarkStack::drain): + * runtime/JSGlobalObject.cpp: + (JSC::JSGlobalObject::reset): + +2009-08-13 Oliver Hunt + + Reviewed by NOBODY (Buildfix). + + Attempt to fix windows build + + * runtime/Collector.cpp: + +2009-08-13 Oliver Hunt + + Reviewed by Maciej Stachowiak. + + Devirtualise marking + https://bugs.webkit.org/show_bug.cgi?id=28294 + + Add a bit to TypeInfo to indicate that an object uses the standard + JSObject::markChildren method. This allows us to devirtualise marking + of most objects (though a branch is still needed). We also add a branch + to identify arrays thus devirtualising marking in that case as well. + + In order to make the best use of this devirtualisation I've also reworked + the MarkStack::drain() logic to make the iteration more efficient. + + * API/JSCallbackConstructor.h: + (JSC::JSCallbackConstructor::createStructure): + * API/JSCallbackFunction.h: + (JSC::JSCallbackFunction::createStructure): + * JavaScriptCore.exp: + * runtime/BooleanObject.h: + (JSC::BooleanObject::createStructure): + * runtime/FunctionPrototype.h: + (JSC::FunctionPrototype::createStructure): + * runtime/InternalFunction.h: + (JSC::InternalFunction::createStructure): + * runtime/JSAPIValueWrapper.h: + (JSC::JSAPIValueWrapper::JSAPIValueWrapper): + * runtime/JSArray.cpp: + (JSC::JSArray::markChildren): + * runtime/JSArray.h: + (JSC::JSArray::markChildrenDirect): + (JSC::MarkStack::drain): + * runtime/JSByteArray.cpp: + (JSC::JSByteArray::createStructure): + * runtime/JSCell.h: + (JSC::MarkStack::append): + * runtime/JSGlobalData.cpp: + (JSC::JSGlobalData::JSGlobalData): + * runtime/JSNumberCell.h: + (JSC::JSNumberCell::createStructure): + * runtime/JSONObject.h: + (JSC::JSONObject::createStructure): + * runtime/JSObject.cpp: + (JSC::JSObject::markChildren): + * runtime/JSObject.h: + (JSC::JSObject::markChildrenDirect): + (JSC::JSObject::createStructure): + * runtime/JSString.h: + (JSC::JSString::createStructure): + * runtime/JSType.h: + (JSC::): + * runtime/MarkStack.h: + (JSC::MarkStack::MarkStack): + (JSC::MarkStack::MarkSet::MarkSet): + (JSC::MarkStack::MarkStackArray::last): + * runtime/MathObject.h: + (JSC::MathObject::createStructure): + * runtime/NumberConstructor.h: + (JSC::NumberConstructor::createStructure): + * runtime/NumberObject.h: + (JSC::NumberObject::createStructure): + * runtime/RegExpConstructor.h: + (JSC::RegExpConstructor::createStructure): + * runtime/RegExpObject.h: + (JSC::RegExpObject::createStructure): + * runtime/StringObjectThatMasqueradesAsUndefined.h: + (JSC::StringObjectThatMasqueradesAsUndefined::createStructure): + * runtime/TypeInfo.h: + (JSC::TypeInfo::hasDefaultMark): + +2009-08-13 Darin Adler + + Reviewed by Mark Rowe. + + Some small bits of housekeeping. + + * JavaScriptCore.xcodeproj/project.pbxproj: Make Parser.h + project instead of private. Remove JSONObject.lut.h. + + * assembler/ARMAssembler.h: Remove unneeded WTF prefix. + * assembler/AssemblerBufferWithConstantPool.h: Ditto. + * bytecompiler/BytecodeGenerator.h: Ditto. + + * wtf/SegmentedVector.h: Add a "using" statement as we do + with the other WTF headers. + +2009-08-13 Darin Adler + + Fix Tiger build. + + * parser/Grammar.y: Use a template function so we can compile + setStatementLocation even if it comes before YYLTYPE is defined. + +2009-08-13 Darin Adler + + Reviewed by George Staikos. + + Too much use of void* in Grammar.y + https://bugs.webkit.org/show_bug.cgi?id=28287 + + * parser/Grammar.y: Changed all the helper functions to + take a JSGlobalData* instead of a void*. A couple formatting + tweaks that I missed when breaking this into pieces. + +2009-08-13 Darin Adler + + Reviewed by George Staikos. + + Another part of https://bugs.webkit.org/show_bug.cgi?id=28287 + + * parser/Grammar.y: Reduced and sorted includes. Tweaked comment + format. Marked a few more functions inline. + +2009-08-13 Darin Adler + + Reviewed by George Staikos. + + Another part of https://bugs.webkit.org/show_bug.cgi?id=28287 + + * parser/Grammar.y: Pass the number to the PropertyNode instead of + first turning it into an Identifier. + + * parser/NodeConstructors.h: + (JSC::PropertyNode::PropertyNode): Add an overload that takes a double + so the code to convert to a string can be here instead of Grammar.y. + * parser/Nodes.h: Ditto. + +2009-08-13 Darin Adler + + Reviewed by George Staikos. + + Another part of https://bugs.webkit.org/show_bug.cgi?id=28287 + + * parser/Grammar.y: Eliminate the DBG macro. + +2009-08-13 Darin Adler + + Reviewed by George Staikos. + + Another part of https://bugs.webkit.org/show_bug.cgi?id=28287 + + * parser/Grammar.y: Eliminate the SET_EXCEPTION_LOCATION macro. + +2009-08-13 Darin Adler + + Reviewed by George Staikos. + + George asked me to break the patch from + https://bugs.webkit.org/show_bug.cgi?id=28287 + into smaller pieces and land it in stages. + + * parser/Grammar.y: Eliminate the LEXER macro. + +2009-08-13 Mark Rowe + + Try some more to fix the Windows build. + + * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: Export a new symbol. + * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def: Ditto. + +2009-08-13 Mark Rowe + + Try and fix the Windows build. + + * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: Export a new symbol. + * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def: Ditto. + +2009-08-13 Darin Adler + + Reviewed by David Levin. + + JavaScriptCore tweaks to get ready for the parser arena + https://bugs.webkit.org/show_bug.cgi?id=28243 + + Eliminate dependencies on Nodes.h outside JavaScriptCore, + and cut down on them inside JavaScriptCore. + + Change regular expression parsing to use identifiers as + with other strings we parse. + + Fix a couple things that are needed to use const Identifier + more, which will be part of the parser arena work. + + * JavaScriptCore.exp: Resorted and updated. + + * JavaScriptCore.xcodeproj/project.pbxproj: Changed + CollectorHeapIterator.h to be project-internal. + + * bytecompiler/BytecodeGenerator.cpp: + (JSC::BytecodeGenerator::emitPushNewScope): Added const. + * bytecompiler/BytecodeGenerator.h: Ditto. + + * debugger/Debugger.cpp: + (JSC::Debugger::recompileAllJSFunctions): Moved this function + here from WebCore. Here is better since it uses so many internals. + Removed unimportant optimization for the no listener case. + * debugger/Debugger.h: Ditto. Also removed unneeded include + and tweaked formatting and comments. + + * debugger/DebuggerCallFrame.cpp: + (JSC::DebuggerCallFrame::functionName): Call asFunction instead + of doing the unchecked static_cast. + (JSC::DebuggerCallFrame::calculatedFunctionName): Ditto. + + * jit/JITStubs.cpp: + (JSC::op_call_JSFunction): Call isHostFunction on the body rather + than on the JSFunction. + (JSC::vm_lazyLinkCall): Ditto. + (JSC::op_construct_JSConstruct): Ditto. + + * parser/Grammar.y: Changed callers to use new scanRegExp with + out arguments instead of relying on state in the Lexer. And + callers that just want to skip a regular expression to use + skipRegExp. + + * parser/Lexer.cpp: + (JSC::Lexer::scanRegExp): Changed to use out arguments, and to + add a prefix argument so we can add in the "=" character as needed. + Also rewrote to streamline the logic a bit inspired by suggestions + by David Levin. + (JSC::Lexer::skipRegExp): Added. Version of the function above that + does not actually put the regular expression into a string. + (JSC::Lexer::clear): Removed code to clear m_pattern and m_flags. + * parser/Lexer.h: Changed scanRegExp to have out arguments. Added + skipRegExp. Eliminated pattern, flags, m_pattern, and m_flags. + + * parser/NodeConstructors.h: + (JSC::RegExpNode::RegExpNode): Changed to take const Identifier&. + * parser/Nodes.cpp: + (JSC::RegExpNode::emitBytecode): Changed since m_pattern and + m_flags are now Identifier instead of UString. + (JSC::FunctionBodyNode::make): Moved this function here instead + of putting it in the JSFunction.h header. + * parser/Nodes.h: Changed RegExpNode to use Identifier. + + * profiler/Profiler.cpp: + (JSC::Profiler::createCallIdentifier): Changed to use isHostFunction + on the body instead of on the JSFunction object. + * runtime/FunctionPrototype.cpp: + (JSC::functionProtoFuncToString): Ditto. + + * runtime/JSFunction.cpp: + (JSC::JSFunction::isHostFunction): Moved here from header. + (JSC::JSFunction::isHostFunctionNonInline): Added. + (JSC::JSFunction::JSFunction): Removed unneeded initialization of + m_body to 0. + (JSC::JSFunction::setBody): Moved here from header. + + * runtime/JSFunction.h: Removed unneeded includes. Moved private + constructor down to the private section. Made virtual functions + private. Removed unneeded overload of setBody and moved the body + of the function into the .cpp file. Changed assertions to use + the non-inline version of isHostFunction. + + * runtime/PropertySlot.cpp: + (JSC::PropertySlot::functionGetter): Use asFunction instead + of doing the unchecked static_cast. + + * wtf/SegmentedVector.h: + (WTF::SegmentedVector::isEmpty): Added. + +2009-08-13 Mark Rowe + + Rubber-stamped by Darin Adler. + + Use the version of operator new that takes a JSGlobalData when allocating FuncDeclNode and FuncExprNode + from within the grammar to prevent these nodes from being leaked. + + * parser/Grammar.y: + +2009-08-13 Simon Hausmann + + Reviewed by Ariya Hidayat. + + Remove the special-case for Qt wrt JSVALUE_32 introduced in + r46709. It must've been a dependency issue on the bot, as + after a manual build all the tests pass on amd64 and ia32. + + * wtf/Platform.h: + +2009-08-12 Gabor Loki + + Reviewed by Gavin Barraclough. + + Add optimize call and property access support for ARM JIT. + https://bugs.webkit.org/show_bug.cgi?id=24986 + + For tightly coupled sequences the BEGIN_UNINTERRUPTED_SEQUENCE and + END_UNINTERRUPTED_SEQUENCE macros have been introduced which ensure + space for instructions and constants of the named sequence. This + method is vital for those architecture which are using constant pool. + + The 'latePatch' method - which was linked to JmpSrc - is replaced with + a port specific solution (each calls are marked to place their address + on the constant pool). + + * assembler/ARMAssembler.cpp: + (JSC::ARMAssembler::linkBranch): + (JSC::ARMAssembler::executableCopy): Add extra align for constant pool. + * assembler/ARMAssembler.h: + (JSC::ARMAssembler::JmpSrc::JmpSrc): + (JSC::ARMAssembler::sizeOfConstantPool): + (JSC::ARMAssembler::jmp): + (JSC::ARMAssembler::linkCall): + * assembler/ARMv7Assembler.h: + * assembler/AbstractMacroAssembler.h: + * assembler/AssemblerBufferWithConstantPool.h: + (JSC::AssemblerBufferWithConstantPool::flushIfNoSpaceFor): Fix the + computation of the remaining space. + * assembler/MacroAssemblerARM.h: + (JSC::MacroAssemblerARM::branch32): + (JSC::MacroAssemblerARM::nearCall): + (JSC::MacroAssemblerARM::call): + (JSC::MacroAssemblerARM::branchPtrWithPatch): + (JSC::MacroAssemblerARM::ensureSpace): + (JSC::MacroAssemblerARM::sizeOfConstantPool): + (JSC::MacroAssemblerARM::prepareCall): + * assembler/X86Assembler.h: + * jit/JIT.h: + * jit/JITCall.cpp: + (JSC::JIT::compileOpCall): + * jit/JITInlineMethods.h: + (JSC::JIT::beginUninterruptedSequence): + (JSC::JIT::endUninterruptedSequence): + * jit/JITPropertyAccess.cpp: + (JSC::JIT::emit_op_method_check): + (JSC::JIT::compileGetByIdHotPath): + (JSC::JIT::compileGetByIdSlowCase): + (JSC::JIT::emit_op_put_by_id): + +2009-08-12 Gavin Barraclough + + Rubber Stamped by Dave Kilzer. + + Disable WTF_USE_JSVALUE32_64 on iPhone for now (support not yet added for ARMv7). + + * wtf/Platform.h: + +2009-08-12 Gavin Barraclough + + Reviewed by Maciej Stachoviak. + + Ooops - moved code that had been accidentally added to op_new_func instead of + op_new_func_exp, to where it shoulds be. + + * interpreter/Interpreter.cpp: + (JSC::Interpreter::privateExecute): + * wtf/Platform.h: + +2009-08-12 Ada Chan + + Added workaround for the limitation that VirtualFree with MEM_RELEASE + can only accept the base address returned by VirtualAlloc when the region + was reserved and it can only free the entire region, and not a part of it. + + Reviewed by Oliver Hunt. + + * runtime/MarkStack.h: + (JSC::MarkStack::MarkStackArray::shrinkAllocation): + * runtime/MarkStackWin.cpp: + (JSC::MarkStack::releaseStack): + +2009-08-12 Balazs Kelemen + + Reviewed by Ariya Hidayat. + + Build fix: use std::numeric_limits::min() instead of LLONG_MIN + since LLONG_MIN is not defined in standard c++. + + * runtime/UString.cpp: + (JSC::UString::from): + +2009-08-12 Benjamin Otte + + Reviewed by Jan Alonzo. + + Buildfix for Gtk platforms debug builds. + + * GNUmakefile.am: Choose MarkStackPosix.cpp or MarkStackWin.cpp + depending on platform. + +2009-08-12 Simon Hausmann + + Prospective build fix for Mac and 32-bit Windows. + + * runtime/UString.cpp: Include wtf/StringExtras.h for snprintf. + (JSC::UString::from): Use %lld instead of %I64d for snprintf + on non-windows platforms. + +2009-08-12 Prasanth Ullattil + + Reviewed by Simon Hausmann. + + Fix compile error on 64Bit Windows, when UString::from + is called with an intptr_t. + + Added new UString::From overload with long long parameter. + + Thanks to Holger for the long long idea. + + * runtime/UString.cpp: + (JSC::UString::from): + * runtime/UString.h: + +2009-08-11 Oliver Hunt + + Reviewed by Mark Rowe. + + Minor style fixes. + + * runtime/UString.h: + (JSC::UString::Rep::createEmptyBuffer): + * wtf/FastMalloc.h: + (WTF::TryMallocReturnValue::getValue): + +2009-08-11 Oliver Hunt + + Reviewed by Gavin Barraclough. + + Make it harder to misuse try* allocation routines + https://bugs.webkit.org/show_bug.cgi?id=27469 + + Jump through a few hoops to make it much harder to accidentally + miss null-checking of values returned by the try-* allocation + routines. + + * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: + * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def: + * JavaScriptCore.xcodeproj/project.pbxproj: + * runtime/JSArray.cpp: + (JSC::JSArray::putSlowCase): + (JSC::JSArray::increaseVectorLength): + * runtime/StringPrototype.cpp: + (JSC::stringProtoFuncFontsize): + (JSC::stringProtoFuncLink): + * runtime/UString.cpp: + (JSC::allocChars): + (JSC::reallocChars): + (JSC::expandCapacity): + (JSC::UString::Rep::reserveCapacity): + (JSC::UString::expandPreCapacity): + (JSC::createRep): + (JSC::concatenate): + (JSC::UString::spliceSubstringsWithSeparators): + (JSC::UString::replaceRange): + (JSC::UString::append): + (JSC::UString::operator=): + * runtime/UString.h: + (JSC::UString::Rep::createEmptyBuffer): + * wtf/FastMalloc.cpp: + (WTF::tryFastZeroedMalloc): + (WTF::tryFastMalloc): + (WTF::tryFastCalloc): + (WTF::tryFastRealloc): + (WTF::TCMallocStats::tryFastMalloc): + (WTF::TCMallocStats::tryFastCalloc): + (WTF::TCMallocStats::tryFastRealloc): + * wtf/FastMalloc.h: + (WTF::TryMallocReturnValue::TryMallocReturnValue): + (WTF::TryMallocReturnValue::~TryMallocReturnValue): + (WTF::TryMallocReturnValue::operator PossiblyNull): + (WTF::TryMallocReturnValue::getValue): + * wtf/Platform.h: + * wtf/PossiblyNull.h: Added. + (WTF::PossiblyNull::PossiblyNull): + (WTF::PossiblyNull::~PossiblyNull): + (WTF::::getValue): + +2009-08-11 Gavin Barraclough + + Reviewed by NOBODY (build fix part deux). + + * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: + * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def: + +2009-08-11 Gavin Barraclough + + Reviewed by NOBODY (build fix). + + * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: + * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def: + +2009-08-11 Gavin Barraclough + + Reviewed by Oliver Hunt. + + Restrict use of FuncDeclNode & FuncExprNode to the parser. + https://bugs.webkit.org/show_bug.cgi?id=28209 + + These objects were also being referenced from the CodeBlock. By changing this + to just retain pointers to FunctionBodyNodes these classes can be restricted to + use during parsing. + + No performance impact (or sub-percent progression). + + * JavaScriptCore.exp: + Update symbols. + + * bytecode/CodeBlock.cpp: + (JSC::CodeBlock::mark): + (JSC::CodeBlock::reparseForExceptionInfoIfNecessary): + (JSC::CodeBlock::shrinkToFit): + * bytecode/CodeBlock.h: + (JSC::CodeBlock::addFunction): + (JSC::CodeBlock::function): + Unify m_functions & m_functionExpressions into a single Vector >. + + * bytecompiler/BytecodeGenerator.cpp: + (JSC::BytecodeGenerator::BytecodeGenerator): + (JSC::BytecodeGenerator::addConstant): + (JSC::BytecodeGenerator::emitNewFunction): + (JSC::BytecodeGenerator::emitNewFunctionExpression): + * bytecompiler/BytecodeGenerator.h: + FunctionStacks now contain FunctionBodyNodes not FuncDeclNodes. + + * interpreter/Interpreter.cpp: + (JSC::Interpreter::execute): + (JSC::Interpreter::privateExecute): + Update to reflect chnages in CodeBlock. + + * jit/JITOpcodes.cpp: + (JSC::JIT::emit_op_new_func_exp): + * jit/JITStubs.cpp: + (JSC::DEFINE_STUB_FUNCTION): + * jit/JITStubs.h: + (JSC::): + Update to reflect chnages in CodeBlock. + + * parser/Grammar.y: + FunctionStacks now contain FunctionBodyNodes not FuncDeclNodes. + + * parser/NodeConstructors.h: + (JSC::FuncExprNode::FuncExprNode): + (JSC::FuncDeclNode::FuncDeclNode): + * parser/Nodes.cpp: + (JSC::ScopeNodeData::mark): + (JSC::FunctionBodyNode::finishParsing): + * parser/Nodes.h: + (JSC::FunctionBodyNode::ident): + Move m_ident & make methods from FuncDeclNode & FuncExprNode to FunctionBodyNode. + + * runtime/JSFunction.h: + (JSC::FunctionBodyNode::make): + Make this method inline (was FuncDeclNode::makeFunction). + +2009-08-11 Oliver Hunt + + Reviewed by Gavin Barraclough. + + Native JSON.stringify does not omit functions + https://bugs.webkit.org/show_bug.cgi?id=28117 + + Objects that are callable should be treated as undefined when + serialising to JSON. + + * runtime/JSONObject.cpp: + (JSC::Stringifier::appendStringifiedValue): + +2009-08-11 Oliver Hunt + + Reviewed by Geoff Garen. + + REGRESSION: Hang/crash in BytecodeGenerator::constRegisterFor loading simple page + https://bugs.webkit.org/show_bug.cgi?id=28169 + + Handle the case where someone has attempted to shadow a property + on the global object with a constant. + + * bytecompiler/BytecodeGenerator.cpp: + (JSC::BytecodeGenerator::constRegisterFor): + * parser/Nodes.cpp: + (JSC::ConstDeclNode::emitCodeSingle): + +2009-08-11 John Gregg + + Reviewed by Maciej Stachowiak. + + Desktop Notifications API + https://bugs.webkit.org/show_bug.cgi?id=25463 + + Adds ENABLE_NOTIFICATION flag. + + * Configurations/FeatureDefines.xcconfig: + * wtf/Platform.h: + +2009-08-11 Maxime Simon + + Reviewed by Eric Seidel. + + Modifications on JavaScriptCore to allow Haiku port. + https://bugs.webkit.org/show_bug.cgi?id=28121 + + * runtime/Collector.cpp: Haiku doesn't have sys/mman.h, using OS.h instead. + (JSC::currentThreadStackBase): Haiku uses its own threading system. + * wtf/Platform.h: Defining all Haiku platform values. + * wtf/haiku/MainThreadHaiku.cpp: Adding a missing header (NotImplemented.h). + +2009-08-11 Jessie Berlin + + Reviewed by Adam Roben. + + Fix windows build. + + * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def: + +2009-08-11 Csaba Osztrogonac + + Reviewed by Tor Arne Vestbø. + + Buildfix for Qt-win platforms. + + * JavaScriptCore.pri: Choose MarkStackPosix.cpp or MarkStackWin.cpp depend on platform. + 2009-08-10 Oliver Hunt Reviewed by NOBODY (And another build fix). diff --git a/JavaScriptCore/Configurations/FeatureDefines.xcconfig b/JavaScriptCore/Configurations/FeatureDefines.xcconfig index 10328e8cc..d4ec56376 100644 --- a/JavaScriptCore/Configurations/FeatureDefines.xcconfig +++ b/JavaScriptCore/Configurations/FeatureDefines.xcconfig @@ -36,10 +36,12 @@ ENABLE_CHANNEL_MESSAGING = ENABLE_CHANNEL_MESSAGING; ENABLE_DATABASE = ENABLE_DATABASE; ENABLE_DATAGRID = ENABLE_DATAGRID; ENABLE_DOM_STORAGE = ENABLE_DOM_STORAGE; +ENABLE_EVENTSOURCE = ENABLE_EVENTSOURCE; ENABLE_FILTERS = ; ENABLE_GEOLOCATION = ; ENABLE_ICONDATABASE = ENABLE_ICONDATABASE; ENABLE_JAVASCRIPT_DEBUGGER = ENABLE_JAVASCRIPT_DEBUGGER; +ENABLE_NOTIFICATIONS = ; ENABLE_OFFLINE_WEB_APPLICATIONS = ENABLE_OFFLINE_WEB_APPLICATIONS; ENABLE_RUBY = ENABLE_RUBY; ENABLE_SHARED_WORKERS = ; @@ -57,4 +59,4 @@ ENABLE_WORKERS = ENABLE_WORKERS; ENABLE_XPATH = ENABLE_XPATH; ENABLE_XSLT = ENABLE_XSLT; -FEATURE_DEFINES = $(ENABLE_3D_RENDERING) $(ENABLE_CHANNEL_MESSAGING) $(ENABLE_DATABASE) $(ENABLE_DATAGRID) $(ENABLE_DOM_STORAGE) $(ENABLE_FILTERS) $(ENABLE_GEOLOCATION) $(ENABLE_ICONDATABASE) $(ENABLE_JAVASCRIPT_DEBUGGER) $(ENABLE_OFFLINE_WEB_APPLICATIONS) $(ENABLE_RUBY) $(ENABLE_SHARED_WORKERS) $(ENABLE_SVG) $(ENABLE_SVG_ANIMATION) $(ENABLE_SVG_AS_IMAGE) $(ENABLE_SVG_DOM_OBJC_BINDINGS) $(ENABLE_SVG_FONTS) $(ENABLE_SVG_FOREIGN_OBJECT) $(ENABLE_SVG_USE) $(ENABLE_VIDEO) $(ENABLE_WEB_SOCKETS) $(ENABLE_WML) $(ENABLE_WORKERS) $(ENABLE_XPATH) $(ENABLE_XSLT); +FEATURE_DEFINES = $(ENABLE_3D_RENDERING) $(ENABLE_CHANNEL_MESSAGING) $(ENABLE_DATABASE) $(ENABLE_DATAGRID) $(ENABLE_DOM_STORAGE) $(ENABLE_EVENTSOURCE) $(ENABLE_FILTERS) $(ENABLE_GEOLOCATION) $(ENABLE_ICONDATABASE) $(ENABLE_JAVASCRIPT_DEBUGGER) $(ENABLE_NOTIFICATIONS) $(ENABLE_OFFLINE_WEB_APPLICATIONS) $(ENABLE_RUBY) $(ENABLE_SHARED_WORKERS) $(ENABLE_SVG) $(ENABLE_SVG_ANIMATION) $(ENABLE_SVG_AS_IMAGE) $(ENABLE_SVG_DOM_OBJC_BINDINGS) $(ENABLE_SVG_FONTS) $(ENABLE_SVG_FOREIGN_OBJECT) $(ENABLE_SVG_USE) $(ENABLE_VIDEO) $(ENABLE_WEB_SOCKETS) $(ENABLE_WML) $(ENABLE_WORKERS) $(ENABLE_XPATH) $(ENABLE_XSLT); diff --git a/JavaScriptCore/GNUmakefile.am b/JavaScriptCore/GNUmakefile.am index 6b4dc6de4..b20c0cd11 100644 --- a/JavaScriptCore/GNUmakefile.am +++ b/JavaScriptCore/GNUmakefile.am @@ -193,7 +193,6 @@ javascriptcore_sources += \ JavaScriptCore/runtime/LiteralParser.h \ JavaScriptCore/runtime/MarkStack.cpp \ JavaScriptCore/runtime/MarkStack.h \ - JavaScriptCore/runtime/MarkStackPosix.cpp \ JavaScriptCore/runtime/SmallStrings.cpp \ JavaScriptCore/runtime/SmallStrings.h \ JavaScriptCore/runtime/Structure.cpp \ @@ -288,10 +287,12 @@ javascriptcore_sources += \ if TARGET_WIN32 javascriptcore_sources += \ JavaScriptCore/wtf/ThreadSpecificWin.cpp \ - JavaScriptCore/jit/ExecutableAllocatorWin.cpp + JavaScriptCore/jit/ExecutableAllocatorWin.cpp \ + JavaScriptCore/runtime/MarkStackWin.cpp else javascriptcore_sources += \ - JavaScriptCore/jit/ExecutableAllocatorPosix.cpp + JavaScriptCore/jit/ExecutableAllocatorPosix.cpp \ + JavaScriptCore/runtime/MarkStackPosix.cpp endif # ---- @@ -393,6 +394,7 @@ javascriptcore_sources += \ JavaScriptCore/runtime/ErrorInstance.h \ JavaScriptCore/runtime/ErrorPrototype.cpp \ JavaScriptCore/runtime/ErrorPrototype.h \ + JavaScriptCore/runtime/Executable.cpp \ JavaScriptCore/runtime/FunctionConstructor.cpp \ JavaScriptCore/runtime/FunctionConstructor.h \ JavaScriptCore/runtime/FunctionPrototype.cpp \ @@ -439,9 +441,6 @@ javascriptcore_sources += \ JavaScriptCore/runtime/JSWrapperObject.h \ JavaScriptCore/runtime/Lookup.cpp \ JavaScriptCore/runtime/Lookup.h \ - JavaScriptCore/runtime/MarkStack.cpp \ - JavaScriptCore/runtime/MarkStack.h \ - JavaScriptCore/runtime/MarkStackWin.cpp \ JavaScriptCore/runtime/MathObject.cpp \ JavaScriptCore/runtime/MathObject.h \ JavaScriptCore/runtime/NativeErrorConstructor.cpp \ diff --git a/JavaScriptCore/JavaScriptCore.exp b/JavaScriptCore/JavaScriptCore.exp index 3a2acd76c..8351f834f 100644 --- a/JavaScriptCore/JavaScriptCore.exp +++ b/JavaScriptCore/JavaScriptCore.exp @@ -95,7 +95,6 @@ __ZN3JSC10Identifier24checkSameIdentifierTableEPNS_12JSGlobalDataEPNS_7UString3R __ZN3JSC10Identifier24checkSameIdentifierTableEPNS_9ExecStateEPNS_7UString3RepE __ZN3JSC10Identifier3addEPNS_9ExecStateEPKc __ZN3JSC10Identifier5equalEPKNS_7UString3RepEPKc -__ZN3JSC10JSFunction4infoE __ZN3JSC10JSFunctionC1EPNS_9ExecStateEN3WTF10PassRefPtrINS_9StructureEEEiRKNS_10IdentifierEPFNS_7JSValueES2_PNS_8JSObjectESA_RKNS_7ArgListEE __ZN3JSC10throwErrorEPNS_9ExecStateENS_9ErrorTypeE __ZN3JSC10throwErrorEPNS_9ExecStateENS_9ErrorTypeEPKc @@ -143,9 +142,9 @@ __ZN3JSC14TimeoutChecker5resetEv __ZN3JSC14constructArrayEPNS_9ExecStateERKNS_7ArgListE __ZN3JSC15JSWrapperObject12markChildrenERNS_9MarkStackE __ZN3JSC15toInt32SlowCaseEdRb -__ZN3JSC16FunctionBodyNode13finishParsingEPNS_10IdentifierEm +__ZN3JSC16FunctionBodyNode13finishParsingEPNS_10IdentifierEmRKS1_ __ZN3JSC16FunctionBodyNode14copyParametersEv -__ZN3JSC16FunctionBodyNode6createEPNS_12JSGlobalDataEPNS_14SourceElementsEPN3WTF6VectorISt4pairINS_10IdentifierEjELm0EEEPNS6_IPNS_12FuncDeclNodeELm0EEERKNS_10SourceCodeEji +__ZN3JSC16FunctionBodyNode6createEPNS_12JSGlobalDataEPNS_14SourceElementsEPN3WTF6VectorISt4pairINS_10IdentifierEjELm0EEEPNS6_IPS0_Lm0EEERKNS_10SourceCodeEji __ZN3JSC16InternalFunction4infoE __ZN3JSC16InternalFunction4nameEPNS_12JSGlobalDataE __ZN3JSC16InternalFunctionC2EPNS_12JSGlobalDataEN3WTF10PassRefPtrINS_9StructureEEERKNS_10IdentifierE @@ -196,8 +195,8 @@ __ZN3JSC6JSCell3putEPNS_9ExecStateERKNS_10IdentifierENS_7JSValueERNS_15PutProper __ZN3JSC6JSCell3putEPNS_9ExecStateEjNS_7JSValueE __ZN3JSC6JSCell9getObjectEv __ZN3JSC6JSCellnwEmPNS_9ExecStateE -__ZN3JSC6JSLock12DropAllLocksC1EPNS_9ExecStateE __ZN3JSC6JSLock12DropAllLocksC1ENS_14JSLockBehaviorE +__ZN3JSC6JSLock12DropAllLocksC1EPNS_9ExecStateE __ZN3JSC6JSLock12DropAllLocksD1Ev __ZN3JSC6JSLock4lockENS_14JSLockBehaviorE __ZN3JSC6JSLock6unlockENS_14JSLockBehaviorE @@ -227,9 +226,9 @@ __ZN3JSC7UString6appendERKS0_ __ZN3JSC7UStringC1EPKc __ZN3JSC7UStringC1EPKti __ZN3JSC7UStringaSEPKc +__ZN3JSC8Debugger23recompileAllJSFunctionsEPNS_12JSGlobalDataE __ZN3JSC8Debugger6attachEPNS_14JSGlobalObjectE __ZN3JSC8Debugger6detachEPNS_14JSGlobalObjectE -__ZN3JSC8DebuggerC2Ev __ZN3JSC8DebuggerD2Ev __ZN3JSC8JSObject11hasInstanceEPNS_9ExecStateENS_7JSValueES3_ __ZN3JSC8JSObject12defineGetterEPNS_9ExecStateERKNS_10IdentifierEPS0_ @@ -324,14 +323,13 @@ __ZN3WTF8CollatorC1EPKc __ZN3WTF8CollatorD1Ev __ZN3WTF8fastFreeEPv __ZN3WTF9ByteArray6createEm +__ZNK3JSC10JSFunction23isHostFunctionNonInlineEv __ZNK3JSC11Interpreter14retrieveCallerEPNS_9ExecStateEPNS_16InternalFunctionE __ZNK3JSC11Interpreter18retrieveLastCallerEPNS_9ExecStateERiRlRNS_7UStringERNS_7JSValueE __ZNK3JSC12DateInstance7getTimeERdRi __ZNK3JSC12StringObject12toThisStringEPNS_9ExecStateE __ZNK3JSC12StringObject8toStringEPNS_9ExecStateE __ZNK3JSC14JSGlobalObject14isDynamicScopeEv - -__ZNK3JSC16FunctionBodyNode14isHostFunctionEv __ZNK3JSC16InternalFunction9classInfoEv __ZNK3JSC16JSVariableObject16isVariableObjectEv __ZNK3JSC16JSVariableObject21getPropertyAttributesEPNS_9ExecStateERKNS_10IdentifierERj @@ -379,6 +377,7 @@ __ZTVN3JSC15JSWrapperObjectE __ZTVN3JSC16InternalFunctionE __ZTVN3JSC16JSVariableObjectE __ZTVN3JSC17JSAPIValueWrapperE +__ZTVN3JSC8DebuggerE __ZTVN3JSC8JSObjectE __ZTVN3JSC8JSStringE _jscore_fastmalloc_introspection diff --git a/JavaScriptCore/JavaScriptCore.pri b/JavaScriptCore/JavaScriptCore.pri index dd48c9a48..490f02029 100644 --- a/JavaScriptCore/JavaScriptCore.pri +++ b/JavaScriptCore/JavaScriptCore.pri @@ -99,7 +99,6 @@ SOURCES += \ runtime/JSONObject.cpp \ runtime/LiteralParser.cpp \ runtime/MarkStack.cpp \ - runtime/MarkStackPosix.cpp \ runtime/TimeoutChecker.cpp \ bytecode/CodeBlock.cpp \ bytecode/StructureStubInfo.cpp \ @@ -123,8 +122,13 @@ SOURCES += \ yarr/RegexJIT.cpp \ interpreter/RegisterFile.cpp -win32-*: SOURCES += jit/ExecutableAllocatorWin.cpp -else: SOURCES += jit/ExecutableAllocatorPosix.cpp +win32-* { + SOURCES += jit/ExecutableAllocatorWin.cpp \ + runtime/MarkStackWin.cpp +} else { + SOURCES += jit/ExecutableAllocatorPosix.cpp \ + runtime/MarkStackPosix.cpp +} # AllInOneFile.cpp helps gcc analize and optimize code # Other compilers may be able to do this at link time @@ -154,6 +158,7 @@ SOURCES += \ runtime/ErrorInstance.cpp \ runtime/ErrorPrototype.cpp \ interpreter/CallFrame.cpp \ + runtime/Executable.cpp \ runtime/FunctionConstructor.cpp \ runtime/FunctionPrototype.cpp \ runtime/GetterSetter.cpp \ diff --git a/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def b/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def index 0de51bff5..9f73d6d69 100644 --- a/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def +++ b/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def @@ -1,13 +1,7 @@ LIBRARY "JavaScriptCore" EXPORTS - ?from@UString@JSC@@SA?AV12@N@Z - ?nonInlineNaN@JSC@@YANXZ - ?synthesizePrototype@JSValue@JSC@@ABEPAVJSObject@2@PAVExecState@2@@Z - ?toObjectSlowCase@JSValue@JSC@@ABEPAVJSObject@2@PAVExecState@2@@Z - ?toThisObjectSlowCase@JSValue@JSC@@ABEPAVJSObject@2@PAVExecState@2@@Z ??0Collator@WTF@@QAE@PBD@Z - ??0Debugger@JSC@@QAE@XZ ??0DropAllLocks@JSLock@JSC@@QAE@W4JSLockBehavior@2@@Z ??0InternalFunction@JSC@@IAE@PAVJSGlobalData@1@V?$PassRefPtr@VStructure@JSC@@@WTF@@ABVIdentifier@1@@Z ??0JSByteArray@JSC@@QAE@PAVExecState@1@V?$PassRefPtr@VStructure@JSC@@@WTF@@PAVByteArray@4@PBUClassInfo@1@@Z @@ -47,7 +41,6 @@ EXPORTS ?allocate@Heap@JSC@@QAEPAXI@Z ?allocatePropertyStorage@JSObject@JSC@@QAEXII@Z ?allocateStack@MarkStack@JSC@@CAPAXI@Z - ?allocateStack@MarkStack@JSC@@CAPAXI@Z ?append@UString@JSC@@QAEAAV12@ABV12@@Z ?append@UString@JSC@@QAEAAV12@PBD@Z ?ascii@UString@JSC@@QBEPADXZ @@ -75,7 +68,7 @@ EXPORTS ?convertUTF16ToUTF8@Unicode@WTF@@YA?AW4ConversionResult@12@PAPB_WPB_WPAPADPAD_N@Z ?copyParameters@FunctionBodyNode@JSC@@QAEPAVIdentifier@2@XZ ?create@ByteArray@WTF@@SA?AV?$PassRefPtr@VByteArray@WTF@@@2@I@Z - ?create@FunctionBodyNode@JSC@@SA?AV?$PassRefPtr@VFunctionBodyNode@JSC@@@WTF@@PAVJSGlobalData@2@PAVSourceElements@2@PAV?$Vector@U?$pair@VIdentifier@JSC@@I@std@@$0A@@4@PAV?$Vector@PAVFuncDeclNode@JSC@@$0A@@4@ABVSourceCode@2@IH@Z + ?create@FunctionBodyNode@JSC@@SA?AV?$PassRefPtr@VFunctionBodyNode@JSC@@@WTF@@PAVJSGlobalData@2@PAVSourceElements@2@PAV?$Vector@U?$pair@VIdentifier@JSC@@I@std@@$0A@@4@PAV?$Vector@PAVFunctionBodyNode@JSC@@$0A@@4@ABVSourceCode@2@IH@Z ?create@JSGlobalData@JSC@@SA?AV?$PassRefPtr@VJSGlobalData@JSC@@@WTF@@_N@Z ?create@OpaqueJSString@@SA?AV?$PassRefPtr@UOpaqueJSString@@@WTF@@ABVUString@JSC@@@Z ?create@Rep@UString@JSC@@SA?AV?$PassRefPtr@URep@UString@JSC@@@WTF@@PA_WHV?$PassRefPtr@V?$CrossThreadRefCounted@V?$OwnFastMallocPtr@_W@WTF@@@WTF@@@5@@Z @@ -120,10 +113,11 @@ EXPORTS ?fastRealloc@WTF@@YAPAXPAXI@Z ?fastZeroedMalloc@WTF@@YAPAXI@Z ?fillGetterPropertySlot@JSObject@JSC@@QAEXAAVPropertySlot@2@PAVJSValue@2@@Z - ?finishParsing@FunctionBodyNode@JSC@@QAEXPAVIdentifier@2@I@Z + ?finishParsing@FunctionBodyNode@JSC@@QAEXPAVIdentifier@2@IABV32@@Z ?focus@Profile@JSC@@QAEXPBVProfileNode@2@@Z ?from@UString@JSC@@SA?AV12@H@Z ?from@UString@JSC@@SA?AV12@I@Z + ?from@UString@JSC@@SA?AV12@N@Z ?functionName@DebuggerCallFrame@JSC@@QBEPBVUString@2@XZ ?get@Structure@JSC@@QAEIPBURep@UString@2@AAIAAPAVJSCell@2@@Z ?getCallData@JSCell@JSC@@UAE?AW4CallType@2@AATCallData@2@@Z @@ -164,7 +158,7 @@ EXPORTS ?isBusy@Heap@JSC@@QAE_NXZ ?isDynamicScope@JSGlobalObject@JSC@@UBE_NXZ ?isGetterSetter@JSCell@JSC@@UBE_NXZ - ?isHostFunction@FunctionBodyNode@JSC@@QBE_NXZ + ?isHostFunctionNonInline@JSFunction@JSC@@ABE_NXZ ?isMainThread@WTF@@YA_NXZ ?isVariableObject@JSVariableObject@JSC@@UBE_NXZ ?jsNumberCell@JSC@@YA?AVJSValue@1@PAVExecState@1@N@Z @@ -183,6 +177,7 @@ EXPORTS ?markChildren@JSWrapperObject@JSC@@UAEXAAVMarkStack@2@@Z ?materializePropertyMap@Structure@JSC@@AAEXXZ ?name@InternalFunction@JSC@@QAEABVUString@2@PAVJSGlobalData@2@@Z + ?nonInlineNaN@JSC@@YANXZ ?objectCount@Heap@JSC@@QAEIXZ ?objectProtoFuncToString@JSC@@YI?AVJSValue@1@PAVExecState@1@PAVJSObject@1@V21@ABVArgList@1@@Z ?parse@Parser@JSC@@AAEXPAVJSGlobalData@2@PAHPAVUString@2@@Z @@ -206,6 +201,7 @@ EXPORTS ?putWithAttributes@JSObject@JSC@@UAEXPAVExecState@2@ABVIdentifier@2@VJSValue@2@I_NAAVPutPropertySlot@2@@Z ?putWithAttributes@JSObject@JSC@@UAEXPAVExecState@2@IVJSValue@2@I@Z ?randomNumber@WTF@@YANXZ + ?recompileAllJSFunctions@Debugger@JSC@@QAEXPAVJSGlobalData@2@@Z ?recordExtraCost@Heap@JSC@@AAEXI@Z ?releaseStack@MarkStack@JSC@@CAXPAXI@Z ?reset@ParserArena@JSC@@QAEXXZ @@ -228,6 +224,7 @@ EXPORTS ?stopProfiling@Profiler@JSC@@QAE?AV?$PassRefPtr@VProfile@JSC@@@WTF@@PAVExecState@2@ABVUString@2@@Z ?strtod@WTF@@YANPBDPAPAD@Z ?substr@UString@JSC@@QBE?AV12@HH@Z + ?synthesizePrototype@JSValue@JSC@@ABEPAVJSObject@2@PAVExecState@2@@Z ?thisObject@DebuggerCallFrame@JSC@@QBEPAVJSObject@2@XZ ?throwError@JSC@@YAPAVJSObject@1@PAVExecState@1@W4ErrorType@1@@Z ?throwError@JSC@@YAPAVJSObject@1@PAVExecState@1@W4ErrorType@1@ABVUString@1@@Z @@ -245,6 +242,7 @@ EXPORTS ?toObject@JSAPIValueWrapper@JSC@@UBEPAVJSObject@2@PAVExecState@2@@Z ?toObject@JSObject@JSC@@UBEPAV12@PAVExecState@2@@Z ?toObject@JSString@JSC@@EBEPAVJSObject@2@PAVExecState@2@@Z + ?toObjectSlowCase@JSValue@JSC@@ABEPAVJSObject@2@PAVExecState@2@@Z ?toPrimitive@JSAPIValueWrapper@JSC@@UBE?AVJSValue@2@PAVExecState@2@W4PreferredPrimitiveType@2@@Z ?toPrimitive@JSString@JSC@@EBE?AVJSValue@2@PAVExecState@2@W4PreferredPrimitiveType@2@@Z ?toStrictUInt32@UString@JSC@@QBEIPA_N@Z @@ -258,13 +256,14 @@ EXPORTS ?toThisObject@JSCell@JSC@@UBEPAVJSObject@2@PAVExecState@2@@Z ?toThisObject@JSObject@JSC@@UBEPAV12@PAVExecState@2@@Z ?toThisObject@JSString@JSC@@EBEPAVJSObject@2@PAVExecState@2@@Z + ?toThisObjectSlowCase@JSValue@JSC@@ABEPAVJSObject@2@PAVExecState@2@@Z ?toThisString@JSCell@JSC@@UBE?AVUString@2@PAVExecState@2@@Z ?toThisString@JSString@JSC@@EBE?AVUString@2@PAVExecState@2@@Z ?toThisString@StringObject@JSC@@EBE?AVUString@2@PAVExecState@2@@Z ?toUInt32@UString@JSC@@QBEIPA_N@Z ?toUInt32@UString@JSC@@QBEIPA_N_N@Z ?toUInt32SlowCase@JSC@@YAINAA_N@Z - ?tryFastCalloc@WTF@@YAPAXII@Z + ?tryFastCalloc@WTF@@YA?AUTryMallocReturnValue@1@II@Z ?tryLock@Mutex@WTF@@QAE_NXZ ?type@DebuggerCallFrame@JSC@@QBE?AW4Type@12@XZ ?unlock@JSLock@JSC@@SAXW4JSLockBehavior@2@@Z diff --git a/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj b/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj index 1c5e96340..4aae5b21b 100644 --- a/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj +++ b/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj @@ -644,6 +644,10 @@ > + + diff --git a/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreCommon.vsprops b/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreCommon.vsprops index 5f90011d1..ba6bbfd86 100644 --- a/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreCommon.vsprops +++ b/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreCommon.vsprops @@ -21,7 +21,7 @@ /> - - - - - - + + + + + + + diff --git a/JavaScriptCore/JavaScriptCore.vcproj/jsc/jscCommon.vsprops b/JavaScriptCore/JavaScriptCore.vcproj/jsc/jscCommon.vsprops index 3a1e42e4d..7e8a19390 100644 --- a/JavaScriptCore/JavaScriptCore.vcproj/jsc/jscCommon.vsprops +++ b/JavaScriptCore/JavaScriptCore.vcproj/jsc/jscCommon.vsprops @@ -20,6 +20,6 @@ /> diff --git a/JavaScriptCore/JavaScriptCore.vcproj/testapi/testapiCommon.vsprops b/JavaScriptCore/JavaScriptCore.vcproj/testapi/testapiCommon.vsprops index 2a36c18f0..738d4d5b2 100644 --- a/JavaScriptCore/JavaScriptCore.vcproj/testapi/testapiCommon.vsprops +++ b/JavaScriptCore/JavaScriptCore.vcproj/testapi/testapiCommon.vsprops @@ -21,6 +21,6 @@ /> diff --git a/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj b/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj index 6c3d49f28..973e3a33f 100644 --- a/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj +++ b/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj @@ -95,7 +95,7 @@ 14BD5A300A3E91F600BAF59C /* JSContextRef.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 14BD5A290A3E91F600BAF59C /* JSContextRef.cpp */; }; 14BD5A320A3E91F600BAF59C /* JSValueRef.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 14BD5A2B0A3E91F600BAF59C /* JSValueRef.cpp */; }; 14C5242B0F5355E900BA3D04 /* JITStubs.h in Headers */ = {isa = PBXBuildFile; fileRef = 14A6581A0F4E36F4000150FD /* JITStubs.h */; settings = {ATTRIBUTES = (Private, ); }; }; - 14F3488F0E95EF8A003648BC /* CollectorHeapIterator.h in Headers */ = {isa = PBXBuildFile; fileRef = 14F3488E0E95EF8A003648BC /* CollectorHeapIterator.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 14F3488F0E95EF8A003648BC /* CollectorHeapIterator.h in Headers */ = {isa = PBXBuildFile; fileRef = 14F3488E0E95EF8A003648BC /* CollectorHeapIterator.h */; settings = {ATTRIBUTES = (); }; }; 180B9B080F16D94F009BDBC5 /* CurrentTime.h in Headers */ = {isa = PBXBuildFile; fileRef = 180B9AF00F16C569009BDBC5 /* CurrentTime.h */; settings = {ATTRIBUTES = (Private, ); }; }; 180B9BFE0F16E94D009BDBC5 /* CurrentTime.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 180B9AEF0F16C569009BDBC5 /* CurrentTime.cpp */; }; 1C61516C0EBAC7A00031376F /* ProfilerServer.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1C61516A0EBAC7A00031376F /* ProfilerServer.mm */; settings = {COMPILER_FLAGS = "-fno-strict-aliasing"; }; }; @@ -132,6 +132,8 @@ 86ADD1450FDDEA980006EEC2 /* ARMv7Assembler.h in Headers */ = {isa = PBXBuildFile; fileRef = 86ADD1430FDDEA980006EEC2 /* ARMv7Assembler.h */; }; 86ADD1460FDDEA980006EEC2 /* MacroAssemblerARMv7.h in Headers */ = {isa = PBXBuildFile; fileRef = 86ADD1440FDDEA980006EEC2 /* MacroAssemblerARMv7.h */; }; 86C36EEA0EE1289D00B3DF59 /* MacroAssembler.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C36EE90EE1289D00B3DF59 /* MacroAssembler.h */; }; + 86CA032E1038E8440028A609 /* Executable.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 86CA032D1038E8440028A609 /* Executable.cpp */; }; + 86CAFEE31035DDE60028A609 /* Executable.h in Headers */ = {isa = PBXBuildFile; fileRef = 86CAFEE21035DDE60028A609 /* Executable.h */; settings = {ATTRIBUTES = (Private, ); }; }; 86CC85A10EE79A4700288682 /* JITInlineMethods.h in Headers */ = {isa = PBXBuildFile; fileRef = 86CC85A00EE79A4700288682 /* JITInlineMethods.h */; }; 86CC85A30EE79B7400288682 /* JITCall.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 86CC85A20EE79B7400288682 /* JITCall.cpp */; }; 86CC85C40EE7A89400288682 /* JITPropertyAccess.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 86CC85C30EE7A89400288682 /* JITPropertyAccess.cpp */; }; @@ -207,11 +209,11 @@ A7A1F7AD0F252B3C00E184E2 /* ByteArray.h in Headers */ = {isa = PBXBuildFile; fileRef = A7A1F7AB0F252B3C00E184E2 /* ByteArray.h */; settings = {ATTRIBUTES = (Private, ); }; }; A7B48F490EE8936F00DCBDB6 /* ExecutableAllocator.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A7B48DB60EE74CFC00DCBDB6 /* ExecutableAllocator.cpp */; }; A7C530E4102A3813005BC741 /* MarkStackPosix.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A7C530E3102A3813005BC741 /* MarkStackPosix.cpp */; }; + A7D649AA1015224E009B2E1B /* PossiblyNull.h in Headers */ = {isa = PBXBuildFile; fileRef = A7D649A91015224E009B2E1B /* PossiblyNull.h */; settings = {ATTRIBUTES = (Private, ); }; }; A7E2EA6B0FB460CF00601F06 /* LiteralParser.h in Headers */ = {isa = PBXBuildFile; fileRef = A7E2EA690FB460CF00601F06 /* LiteralParser.h */; }; A7E2EA6C0FB460CF00601F06 /* LiteralParser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A7E2EA6A0FB460CF00601F06 /* LiteralParser.cpp */; }; A7F9935F0FD7325100A0B2D0 /* JSONObject.h in Headers */ = {isa = PBXBuildFile; fileRef = A7F9935D0FD7325100A0B2D0 /* JSONObject.h */; }; A7F993600FD7325100A0B2D0 /* JSONObject.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A7F9935E0FD7325100A0B2D0 /* JSONObject.cpp */; }; - A7F9949B0FD746A300A0B2D0 /* JSONObject.lut.h in Headers */ = {isa = PBXBuildFile; fileRef = A7F9949A0FD746A300A0B2D0 /* JSONObject.lut.h */; }; BC02E90D0E1839DB000F9297 /* ErrorConstructor.h in Headers */ = {isa = PBXBuildFile; fileRef = BC02E9050E1839DB000F9297 /* ErrorConstructor.h */; }; BC02E90F0E1839DB000F9297 /* ErrorPrototype.h in Headers */ = {isa = PBXBuildFile; fileRef = BC02E9070E1839DB000F9297 /* ErrorPrototype.h */; }; BC02E9110E1839DB000F9297 /* NativeErrorConstructor.h in Headers */ = {isa = PBXBuildFile; fileRef = BC02E9090E1839DB000F9297 /* NativeErrorConstructor.h */; }; @@ -304,7 +306,7 @@ BC18C4480E16F5CD00B34460 /* Operations.h in Headers */ = {isa = PBXBuildFile; fileRef = F692A8780255597D01FF60F7 /* Operations.h */; settings = {ATTRIBUTES = (Private, ); }; }; BC18C4490E16F5CD00B34460 /* OwnArrayPtr.h in Headers */ = {isa = PBXBuildFile; fileRef = 9303F5A409911A5800AD71B8 /* OwnArrayPtr.h */; settings = {ATTRIBUTES = (Private, ); }; }; BC18C44A0E16F5CD00B34460 /* OwnPtr.h in Headers */ = {isa = PBXBuildFile; fileRef = 9303F567099118FA00AD71B8 /* OwnPtr.h */; settings = {ATTRIBUTES = (Private, ); }; }; - BC18C44B0E16F5CD00B34460 /* Parser.h in Headers */ = {isa = PBXBuildFile; fileRef = 93F0B3AA09BB4DC00068FCE3 /* Parser.h */; settings = {ATTRIBUTES = (Private, ); }; }; + BC18C44B0E16F5CD00B34460 /* Parser.h in Headers */ = {isa = PBXBuildFile; fileRef = 93F0B3AA09BB4DC00068FCE3 /* Parser.h */; settings = {ATTRIBUTES = (); }; }; BC18C44C0E16F5CD00B34460 /* PassRefPtr.h in Headers */ = {isa = PBXBuildFile; fileRef = 6580F795094070560082C219 /* PassRefPtr.h */; settings = {ATTRIBUTES = (Private, ); }; }; BC18C44D0E16F5CD00B34460 /* pcre.h in Headers */ = {isa = PBXBuildFile; fileRef = 6541720F039E08B90058BFEB /* pcre.h */; settings = {ATTRIBUTES = (Private, ); }; }; BC18C44E0E16F5CD00B34460 /* pcre_internal.h in Headers */ = {isa = PBXBuildFile; fileRef = 93E26BE508B1517100F85226 /* pcre_internal.h */; }; @@ -646,6 +648,8 @@ 86ADD1430FDDEA980006EEC2 /* ARMv7Assembler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ARMv7Assembler.h; sourceTree = ""; }; 86ADD1440FDDEA980006EEC2 /* MacroAssemblerARMv7.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MacroAssemblerARMv7.h; sourceTree = ""; }; 86C36EE90EE1289D00B3DF59 /* MacroAssembler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MacroAssembler.h; sourceTree = ""; }; + 86CA032D1038E8440028A609 /* Executable.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Executable.cpp; sourceTree = ""; }; + 86CAFEE21035DDE60028A609 /* Executable.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Executable.h; sourceTree = ""; }; 86CC85A00EE79A4700288682 /* JITInlineMethods.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JITInlineMethods.h; sourceTree = ""; }; 86CC85A20EE79B7400288682 /* JITCall.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JITCall.cpp; sourceTree = ""; }; 86CC85C30EE7A89400288682 /* JITPropertyAccess.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JITPropertyAccess.cpp; sourceTree = ""; }; @@ -752,6 +756,7 @@ A7B48DB50EE74CFC00DCBDB6 /* ExecutableAllocator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ExecutableAllocator.h; sourceTree = ""; }; A7B48DB60EE74CFC00DCBDB6 /* ExecutableAllocator.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ExecutableAllocator.cpp; sourceTree = ""; }; A7C530E3102A3813005BC741 /* MarkStackPosix.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MarkStackPosix.cpp; sourceTree = ""; }; + A7D649A91015224E009B2E1B /* PossiblyNull.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PossiblyNull.h; sourceTree = ""; }; A7E2EA690FB460CF00601F06 /* LiteralParser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LiteralParser.h; sourceTree = ""; }; A7E2EA6A0FB460CF00601F06 /* LiteralParser.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LiteralParser.cpp; sourceTree = ""; }; A7E42C180E3938830065A544 /* JSStaticScopeObject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSStaticScopeObject.h; sourceTree = ""; }; @@ -1242,6 +1247,7 @@ 44DD48520FAEA85000D6B4EB /* PassOwnPtr.h */, 6580F795094070560082C219 /* PassRefPtr.h */, 65D6D87E09B5A32E0002E4D7 /* Platform.h */, + A7D649A91015224E009B2E1B /* PossiblyNull.h */, 0B1F921B0F17502D0036468E /* PtrAndFlags.h */, 088FA5B90EF76D4300578E6F /* RandomNumber.cpp */, 088FA5BA0EF76D4300578E6F /* RandomNumber.h */, @@ -1375,6 +1381,8 @@ BC02E9070E1839DB000F9297 /* ErrorPrototype.h */, 1429D8770ED21ACD00B89619 /* ExceptionHelpers.cpp */, A72701B30DADE94900E548D7 /* ExceptionHelpers.h */, + 86CA032D1038E8440028A609 /* Executable.cpp */, + 86CAFEE21035DDE60028A609 /* Executable.h */, BC2680C00E16D4E900A06E92 /* FunctionConstructor.cpp */, BC2680C10E16D4E900A06E92 /* FunctionConstructor.h */, F692A85C0255597D01FF60F7 /* FunctionPrototype.cpp */, @@ -1760,7 +1768,6 @@ BC18C4240E16F5CD00B34460 /* JSObject.h in Headers */, BC18C4250E16F5CD00B34460 /* JSObjectRef.h in Headers */, A7F9935F0FD7325100A0B2D0 /* JSONObject.h in Headers */, - A7F9949B0FD746A300A0B2D0 /* JSONObject.lut.h in Headers */, 9534AAFB0E5B7A9600B8A45B /* JSProfilerPrivate.h in Headers */, BC18C4260E16F5CD00B34460 /* JSRetainPtr.h in Headers */, BC18C4270E16F5CD00B34460 /* JSString.h in Headers */, @@ -1902,6 +1909,8 @@ 1429DABF0ED263E700B89619 /* WRECParser.h in Headers */, 9688CB160ED12B4E001D649F /* X86Assembler.h in Headers */, A7795590101A74D500114E55 /* MarkStack.h in Headers */, + A7D649AA1015224E009B2E1B /* PossiblyNull.h in Headers */, + 86CAFEE31035DDE60028A609 /* Executable.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -2270,6 +2279,7 @@ 1429DAC00ED263E700B89619 /* WRECParser.cpp in Sources */, A7C530E4102A3813005BC741 /* MarkStackPosix.cpp in Sources */, A74B3499102A5F8E0032AB98 /* MarkStack.cpp in Sources */, + 86CA032E1038E8440028A609 /* Executable.cpp in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/JavaScriptCore/assembler/ARMAssembler.cpp b/JavaScriptCore/assembler/ARMAssembler.cpp index 69daa1613..c8b07fcec 100644 --- a/JavaScriptCore/assembler/ARMAssembler.cpp +++ b/JavaScriptCore/assembler/ARMAssembler.cpp @@ -49,11 +49,11 @@ ARMWord* ARMAssembler::getLdrImmAddress(ARMWord* insn, uint32_t* constPool) return reinterpret_cast(addr - (*insn & SDT_OFFSET_MASK)); } -void ARMAssembler::linkBranch(void* code, JmpSrc from, void* to) +void ARMAssembler::linkBranch(void* code, JmpSrc from, void* to, int useConstantPool) { ARMWord* insn = reinterpret_cast(code) + (from.m_offset / sizeof(ARMWord)); - if (!from.m_latePatch) { + if (!useConstantPool) { int diff = reinterpret_cast(to) - reinterpret_cast(insn + 2); if ((diff <= BOFFSET_MAX && diff >= BOFFSET_MIN)) { @@ -367,13 +367,22 @@ void ARMAssembler::doubleTransfer(bool isLoad, FPRegisterID srcDst, RegisterID b void* ARMAssembler::executableCopy(ExecutablePool* allocator) { + // 64-bit alignment is required for next constant pool and JIT code as well + m_buffer.flushWithoutBarrier(true); + if (m_buffer.uncheckedSize() & 0x7) + bkpt(0); + char* data = reinterpret_cast(m_buffer.executableCopy(allocator)); for (Jumps::Iterator iter = m_jumps.begin(); iter != m_jumps.end(); ++iter) { - ARMWord* ldrAddr = reinterpret_cast(data + *iter); - ARMWord* offset = getLdrImmAddress(ldrAddr); - if (*offset != 0xffffffff) - linkBranch(data, JmpSrc(*iter), data + *offset); + // The last bit is set if the constant must be placed on constant pool. + int pos = (*iter) & (~0x1); + ARMWord* ldrAddr = reinterpret_cast(data + pos); + ARMWord offset = *getLdrImmAddress(ldrAddr); + if (offset != 0xffffffff) { + JmpSrc jmpSrc(pos); + linkBranch(data, jmpSrc, data + offset, ((*iter) & 1)); + } } return data; diff --git a/JavaScriptCore/assembler/ARMAssembler.h b/JavaScriptCore/assembler/ARMAssembler.h index d3fe782b7..020677035 100644 --- a/JavaScriptCore/assembler/ARMAssembler.h +++ b/JavaScriptCore/assembler/ARMAssembler.h @@ -77,7 +77,7 @@ namespace ARM { typedef ARM::RegisterID RegisterID; typedef ARM::FPRegisterID FPRegisterID; typedef AssemblerBufferWithConstantPool<2048, 4, 4, ARMAssembler> ARMBuffer; - typedef WTF::SegmentedVector Jumps; + typedef SegmentedVector Jumps; ARMAssembler() { } @@ -180,20 +180,16 @@ namespace ARM { public: JmpSrc() : m_offset(-1) - , m_latePatch(false) { } - void enableLatePatch() { m_latePatch = true; } private: JmpSrc(int offset) : m_offset(offset) - , m_latePatch(false) { } - int m_offset : 31; - int m_latePatch : 1; + int m_offset; }; class JmpDst { @@ -567,6 +563,11 @@ namespace ARM { m_buffer.ensureSpace(insnSpace, constSpace); } + int sizeOfConstantPool() + { + return m_buffer.sizeOfConstantPool(); + } + JmpDst label() { return JmpDst(m_buffer.size()); @@ -580,11 +581,12 @@ namespace ARM { return label(); } - JmpSrc jmp(Condition cc = AL) + JmpSrc jmp(Condition cc = AL, int useConstantPool = 0) { - int s = size(); + ensureSpace(sizeof(ARMWord), sizeof(ARMWord)); + int s = m_buffer.uncheckedSize(); ldr_un_imm(ARM::pc, 0xffffffff, cc); - m_jumps.append(s); + m_jumps.append(s | (useConstantPool & 0x1)); return JmpSrc(s); } @@ -593,7 +595,7 @@ namespace ARM { // Patching helpers static ARMWord* getLdrImmAddress(ARMWord* insn, uint32_t* constPool = 0); - static void linkBranch(void* code, JmpSrc from, void* to); + static void linkBranch(void* code, JmpSrc from, void* to, int useConstantPool = 0); static void patchPointerInternal(intptr_t from, void* to) { @@ -660,7 +662,7 @@ namespace ARM { static void linkCall(void* code, JmpSrc from, void* to) { - linkBranch(code, from, to); + linkBranch(code, from, to, true); } static void relinkCall(void* from, void* to) diff --git a/JavaScriptCore/assembler/ARMv7Assembler.h b/JavaScriptCore/assembler/ARMv7Assembler.h index f7e2fb476..7cf88736c 100644 --- a/JavaScriptCore/assembler/ARMv7Assembler.h +++ b/JavaScriptCore/assembler/ARMv7Assembler.h @@ -442,7 +442,6 @@ public: { } - void enableLatePatch() { } private: JmpSrc(int offset) : m_offset(offset) diff --git a/JavaScriptCore/assembler/AbstractMacroAssembler.h b/JavaScriptCore/assembler/AbstractMacroAssembler.h index f927ed227..525fe9813 100644 --- a/JavaScriptCore/assembler/AbstractMacroAssembler.h +++ b/JavaScriptCore/assembler/AbstractMacroAssembler.h @@ -320,11 +320,6 @@ public: return Call(jump.m_jmp, Linkable); } - void enableLatePatch() - { - m_jmp.enableLatePatch(); - } - JmpSrc m_jmp; private: Flags m_flags; @@ -361,11 +356,6 @@ public: masm->m_assembler.linkJump(m_jmp, label.m_label); } - void enableLatePatch() - { - m_jmp.enableLatePatch(); - } - private: JmpSrc m_jmp; }; diff --git a/JavaScriptCore/assembler/AssemblerBufferWithConstantPool.h b/JavaScriptCore/assembler/AssemblerBufferWithConstantPool.h index f15b7f334..af3c3be07 100644 --- a/JavaScriptCore/assembler/AssemblerBufferWithConstantPool.h +++ b/JavaScriptCore/assembler/AssemblerBufferWithConstantPool.h @@ -34,6 +34,8 @@ #include "AssemblerBuffer.h" #include +#define ASSEMBLER_HAS_CONSTANT_POOL 1 + namespace JSC { /* @@ -84,7 +86,7 @@ namespace JSC { template class AssemblerBufferWithConstantPool: public AssemblerBuffer { - typedef WTF::SegmentedVector LoadOffsets; + typedef SegmentedVector LoadOffsets; public: enum { UniqueConst, @@ -177,6 +179,11 @@ public: return AssemblerBuffer::size(); } + int uncheckedSize() + { + return AssemblerBuffer::size(); + } + void* executableCopy(ExecutablePool* allocator) { flushConstantPool(false); @@ -207,10 +214,10 @@ public: } // This flushing mechanism can be called after any unconditional jumps. - void flushWithoutBarrier() + void flushWithoutBarrier(bool isForced = false) { // Flush if constant pool is more than 60% full to avoid overuse of this function. - if (5 * m_numConsts > 3 * maxPoolSize / sizeof(uint32_t)) + if (isForced || 5 * m_numConsts > 3 * maxPoolSize / sizeof(uint32_t)) flushConstantPool(false); } @@ -219,6 +226,11 @@ public: return m_pool; } + int sizeOfConstantPool() + { + return m_numConsts; + } + private: void correctDeltas(int insnSize) { @@ -276,7 +288,8 @@ private: { if (m_numConsts == 0) return; - if ((m_maxDistance < nextInsnSize + m_lastConstDelta + barrierSize + (int)sizeof(uint32_t))) + int lastConstDelta = m_lastConstDelta > nextInsnSize ? m_lastConstDelta - nextInsnSize : 0; + if ((m_maxDistance < nextInsnSize + lastConstDelta + barrierSize + (int)sizeof(uint32_t))) flushConstantPool(); } @@ -284,8 +297,8 @@ private: { if (m_numConsts == 0) return; - if ((m_maxDistance < nextInsnSize + m_lastConstDelta + barrierSize + (int)sizeof(uint32_t)) || - (m_numConsts + nextConstSize / sizeof(uint32_t) >= maxPoolSize)) + if ((m_maxDistance < nextInsnSize + m_lastConstDelta + nextConstSize + barrierSize + (int)sizeof(uint32_t)) || + (m_numConsts * sizeof(uint32_t) + nextConstSize >= maxPoolSize)) flushConstantPool(); } diff --git a/JavaScriptCore/assembler/MacroAssemblerARM.h b/JavaScriptCore/assembler/MacroAssemblerARM.h index b04ed1389..19cbfcb19 100644 --- a/JavaScriptCore/assembler/MacroAssemblerARM.h +++ b/JavaScriptCore/assembler/MacroAssemblerARM.h @@ -324,20 +324,20 @@ public: move(src, dest); } - Jump branch32(Condition cond, RegisterID left, RegisterID right) + Jump branch32(Condition cond, RegisterID left, RegisterID right, int useConstantPool = 0) { m_assembler.cmp_r(left, right); - return Jump(m_assembler.jmp(ARMCondition(cond))); + return Jump(m_assembler.jmp(ARMCondition(cond), useConstantPool)); } - Jump branch32(Condition cond, RegisterID left, Imm32 right) + Jump branch32(Condition cond, RegisterID left, Imm32 right, int useConstantPool = 0) { if (right.m_isPointer) { m_assembler.ldr_un_imm(ARM::S0, right.m_value); m_assembler.cmp_r(left, ARM::S0); } else m_assembler.cmp_r(left, m_assembler.getImm(right.m_value, ARM::S0)); - return Jump(m_assembler.jmp(ARMCondition(cond))); + return Jump(m_assembler.jmp(ARMCondition(cond), useConstantPool)); } Jump branch32(Condition cond, RegisterID left, Address right) @@ -497,7 +497,7 @@ public: Call nearCall() { prepareCall(); - return Call(m_assembler.jmp(), Call::LinkableNear); + return Call(m_assembler.jmp(ARMAssembler::AL, true), Call::LinkableNear); } Call call(RegisterID target) @@ -587,7 +587,7 @@ public: Call call() { prepareCall(); - return Call(m_assembler.jmp(), Call::Linkable); + return Call(m_assembler.jmp(ARMAssembler::AL, true), Call::Linkable); } Call tailRecursiveCall() @@ -610,8 +610,7 @@ public: Jump branchPtrWithPatch(Condition cond, RegisterID left, DataLabelPtr& dataLabel, ImmPtr initialRightValue = ImmPtr(0)) { dataLabel = moveWithPatch(initialRightValue, ARM::S1); - Jump jump = branch32(cond, left, ARM::S1); - jump.enableLatePatch(); + Jump jump = branch32(cond, left, ARM::S1, true); return jump; } @@ -619,8 +618,7 @@ public: { load32(left, ARM::S1); dataLabel = moveWithPatch(initialRightValue, ARM::S0); - Jump jump = branch32(cond, ARM::S0, ARM::S1); - jump.enableLatePatch(); + Jump jump = branch32(cond, ARM::S0, ARM::S1, true); return jump; } @@ -722,9 +720,19 @@ protected: return static_cast(cond); } + void ensureSpace(int insnSpace, int constSpace) + { + m_assembler.ensureSpace(insnSpace, constSpace); + } + + int sizeOfConstantPool() + { + return m_assembler.sizeOfConstantPool(); + } + void prepareCall() { - m_assembler.ensureSpace(3 * sizeof(ARMWord), sizeof(ARMWord)); + ensureSpace(3 * sizeof(ARMWord), sizeof(ARMWord)); // S0 might be used for parameter passing m_assembler.add_r(ARM::S1, ARM::pc, ARMAssembler::OP2_IMM | 0x4); diff --git a/JavaScriptCore/assembler/X86Assembler.h b/JavaScriptCore/assembler/X86Assembler.h index fb5836196..b5b8808b9 100644 --- a/JavaScriptCore/assembler/X86Assembler.h +++ b/JavaScriptCore/assembler/X86Assembler.h @@ -231,7 +231,6 @@ public: { } - void enableLatePatch() { } private: JmpSrc(int offset) : m_offset(offset) diff --git a/JavaScriptCore/bytecode/CodeBlock.cpp b/JavaScriptCore/bytecode/CodeBlock.cpp index e22f25a86..b63e8266c 100644 --- a/JavaScriptCore/bytecode/CodeBlock.cpp +++ b/JavaScriptCore/bytecode/CodeBlock.cpp @@ -33,6 +33,8 @@ #include "JIT.h" #include "JSValue.h" #include "Interpreter.h" +#include "JSFunction.h" +#include "JSStaticScopeObject.h" #include "Debugger.h" #include "BytecodeGenerator.h" #include @@ -1246,11 +1248,11 @@ void CodeBlock::dumpStatistics() #endif } -CodeBlock::CodeBlock(ScopeNode* ownerNode) +CodeBlock::CodeBlock(ExecutableBase* ownerExecutable) : m_numCalleeRegisters(0) , m_numVars(0) , m_numParameters(0) - , m_ownerNode(ownerNode) + , m_ownerExecutable(ownerExecutable) , m_globalData(0) #ifndef NDEBUG , m_instructionCount(0) @@ -1268,17 +1270,17 @@ CodeBlock::CodeBlock(ScopeNode* ownerNode) #endif } -CodeBlock::CodeBlock(ScopeNode* ownerNode, CodeType codeType, PassRefPtr sourceProvider, unsigned sourceOffset) +CodeBlock::CodeBlock(ExecutableBase* ownerExecutable, CodeType codeType, PassRefPtr sourceProvider, unsigned sourceOffset) : m_numCalleeRegisters(0) , m_numVars(0) , m_numParameters(0) - , m_ownerNode(ownerNode) + , m_ownerExecutable(ownerExecutable) , m_globalData(0) #ifndef NDEBUG , m_instructionCount(0) #endif - , m_needsFullScopeChain(ownerNode->needsActivation()) - , m_usesEval(ownerNode->usesEval()) + , m_needsFullScopeChain(ownerExecutable->needsActivation()) + , m_usesEval(ownerExecutable->usesEval()) , m_isNumericCompareFunction(false) , m_codeType(codeType) , m_source(sourceProvider) @@ -1435,15 +1437,10 @@ void CodeBlock::markAggregate(MarkStack& markStack) markStack.append(m_constantRegisters[i].jsValue()); } - for (size_t i = 0; i < m_functionExpressions.size(); ++i) - m_functionExpressions[i]->body()->markAggregate(markStack); - - if (m_rareData) { - for (size_t i = 0; i < m_rareData->m_functions.size(); ++i) - m_rareData->m_functions[i]->body()->markAggregate(markStack); - - m_rareData->m_evalCodeCache.markAggregate(markStack); - } + for (size_t i = 0; i < m_functionExprs.size(); ++i) + m_functionExprs[i]->markAggregate(markStack); + for (size_t i = 0; i < m_functionDecls.size(); ++i) + m_functionDecls[i]->markAggregate(markStack); } void CodeBlock::reparseForExceptionInfoIfNecessary(CallFrame* callFrame) @@ -1465,56 +1462,7 @@ void CodeBlock::reparseForExceptionInfoIfNecessary(CallFrame* callFrame) scopeChain = scopeChain->next; } - switch (m_codeType) { - case FunctionCode: { - FunctionBodyNode* ownerFunctionBodyNode = static_cast(m_ownerNode); - RefPtr newFunctionBody = m_globalData->parser->reparse(m_globalData, ownerFunctionBodyNode); - ASSERT(newFunctionBody); - newFunctionBody->finishParsing(ownerFunctionBodyNode->copyParameters(), ownerFunctionBodyNode->parameterCount()); - - m_globalData->scopeNodeBeingReparsed = newFunctionBody.get(); - - CodeBlock& newCodeBlock = newFunctionBody->bytecodeForExceptionInfoReparse(scopeChain, this); - ASSERT(newCodeBlock.m_exceptionInfo); - ASSERT(newCodeBlock.m_instructionCount == m_instructionCount); - -#if ENABLE(JIT) - JIT::compile(m_globalData, &newCodeBlock); - ASSERT(newFunctionBody->generatedJITCode().size() == ownerNode()->generatedJITCode().size()); -#endif - - m_exceptionInfo.set(newCodeBlock.m_exceptionInfo.release()); - - m_globalData->scopeNodeBeingReparsed = 0; - - break; - } - case EvalCode: { - EvalNode* ownerEvalNode = static_cast(m_ownerNode); - RefPtr newEvalBody = m_globalData->parser->reparse(m_globalData, ownerEvalNode); - - m_globalData->scopeNodeBeingReparsed = newEvalBody.get(); - - EvalCodeBlock& newCodeBlock = newEvalBody->bytecodeForExceptionInfoReparse(scopeChain, this); - ASSERT(newCodeBlock.m_exceptionInfo); - ASSERT(newCodeBlock.m_instructionCount == m_instructionCount); - -#if ENABLE(JIT) - JIT::compile(m_globalData, &newCodeBlock); - ASSERT(newEvalBody->generatedJITCode().size() == ownerNode()->generatedJITCode().size()); -#endif - - m_exceptionInfo.set(newCodeBlock.m_exceptionInfo.release()); - - m_globalData->scopeNodeBeingReparsed = 0; - - break; - } - default: - // CodeBlocks for Global code blocks are transient and therefore to not gain from - // from throwing out there exception information. - ASSERT_NOT_REACHED(); - } + m_exceptionInfo.set(m_ownerExecutable->reparseExceptionInfo(m_globalData, scopeChain, this)); } HandlerInfo* CodeBlock::handlerForBytecodeOffset(unsigned bytecodeOffset) @@ -1545,7 +1493,7 @@ int CodeBlock::lineNumberForBytecodeOffset(CallFrame* callFrame, unsigned byteco ASSERT(m_exceptionInfo); if (!m_exceptionInfo->m_lineInfo.size()) - return m_ownerNode->source().firstLine(); // Empty function + return m_ownerExecutable->source().firstLine(); // Empty function int low = 0; int high = m_exceptionInfo->m_lineInfo.size(); @@ -1558,7 +1506,7 @@ int CodeBlock::lineNumberForBytecodeOffset(CallFrame* callFrame, unsigned byteco } if (!low) - return m_ownerNode->source().firstLine(); + return m_ownerExecutable->source().firstLine(); return m_exceptionInfo->m_lineInfo[low - 1].lineNumber; } @@ -1701,18 +1649,6 @@ bool CodeBlock::hasGlobalResolveInfoAtBytecodeOffset(unsigned bytecodeOffset) } #endif -#if ENABLE(JIT) -void CodeBlock::setJITCode(JITCode jitCode) -{ - ASSERT(m_codeType != NativeCode); - ownerNode()->setJITCode(jitCode); -#if !ENABLE(OPCODE_SAMPLING) - if (!BytecodeGenerator::dumpsGeneratedCode()) - m_instructions.clear(); -#endif -} -#endif - void CodeBlock::shrinkToFit() { m_instructions.shrinkToFit(); @@ -1728,7 +1664,8 @@ void CodeBlock::shrinkToFit() #endif m_identifiers.shrinkToFit(); - m_functionExpressions.shrinkToFit(); + m_functionDecls.shrinkToFit(); + m_functionExprs.shrinkToFit(); m_constantRegisters.shrinkToFit(); if (m_exceptionInfo) { @@ -1739,7 +1676,6 @@ void CodeBlock::shrinkToFit() if (m_rareData) { m_rareData->m_exceptionHandlers.shrinkToFit(); - m_rareData->m_functions.shrinkToFit(); m_rareData->m_regexps.shrinkToFit(); m_rareData->m_immediateSwitchJumpTables.shrinkToFit(); m_rareData->m_characterSwitchJumpTables.shrinkToFit(); diff --git a/JavaScriptCore/bytecode/CodeBlock.h b/JavaScriptCore/bytecode/CodeBlock.h index 39b1db335..fdeb4db84 100644 --- a/JavaScriptCore/bytecode/CodeBlock.h +++ b/JavaScriptCore/bytecode/CodeBlock.h @@ -248,11 +248,22 @@ namespace JSC { } #endif + struct ExceptionInfo : FastAllocBase { + Vector m_expressionInfo; + Vector m_lineInfo; + Vector m_getByIdExceptionInfo; + +#if ENABLE(JIT) + Vector m_callReturnIndexVector; +#endif + }; + class CodeBlock : public FastAllocBase { friend class JIT; + protected: + CodeBlock(ExecutableBase* ownerExecutable); + CodeBlock(ExecutableBase* ownerExecutable, CodeType, PassRefPtr, unsigned sourceOffset); public: - CodeBlock(ScopeNode* ownerNode); - CodeBlock(ScopeNode* ownerNode, CodeType, PassRefPtr, unsigned sourceOffset); ~CodeBlock(); void markAggregate(MarkStack&); @@ -329,7 +340,7 @@ namespace JSC { unsigned getBytecodeIndex(CallFrame* callFrame, ReturnAddressPtr returnAddress) { reparseForExceptionInfoIfNecessary(callFrame); - return binaryChop(callReturnIndexVector().begin(), callReturnIndexVector().size(), ownerNode()->generatedJITCode().offsetOf(returnAddress.value()))->bytecodeIndex; + return binaryChop(callReturnIndexVector().begin(), callReturnIndexVector().size(), ownerExecutable()->generatedJITCode().offsetOf(returnAddress.value()))->bytecodeIndex; } bool functionRegisterForBytecodeOffset(unsigned bytecodeOffset, int& functionRegisterIndex); @@ -339,17 +350,19 @@ namespace JSC { bool isNumericCompareFunction() { return m_isNumericCompareFunction; } Vector& instructions() { return m_instructions; } + void discardBytecode() { m_instructions.clear(); } + #ifndef NDEBUG + unsigned instructionCount() { return m_instructionCount; } void setInstructionCount(unsigned instructionCount) { m_instructionCount = instructionCount; } #endif #if ENABLE(JIT) - JITCode& getJITCode() { return ownerNode()->generatedJITCode(); } - void setJITCode(JITCode); - ExecutablePool* executablePool() { return ownerNode()->getExecutablePool(); } + JITCode& getJITCode() { return ownerExecutable()->generatedJITCode(); } + ExecutablePool* executablePool() { return ownerExecutable()->getExecutablePool(); } #endif - ScopeNode* ownerNode() const { return m_ownerNode; } + ExecutableBase* ownerExecutable() const { return m_ownerExecutable; } void setGlobalData(JSGlobalData* globalData) { m_globalData = globalData; } @@ -404,6 +417,7 @@ namespace JSC { bool hasExceptionInfo() const { return m_exceptionInfo; } void clearExceptionInfo() { m_exceptionInfo.clear(); } + ExceptionInfo* extractExceptionInfo() { ASSERT(m_exceptionInfo); return m_exceptionInfo.release(); } void addExpressionInfo(const ExpressionRangeInfo& expressionInfo) { ASSERT(m_exceptionInfo); m_exceptionInfo->m_expressionInfo.append(expressionInfo); } void addGetByIdExceptionInfo(const GetByIdExceptionInfo& info) { ASSERT(m_exceptionInfo); m_exceptionInfo->m_getByIdExceptionInfo.append(info); } @@ -428,13 +442,11 @@ namespace JSC { ALWAYS_INLINE bool isConstantRegisterIndex(int index) { return index >= FirstConstantRegisterIndex; } ALWAYS_INLINE JSValue getConstant(int index) const { return m_constantRegisters[index - FirstConstantRegisterIndex].jsValue(); } - unsigned addFunctionExpression(FuncExprNode* n) { unsigned size = m_functionExpressions.size(); m_functionExpressions.append(n); return size; } - FuncExprNode* functionExpression(int index) const { return m_functionExpressions[index].get(); } - - unsigned addFunction(FuncDeclNode* n) { createRareDataIfNecessary(); unsigned size = m_rareData->m_functions.size(); m_rareData->m_functions.append(n); return size; } - FuncDeclNode* function(int index) const { ASSERT(m_rareData); return m_rareData->m_functions[index].get(); } - - bool hasFunctions() const { return m_functionExpressions.size() || (m_rareData && m_rareData->m_functions.size()); } + unsigned addFunctionDecl(PassRefPtr n) { unsigned size = m_functionDecls.size(); m_functionDecls.append(n); return size; } + FunctionExecutable* functionDecl(int index) { return m_functionDecls[index].get(); } + int numberOfFunctionDecls() { return m_functionDecls.size(); } + unsigned addFunctionExpr(PassRefPtr n) { unsigned size = m_functionExprs.size(); m_functionExprs.append(n); return size; } + FunctionExecutable* functionExpr(int index) { return m_functionExprs[index].get(); } unsigned addRegExp(RegExp* r) { createRareDataIfNecessary(); unsigned size = m_rareData->m_regexps.size(); m_rareData->m_regexps.append(r); return size; } RegExp* regexp(int index) const { ASSERT(m_rareData); return m_rareData->m_regexps[index].get(); } @@ -481,7 +493,7 @@ namespace JSC { m_rareData.set(new RareData); } - ScopeNode* m_ownerNode; + ExecutableBase* m_ownerExecutable; JSGlobalData* m_globalData; Vector m_instructions; @@ -517,26 +529,17 @@ namespace JSC { // Constant Pool Vector m_identifiers; Vector m_constantRegisters; - Vector > m_functionExpressions; + Vector > m_functionDecls; + Vector > m_functionExprs; SymbolTable m_symbolTable; - struct ExceptionInfo : FastAllocBase { - Vector m_expressionInfo; - Vector m_lineInfo; - Vector m_getByIdExceptionInfo; - -#if ENABLE(JIT) - Vector m_callReturnIndexVector; -#endif - }; OwnPtr m_exceptionInfo; struct RareData : FastAllocBase { Vector m_exceptionHandlers; // Rare Constants - Vector > m_functions; Vector > m_regexps; // Jump Tables @@ -556,16 +559,16 @@ namespace JSC { // Program code is not marked by any function, so we make the global object // responsible for marking it. - class ProgramCodeBlock : public CodeBlock { + class GlobalCodeBlock : public CodeBlock { public: - ProgramCodeBlock(ScopeNode* ownerNode, CodeType codeType, JSGlobalObject* globalObject, PassRefPtr sourceProvider) - : CodeBlock(ownerNode, codeType, sourceProvider, 0) + GlobalCodeBlock(ExecutableBase* ownerExecutable, CodeType codeType, PassRefPtr sourceProvider, unsigned sourceOffset, JSGlobalObject* globalObject) + : CodeBlock(ownerExecutable, codeType, sourceProvider, sourceOffset) , m_globalObject(globalObject) { m_globalObject->codeBlocks().add(this); } - ~ProgramCodeBlock() + ~GlobalCodeBlock() { if (m_globalObject) m_globalObject->codeBlocks().remove(this); @@ -577,10 +580,18 @@ namespace JSC { JSGlobalObject* m_globalObject; // For program and eval nodes, the global object that marks the constant pool. }; - class EvalCodeBlock : public ProgramCodeBlock { + class ProgramCodeBlock : public GlobalCodeBlock { public: - EvalCodeBlock(ScopeNode* ownerNode, JSGlobalObject* globalObject, PassRefPtr sourceProvider, int baseScopeDepth) - : ProgramCodeBlock(ownerNode, EvalCode, globalObject, sourceProvider) + ProgramCodeBlock(ProgramExecutable* ownerExecutable, CodeType codeType, JSGlobalObject* globalObject, PassRefPtr sourceProvider) + : GlobalCodeBlock(ownerExecutable, codeType, sourceProvider, 0, globalObject) + { + } + }; + + class EvalCodeBlock : public GlobalCodeBlock { + public: + EvalCodeBlock(EvalExecutable* ownerExecutable, JSGlobalObject* globalObject, PassRefPtr sourceProvider, int baseScopeDepth) + : GlobalCodeBlock(ownerExecutable, EvalCode, sourceProvider, 0, globalObject) , m_baseScopeDepth(baseScopeDepth) { } @@ -591,6 +602,22 @@ namespace JSC { int m_baseScopeDepth; }; + class FunctionCodeBlock : public CodeBlock { + public: + FunctionCodeBlock(FunctionExecutable* ownerExecutable, CodeType codeType, PassRefPtr sourceProvider, unsigned sourceOffset) + : CodeBlock(ownerExecutable, codeType, sourceProvider, sourceOffset) + { + } + }; + + class NativeCodeBlock : public CodeBlock { + public: + NativeCodeBlock(FunctionExecutable* ownerExecutable) + : CodeBlock(ownerExecutable) + { + } + }; + inline Register& ExecState::r(int index) { CodeBlock* codeBlock = this->codeBlock(); diff --git a/JavaScriptCore/bytecode/EvalCodeCache.h b/JavaScriptCore/bytecode/EvalCodeCache.h index 986525c1e..c486e4245 100644 --- a/JavaScriptCore/bytecode/EvalCodeCache.h +++ b/JavaScriptCore/bytecode/EvalCodeCache.h @@ -29,6 +29,7 @@ #ifndef EvalCodeCache_h #define EvalCodeCache_h +#include "Executable.h" #include "JSGlobalObject.h" #include "Nodes.h" #include "Parser.h" @@ -41,44 +42,33 @@ namespace JSC { class EvalCodeCache { public: - PassRefPtr get(ExecState* exec, const UString& evalSource, ScopeChainNode* scopeChain, JSValue& exceptionValue) + PassRefPtr get(ExecState* exec, const UString& evalSource, ScopeChainNode* scopeChain, JSValue& exceptionValue) { - RefPtr evalNode; + RefPtr evalExecutable; if (evalSource.size() < maxCacheableSourceLength && (*scopeChain->begin())->isVariableObject()) - evalNode = m_cacheMap.get(evalSource.rep()); + evalExecutable = m_cacheMap.get(evalSource.rep()); - if (!evalNode) { - int errorLine; - UString errorMessage; - - SourceCode source = makeSource(evalSource); - evalNode = exec->globalData().parser->parse(exec, exec->dynamicGlobalObject()->debugger(), source, &errorLine, &errorMessage); - if (evalNode) { - if (evalSource.size() < maxCacheableSourceLength && (*scopeChain->begin())->isVariableObject() && m_cacheMap.size() < maxCacheEntries) - m_cacheMap.set(evalSource.rep(), evalNode); - } else { - exceptionValue = Error::create(exec, SyntaxError, errorMessage, errorLine, source.provider()->asID(), 0); + if (!evalExecutable) { + evalExecutable = CacheableEvalExecutable::create(makeSource(evalSource)); + exceptionValue = evalExecutable->parse(exec); + if (exceptionValue) return 0; - } + + if (evalSource.size() < maxCacheableSourceLength && (*scopeChain->begin())->isVariableObject() && m_cacheMap.size() < maxCacheEntries) + m_cacheMap.set(evalSource.rep(), evalExecutable); } - return evalNode.release(); + return evalExecutable.release(); } bool isEmpty() const { return m_cacheMap.isEmpty(); } - void markAggregate(MarkStack& markStack) - { - EvalCacheMap::iterator end = m_cacheMap.end(); - for (EvalCacheMap::iterator ptr = m_cacheMap.begin(); ptr != end; ++ptr) - ptr->second->markAggregate(markStack); - } private: static const int maxCacheableSourceLength = 256; static const int maxCacheEntries = 64; - typedef HashMap, RefPtr > EvalCacheMap; + typedef HashMap, RefPtr > EvalCacheMap; EvalCacheMap m_cacheMap; }; diff --git a/JavaScriptCore/bytecode/SamplingTool.cpp b/JavaScriptCore/bytecode/SamplingTool.cpp index 86517233a..8d0faa11b 100644 --- a/JavaScriptCore/bytecode/SamplingTool.cpp +++ b/JavaScriptCore/bytecode/SamplingTool.cpp @@ -197,7 +197,7 @@ void SamplingTool::doRun() #if ENABLE(CODEBLOCK_SAMPLING) if (CodeBlock* codeBlock = sample.codeBlock()) { MutexLocker locker(m_scopeSampleMapMutex); - ScopeSampleRecord* record = m_scopeSampleMap->get(codeBlock->ownerNode()); + ScopeSampleRecord* record = m_scopeSampleMap->get(codeBlock->ownerExecutable()); ASSERT(record); record->sample(codeBlock, sample.vPC()); } diff --git a/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp b/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp index 59537b6f5..a4fd0d33c 100644 --- a/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp +++ b/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp @@ -256,9 +256,9 @@ BytecodeGenerator::BytecodeGenerator(ProgramNode* programNode, const Debugger* d m_nextGlobalIndex -= symbolTable->size(); for (size_t i = 0; i < functionStack.size(); ++i) { - FuncDeclNode* funcDecl = functionStack[i]; - globalObject->removeDirect(funcDecl->m_ident); // Make sure our new function is not shadowed by an old property. - emitNewFunction(addGlobalVar(funcDecl->m_ident, false), funcDecl); + FunctionBodyNode* function = functionStack[i]; + globalObject->removeDirect(function->ident()); // Make sure our new function is not shadowed by an old property. + emitNewFunction(addGlobalVar(function->ident(), false), function); } Vector newVars; @@ -272,8 +272,8 @@ BytecodeGenerator::BytecodeGenerator(ProgramNode* programNode, const Debugger* d emitLoad(newVars[i], jsUndefined()); } else { for (size_t i = 0; i < functionStack.size(); ++i) { - FuncDeclNode* funcDecl = functionStack[i]; - globalObject->putWithAttributes(exec, funcDecl->m_ident, funcDecl->makeFunction(exec, scopeChain.node()), DontDelete); + FunctionBodyNode* function = functionStack[i]; + globalObject->putWithAttributes(exec, function->ident(), new (exec) JSFunction(exec, adoptRef(new FunctionExecutable(function->ident(), function)), scopeChain.node()), DontDelete); } for (size_t i = 0; i < varStack.size(); ++i) { if (globalObject->hasProperty(exec, varStack[i].first)) @@ -339,10 +339,10 @@ BytecodeGenerator::BytecodeGenerator(FunctionBodyNode* functionBody, const Debug const DeclarationStacks::FunctionStack& functionStack = functionBody->functionStack(); for (size_t i = 0; i < functionStack.size(); ++i) { - FuncDeclNode* funcDecl = functionStack[i]; - const Identifier& ident = funcDecl->m_ident; + FunctionBodyNode* function = functionStack[i]; + const Identifier& ident = function->ident(); m_functions.add(ident.ustring().rep()); - emitNewFunction(addVar(ident, false), funcDecl); + emitNewFunction(addVar(ident, false), function); } const DeclarationStacks::VarStack& varStack = functionBody->varStack(); @@ -397,6 +397,12 @@ BytecodeGenerator::BytecodeGenerator(EvalNode* evalNode, const Debugger* debugge codeBlock->setGlobalData(m_globalData); m_codeBlock->m_numParameters = 1; // Allocate space for "this" + const DeclarationStacks::FunctionStack& functionStack = evalNode->functionStack(); + for (size_t i = 0; i < functionStack.size(); ++i) { + FunctionBodyNode* function = functionStack[i]; + m_codeBlock->addFunctionDecl(adoptRef(new FunctionExecutable(function->ident(), function))); + } + preserveLastVar(); } @@ -470,7 +476,8 @@ RegisterID* BytecodeGenerator::constRegisterFor(const Identifier& ident) return 0; SymbolTableEntry entry = symbolTable().get(ident.ustring().rep()); - ASSERT(!entry.isNull()); + if (entry.isNull()) + return 0; return ®isterFor(entry.getIndex()); } @@ -765,18 +772,6 @@ PassRefPtr