[JSC] Get rid of some unused parameters in LLIntSlowPaths.cpp macros
https://bugs.webkit.org/show_bug.cgi?id=125075

Patch by Nick Diego Yamane <nick.yamane@openbossa.org> on 2013-12-02
Reviewed by Michael Saboff.

* llint/LLIntSlowPaths.cpp:
(JSC::LLInt::handleHostCall): added UNUSED_PARAM(pc).
(JSC::LLInt::setUpCall): Doesn't pass 'pc' to LLINT_CALL macros.
(JSC::LLInt::LLINT_SLOW_PATH_DECL): Ditto.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@159940 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Win] WebKit Project doesn't copy resource bundle
https://bugs.webkit.org/show_bug.cgi?id=125078

Reviewed by Jer Noble.

* WebKit.vcxproj/WebKit/WebKitPostBuild.cmd: Correct post-build step
to copy WebKit.resources to build target.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@159941 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Instead of watchpointing activation allocation, we should watchpoint entry into functions that have captured variables
https://bugs.webkit.org/show_bug.cgi?id=125052

Reviewed by Mark Hahnenberg.
        
This makes us watch function entry rather than activation creation. We only incur the
costs of doing so for functions that have captured variables, and only on the first two
entries into the function. This means that closure variable constant inference will
naturally work even for local uses of the captured variable, like:
        
    (function(){
        var blah = 42;
        ... // stuff
        function () { ... blah /* we can fold this to 42 */ }
        ... blah // we can also fold this to 42.
    })();
        
Previously, only the nested use would have been foldable.

* bytecode/BytecodeLivenessAnalysis.cpp:
(JSC::computeUsesForBytecodeOffset):
(JSC::computeDefsForBytecodeOffset):
* bytecode/CodeBlock.cpp:
(JSC::CodeBlock::dumpBytecode):
* bytecode/Opcode.h:
(JSC::padOpcodeName):
* bytecode/Watchpoint.h:
(JSC::WatchpointSet::touch):
(JSC::InlineWatchpointSet::touch):
* bytecompiler/BytecodeGenerator.cpp:
(JSC::BytecodeGenerator::BytecodeGenerator):
* dfg/DFGAbstractInterpreterInlines.h:
(JSC::DFG::::executeEffects):
* dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::parseBlock):
* dfg/DFGCapabilities.cpp:
(JSC::DFG::capabilityLevel):
* dfg/DFGClobberize.h:
(JSC::DFG::clobberize):
* dfg/DFGFixupPhase.cpp:
(JSC::DFG::FixupPhase::fixupNode):
* dfg/DFGNode.h:
(JSC::DFG::Node::hasSymbolTable):
* dfg/DFGNodeType.h:
* dfg/DFGPredictionPropagationPhase.cpp:
(JSC::DFG::PredictionPropagationPhase::propagate):
* dfg/DFGSafeToExecute.h:
(JSC::DFG::safeToExecute):
* dfg/DFGSpeculativeJIT32_64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* dfg/DFGSpeculativeJIT64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* dfg/DFGWatchpointCollectionPhase.cpp:
(JSC::DFG::WatchpointCollectionPhase::handle):
* ftl/FTLCapabilities.cpp:
(JSC::FTL::canCompile):
* ftl/FTLLowerDFGToLLVM.cpp:
(JSC::FTL::LowerDFGToLLVM::compileNode):
* jit/JIT.cpp:
(JSC::JIT::privateCompileMainPass):
* jit/JIT.h:
* jit/JITOpcodes.cpp:
(JSC::JIT::emit_op_touch_entry):
* llint/LowLevelInterpreter.asm:
* runtime/CommonSlowPaths.cpp:
(JSC::SLOW_PATH_DECL):
* runtime/CommonSlowPaths.h:
* runtime/JSActivation.h:
(JSC::JSActivation::create):
* runtime/SymbolTable.cpp:
(JSC::SymbolTable::SymbolTable):
* runtime/SymbolTable.h:



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@159942 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Stores to local captured variables should be intercepted
https://bugs.webkit.org/show_bug.cgi?id=124883

Source/JavaScriptCore: 

Reviewed by Mark Hahnenberg.
        
Previously, in bytecode, you could assign to a captured variable just as you would
assign to any other kind of variable. This complicates closure variable constant
inference because we don't have any place where we can intercept stores to captured
variables in the LLInt.
        
This patch institutes a policy that only certain instructions can store to captured
variables. If you interpret those instructions and you are required to notifyWrite()
then you need to check if the relevant variable is captured. Those instructions are
tracked in CodeBlock.cpp's VerifyCapturedDef. The main one is simply op_captured_mov.
In the future, we'll probably modify those instructions to have a pointer directly to
the VariableWatchpointSet; but for now we just introduce the captured instructions as
placeholders.
        
In order to validate that the placeholders are inserted correctly, this patch improves
the CodeBlock validation to be able to inspect every def in the bytecode. To do that,
this patch refactors the liveness analysis' use/def calculator to be reusable; it now
takes a functor for each use or def.
        
In the process of refactoring the liveness analysis, I noticed that op_enter was
claiming to def all callee registers. That's wrong; it only defs the non-temporary
variables. Making that change revealed preexisting bugs in the liveness analysis, since
now the validator would pick up cases where the bytecode claimed to use a temporary and
the def calculator never noticed the definition (or the converse - where the bytecode
was actually not using a temporary but the liveness analysis thought that it was a
use). This patch fixes a few of those bugs.

* GNUmakefile.list.am:
* JavaScriptCore.vcxproj/JavaScriptCore.vcxproj:
* JavaScriptCore.xcodeproj/project.pbxproj:
* bytecode/BytecodeLivenessAnalysis.cpp:
(JSC::stepOverInstruction):
* bytecode/BytecodeUseDef.h: Added.
(JSC::computeUsesForBytecodeOffset):
(JSC::computeDefsForBytecodeOffset):
* bytecode/CodeBlock.cpp:
(JSC::CodeBlock::dumpBytecode):
(JSC::CodeBlock::isCaptured):
(JSC::CodeBlock::validate):
* bytecode/CodeBlock.h:
* bytecode/Opcode.h:
(JSC::padOpcodeName):
* bytecompiler/BytecodeGenerator.cpp:
(JSC::BytecodeGenerator::BytecodeGenerator):
(JSC::BytecodeGenerator::resolveCallee):
(JSC::BytecodeGenerator::emitMove):
(JSC::BytecodeGenerator::isCaptured):
(JSC::BytecodeGenerator::local):
(JSC::BytecodeGenerator::constLocal):
(JSC::BytecodeGenerator::emitNewFunction):
(JSC::BytecodeGenerator::emitLazyNewFunction):
(JSC::BytecodeGenerator::emitNewFunctionInternal):
* bytecompiler/BytecodeGenerator.h:
(JSC::Local::Local):
(JSC::Local::isCaptured):
(JSC::Local::captureMode):
(JSC::BytecodeGenerator::captureMode):
(JSC::BytecodeGenerator::emitNode):
(JSC::BytecodeGenerator::pushOptimisedForIn):
* bytecompiler/NodesCodegen.cpp:
(JSC::PostfixNode::emitResolve):
(JSC::PrefixNode::emitResolve):
(JSC::ReadModifyResolveNode::emitBytecode):
(JSC::AssignResolveNode::emitBytecode):
(JSC::ConstDeclNode::emitCodeSingle):
(JSC::ForInNode::emitBytecode):
* dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::parseBlock):
* dfg/DFGCapabilities.cpp:
(JSC::DFG::capabilityLevel):
* jit/JIT.cpp:
(JSC::JIT::privateCompileMainPass):
* llint/LowLevelInterpreter32_64.asm:
* llint/LowLevelInterpreter64.asm:
* runtime/SymbolTable.h:
(JSC::SymbolTable::isCaptured):

LayoutTests: 

Reviewed by Mark Hahnenberg.

* js/regress/captured-assignments-expected.txt: Added.
* js/regress/captured-assignments.html: Added.
* js/regress/script-tests/captured-assignments.js: Added.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@159943 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Add support for WebCrypto RSA-OAEP
https://bugs.webkit.org/show_bug.cgi?id=125084

Reviewed by Sam Weinig.

Source/WebCore: 

Tests: crypto/subtle/rsa-oaep-key-manipulation.html
       crypto/subtle/rsa-oaep-plaintext-length.html
       crypto/subtle/rsa-oaep-wrap-unwrap-aes.html

* WebCore.xcodeproj/project.pbxproj: Added new files.

* bindings/js/JSCryptoAlgorithmDictionary.cpp:
(WebCore::createRsaOaepParams):
(WebCore::JSCryptoAlgorithmDictionary::createParametersForEncrypt):
(WebCore::JSCryptoAlgorithmDictionary::createParametersForDecrypt):
(WebCore::JSCryptoAlgorithmDictionary::createParametersForImportKey):
Added RSA-OAEP parameters.

* bindings/js/JSCryptoKeySerializationJWK.cpp:
(WebCore::JSCryptoKeySerializationJWK::reconcileAlgorithm):
(WebCore::JSCryptoKeySerializationJWK::keySizeIsValid):
(WebCore::JSCryptoKeySerializationJWK::addJWKAlgorithmToJSON):
Support RSA-OAEP in JWK. It is more limited than general WebCrypto, as JWK only
allows SHA-1 as hash.

* crypto/CommonCryptoUtilities.cpp: Added. (WebCore::getCommonCryptoDigestAlgorithm):
* crypto/CommonCryptoUtilities.h: Added.
Extracted some shared code and forward declarations for CommonCrypto.

* crypto/CryptoAlgorithmParameters.h: (WebCore::CryptoAlgorithmParameters::Class):
* crypto/parameters/CryptoAlgorithmRsaOaepParams.h: Added.
Added RsaOaepParams.

* crypto/algorithms/CryptoAlgorithmRSA_OAEP.cpp: Added.
* crypto/algorithms/CryptoAlgorithmRSA_OAEP.h: Added.
* crypto/mac/CryptoAlgorithmRSA_OAEPMac.cpp: Added.

* crypto/mac/CryptoAlgorithmHMACMac.cpp:
(WebCore::getCommonCryptoHMACAlgorithm):
(WebCore::CryptoAlgorithmHMAC::platformSign):
(WebCore::CryptoAlgorithmHMAC::platformVerify):
* crypto/mac/CryptoAlgorithmRSASSA_PKCS1_v1_5Mac.cpp:
* crypto/mac/CryptoKeyMac.cpp:
* crypto/mac/CryptoKeyRSAMac.cpp:
Use CommonCryptoUtilities.

* crypto/mac/CryptoAlgorithmRegistryMac.cpp:
(WebCore::CryptoAlgorithmRegistry::platformRegisterAlgorithms): Register RSA-OAEP.

LayoutTests: 

* crypto/subtle/rsa-oaep-key-manipulation-expected.txt: Added.
* crypto/subtle/rsa-oaep-key-manipulation.html: Added.
* crypto/subtle/rsa-oaep-plaintext-length-expected.txt: Added.
* crypto/subtle/rsa-oaep-plaintext-length.html: Added.
* crypto/subtle/rsa-oaep-wrap-unwrap-aes-expected.txt: Added.
* crypto/subtle/rsa-oaep-wrap-unwrap-aes.html: Added.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@159944 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Simplify MediaPlayerPrivateGStreamerBase::createVideoSink()
https://bugs.webkit.org/show_bug.cgi?id=125077

Remove the method's unused parameter.
Remove the GStreamer 0.10.22 run-time validation, since we are using
GStreamer 1.0 officially.
Remove the creation of a spurious Bin for the video sink, since
either the fpssink or the webkitsink are valid sink elements.
Change fpsink to a GRefPtr.

Now, createVideoSink() returns a simple pointer to the created sink
element.

Reviewed by Philippe Normand.

No new tests, no behavior changes.

* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::createGSTPlayBin):
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
(WebCore::MediaPlayerPrivateGStreamerBase::createVideoSink):
(WebCore::MediaPlayerPrivateGStreamerBase::decodedFrameCount):
(WebCore::MediaPlayerPrivateGStreamerBase::droppedFrameCount):
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@159945 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Web Inspector: add a method to add padding around a WebInspector.Rect
https://bugs.webkit.org/show_bug.cgi?id=125072

Reviewed by Joseph Pecoraro.

Add a new WebInspector.Rect.prototype.pad() method which does not alter
the rectangle it's called and returns a new rect much like .inset(). I've
checked all call sites and there was no reuse of the rectangle that was
padded so this patch won't have any side effects.

* UserInterface/Breakpoint.js:
(WebInspector.Breakpoint.prototype._showEditBreakpointPopover):
* UserInterface/CSSStyleDeclarationTextEditor.js:
* UserInterface/Geometry.js:
(WebInspector.Rect.prototype.pad):
* UserInterface/LayerTreeSidebarPanel.js:
(WebInspector.LayerTreeSidebarPanel.prototype._updatePopoverForSelectedNode):
* UserInterface/SourceCodeTextEditor.js:
(WebInspector.SourceCodeTextEditor.prototype._showPopover):
* UserInterface/TimelineDataGrid.js:
(WebInspector.TimelineDataGrid.prototype._updatePopoverForSelectedNode):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@159946 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Gstreamer] update webkitvideosink metadata
https://bugs.webkit.org/show_bug.cgi?id=125082

Reviewed by Philippe Normand.

No new tests, no behavior changes.

* platform/graphics/gstreamer/VideoSinkGStreamer.cpp:
(webkit_video_sink_class_init):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@159947 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Remote Layer Tree: Disable direct image compositing
https://bugs.webkit.org/show_bug.cgi?id=124875
<rdar://problem/15446024>

Reviewed by Simon Fraser.

* WebProcess/WebPage/mac/GraphicsLayerCARemote.h:
Image-as-layer-contents is not implemented for the remote layer tree.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@159948 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Add support for WebCrypto RSA-OAEP
https://bugs.webkit.org/show_bug.cgi?id=125084

Build fix.

* WebCore.xcodeproj/project.pbxproj: Fix an automatic merge failure by re-adding
CryptoAlgorithmRsaOaepParams.h.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@159949 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Use GenericEventQueue in TrackListBase and reduce code duplication with scheduleTrackEvent()
https://bugs.webkit.org/show_bug.cgi?id=124811

Patch by Brendan Long <b.long@cablelabs.com> on 2013-12-02
Reviewed by Eric Carlson.

Source/WebCore:

No new tests because this is just refactoring.

* html/track/TrackListBase.cpp:
(TrackListBase::TrackListBase): Replace event code with a GenericEventQueue.
(TrackListBase::scheduleTrackEvent): Factor out duplicate code in schedule{Add,Remove}TrackEvent functions.
(TrackListBase::scheduleAddTrackEvent): Same.
(TrackListBase::scheduleRemoveTrackEvent): Same.
(TrackListBase::scheduleChangeEvent): Use GenericEventQueue.
* html/track/TrackListBase.h: Replace event code with GenericEventQueue.

LayoutTests:

* platform/mac/TestExpectations: Unskip onremovetrack test which was fixed a long time ago.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@159950 268f45cc-cd09-0410-ab3c-d52691b4dbfc