Commit 5eef6e23 authored by Alberto Garcia's avatar Alberto Garcia
Browse files

New upstream version 2.15.92

parent 6bd97a63
......@@ -4645,6 +4645,22 @@ or build its own context menu.</p>
signal because showing the proposed context menu is the default behaviour.
</p></li>
</ul></div>
<p>The <em class="parameter"><code>event</code></em>
is expected to be one of the following types:</p>
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem"><p>
a <a href="../gdk3/gdk3-Event-Structures.html#GdkEventButton"><span class="type">GdkEventButton</span></a> of type <a href="../gdk3/gdk3-Events.html#GDK-BUTTON-PRESS:CAPS"><code class="literal">GDK_BUTTON_PRESS</code></a> when the context menu
was triggered with mouse.
</p></li>
<li class="listitem"><p>
a <a href="../gdk3/gdk3-Event-Structures.html#GdkEventKey"><span class="type">GdkEventKey</span></a> of type <a href="../gdk3/gdk3-Events.html#GDK-KEY-PRESS:CAPS"><code class="literal">GDK_KEY_PRESS</code></a> if the keyboard was used to show
the menu.
</p></li>
<li class="listitem"><p>
a generic <a href="../gdk3/gdk3-Event-Structures.html#GdkEvent"><span class="type">GdkEvent</span></a> of type <a href="../gdk3/gdk3-Events.html#GDK-NOTHING:CAPS"><code class="literal">GDK_NOTHING</code></a> when the <span class="type">“popup-menu”</span>
signal was used to show the context menu.
</p></li>
</ul></div>
<p>If the signal handler returns <a href="../glib/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> the context menu represented by <em class="parameter"><code>context_menu</code></em>
will be shown, if it return <a href="../glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> the context menu will not be shown.</p>
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -14,7 +14,7 @@
<div class="titlepage">
<div>
<div><table class="navigation" id="top" width="100%" cellpadding="2" cellspacing="0"><tr><th valign="middle"><p class="title">WebKit2GTK+ Reference Manual</p></th></tr></table></div>
<div><p class="releaseinfo">for WebKit2GTK+ 2.15.91</p></div>
<div><p class="releaseinfo">for WebKit2GTK+ 2.15.92</p></div>
</div>
<hr>
</div>
......
/home/cgarcia/src/git/gnome/WebKit-2.16/WebKitBuild/Release/Documentation/webkit2gtk-4.0/xml/WebKitWebView.xml:3294: parser error : Opening and ending tag mismatch: para line 3283 and itemizedlist
</itemizedlist>
^
/home/cgarcia/src/git/gnome/WebKit-2.16/WebKitBuild/Release/Documentation/webkit2gtk-4.0/xml/WebKitWebView.xml:3330: parser error : Opening and ending tag mismatch: listitem line 3283 and refsect2
</refsect2><refsect2 id="WebKitWebView-context-menu-dismissed" role="signal"><ti
^
/home/cgarcia/src/git/gnome/WebKit-2.16/WebKitBuild/Release/Documentation/webkit2gtk-4.0/xml/WebKitWebView.xml:4200: parser error : Opening and ending tag mismatch: itemizedlist line 3282 and refsect1
</refsect1>
^
/home/cgarcia/src/git/gnome/WebKit-2.16/WebKitBuild/Release/Documentation/webkit2gtk-4.0/xml/WebKitWebView.xml:4202: parser error : Opening and ending tag mismatch: refsect2 line 3245 and refentry
</refentry>
^
/home/cgarcia/src/git/gnome/WebKit-2.16/WebKitBuild/Release/Documentation/webkit2gtk-4.0/xml/WebKitWebView.xml:4203: parser error : Premature end of data in tag refsect1 line 3175
^
/home/cgarcia/src/git/gnome/WebKit-2.16/WebKitBuild/Release/Documentation/webkit2gtk-4.0/xml/WebKitWebView.xml:4203: parser error : Premature end of data in tag refentry line 6
^
/home/cgarcia/src/git/gnome/WebKit-2.16/WebKitBuild/Release/Documentation/webkit2gtk-4.0/webkit2gtk-docs.sgml:15: element include: XInclude error : could not load /home/cgarcia/src/git/gnome/WebKit-2.16/WebKitBuild/Release/Documentation/webkit2gtk-4.0/xml/WebKitWebView.xml, and no fallback was found
......@@ -177,7 +177,7 @@ against at application run time.</p>
<hr>
<div class="refsect2">
<a name="WEBKIT-MICRO-VERSION:CAPS"></a><h3>WEBKIT_MICRO_VERSION</h3>
<pre class="programlisting">#define WEBKIT_MICRO_VERSION (91)
<pre class="programlisting">#define WEBKIT_MICRO_VERSION (92)
</pre>
<p>Like <a class="link" href="webkit2gtk-4.0-WebKitVersion.html#webkit-get-micro-version" title="webkit_get_micro_version ()"><code class="function">webkit_get_micro_version()</code></a>, but from the headers used at
application compile time, rather than from the library linked
......
......@@ -14,7 +14,7 @@
<div class="titlepage">
<div>
<div><table class="navigation" id="top" width="100%" cellpadding="2" cellspacing="0"><tr><th valign="middle"><p class="title">WebKitDOMGTK+ Reference Manual</p></th></tr></table></div>
<div><p class="releaseinfo">for WebKitDOMGTK+ 2.15.91</p></div>
<div><p class="releaseinfo">for WebKitDOMGTK+ 2.15.92</p></div>
</div>
<hr>
</div>
......
This diff is collapsed.
==================
WebKitGTK+ 2.15.92
==================
- Show the context menu when triggered by the keyboard.
- Fix web process deadlocks when destroying the media player.
- Fix web process crashes when loading animated GIFs.
- Fix several crashes and rendering issues.
- Translation updates: Polish.
==================
WebKitGTK+ 2.15.91
==================
......
......@@ -92,14 +92,14 @@ function newRegistryEntry(key)
return {
key: key,
state: @ModuleFetch,
metadata: @undefined,
fetch: @undefined,
instantiate: @undefined,
satisfy: @undefined,
dependencies: [], // To keep the module order, we store the module keys in the array.
dependenciesMap: @undefined,
module: @undefined, // JSModuleRecord
error: @undefined,
linkError: @undefined,
linkSucceeded: true,
};
}
......@@ -350,24 +350,28 @@ function link(entry, fetcher)
"use strict";
// FIXME: Current implementation does not support optionalInstance.
// So Link's step 3 is skipped.
// https://bugs.webkit.org/show_bug.cgi?id=148171
if (!entry.linkSucceeded)
throw entry.linkError;
if (entry.state === @ModuleReady)
return;
@setStateToMax(entry, @ModuleReady);
// Since we already have the "dependencies" field,
// we can call moduleDeclarationInstantiation with the correct order
// without constructing the dependency graph by calling dependencyGraph.
var dependencies = entry.dependencies;
for (var i = 0, length = dependencies.length; i < length; ++i) {
var pair = dependencies[i];
this.link(pair.value.registryEntry, fetcher);
}
try {
// Since we already have the "dependencies" field,
// we can call moduleDeclarationInstantiation with the correct order
// without constructing the dependency graph by calling dependencyGraph.
var dependencies = entry.dependencies;
for (var i = 0, length = dependencies.length; i < length; ++i) {
var pair = dependencies[i];
this.link(pair.value.registryEntry, fetcher);
}
this.moduleDeclarationInstantiation(entry.module, fetcher);
this.moduleDeclarationInstantiation(entry.module, fetcher);
} catch (error) {
entry.linkSucceeded = false;
entry.linkError = error;
throw error;
}
}
// Module semantics.
......
......@@ -270,7 +270,7 @@ BytecodeGenerator::BytecodeGenerator(VM& vm, FunctionNode* functionNode, Unlinke
bool shouldCaptureSomeOfTheThings = m_shouldEmitDebugHooks || functionNode->needsActivation() || containsArrowOrEvalButNotInArrowBlock;
bool shouldCaptureAllOfTheThings = m_shouldEmitDebugHooks || codeBlock->usesEval();
bool needsArguments = (functionNode->usesArguments() || codeBlock->usesEval() || (functionNode->usesArrowFunction() && !codeBlock->isArrowFunction() && isArgumentsUsedInInnerArrowFunction()));
bool needsArguments = ((functionNode->usesArguments() && !codeBlock->isArrowFunction()) || codeBlock->usesEval() || (functionNode->usesArrowFunction() && !codeBlock->isArrowFunction() && isArgumentsUsedInInnerArrowFunction()));
if (isGeneratorOrAsyncFunctionBodyParseMode(parseMode)) {
// Generator and AsyncFunction never provides "arguments". "arguments" reference will be resolved in an upper generator function scope.
......
/*
* Copyright (C) 1999-2002 Harri Porten (porten@kde.org)
* Copyright (C) 2001 Peter Kelly (pmk@post.com)
* Copyright (C) 2003-2009, 2012-2013, 2015-2016 Apple Inc. All rights reserved.
* Copyright (C) 2003-2017 Apple Inc. All rights reserved.
* Copyright (C) 2007 Cameron Zwarich (cwzwarich@uwaterloo.ca)
* Copyright (C) 2007 Maks Orlovich
* Copyright (C) 2007 Eric Seidel <eric@webkit.org>
......@@ -2714,9 +2714,9 @@ void ForInNode::emitLoopHeader(BytecodeGenerator& generator, RegisterID* propert
generator.emitExpressionInfo(divot(), divotStart(), divotEnd());
if (var.isReadOnly())
generator.emitReadOnlyExceptionIfNeeded(var);
RegisterID* scope = generator.emitResolveScope(nullptr, var);
RefPtr<RegisterID> scope = generator.emitResolveScope(nullptr, var);
generator.emitExpressionInfo(divot(), divotStart(), divotEnd());
generator.emitPutToScope(scope, var, propertyName, generator.isStrictMode() ? ThrowIfNotFound : DoNotThrowIfNotFound, InitializationMode::NotInitialization);
generator.emitPutToScope(scope.get(), var, propertyName, generator.isStrictMode() ? ThrowIfNotFound : DoNotThrowIfNotFound, InitializationMode::NotInitialization);
}
generator.emitProfileType(propertyName, var, m_lexpr->position(), JSTextPosition(-1, m_lexpr->position().offset + ident.length(), -1));
};
......@@ -2960,9 +2960,9 @@ void ForOfNode::emitBytecode(BytecodeGenerator& generator, RegisterID* dst)
generator.emitExpressionInfo(divot(), divotStart(), divotEnd());
if (var.isReadOnly())
generator.emitReadOnlyExceptionIfNeeded(var);
RegisterID* scope = generator.emitResolveScope(nullptr, var);
RefPtr<RegisterID> scope = generator.emitResolveScope(nullptr, var);
generator.emitExpressionInfo(divot(), divotStart(), divotEnd());
generator.emitPutToScope(scope, var, value, generator.isStrictMode() ? ThrowIfNotFound : DoNotThrowIfNotFound, InitializationMode::NotInitialization);
generator.emitPutToScope(scope.get(), var, value, generator.isStrictMode() ? ThrowIfNotFound : DoNotThrowIfNotFound, InitializationMode::NotInitialization);
}
generator.emitProfileType(value, var, m_lexpr->position(), JSTextPosition(-1, m_lexpr->position().offset + ident.length(), -1));
} else if (m_lexpr->isDotAccessorNode()) {
......@@ -4074,15 +4074,15 @@ void BindingNode::bindValue(BytecodeGenerator& generator, RegisterID* value) con
}
if (generator.isStrictMode())
generator.emitExpressionInfo(divotEnd(), divotStart(), divotEnd());
RegisterID* scope = generator.emitResolveScope(nullptr, var);
RefPtr<RegisterID> scope = generator.emitResolveScope(nullptr, var);
generator.emitExpressionInfo(divotEnd(), divotStart(), divotEnd());
if (m_bindingContext == AssignmentContext::AssignmentExpression)
generator.emitTDZCheckIfNecessary(var, nullptr, scope);
generator.emitTDZCheckIfNecessary(var, nullptr, scope.get());
if (isReadOnly) {
generator.emitReadOnlyExceptionIfNeeded(var);
return;
}
generator.emitPutToScope(scope, var, value, generator.isStrictMode() ? ThrowIfNotFound : DoNotThrowIfNotFound, initializationModeForAssignmentContext(m_bindingContext));
generator.emitPutToScope(scope.get(), var, value, generator.isStrictMode() ? ThrowIfNotFound : DoNotThrowIfNotFound, initializationModeForAssignmentContext(m_bindingContext));
generator.emitProfileType(value, var, divotStart(), divotEnd());
if (m_bindingContext == AssignmentContext::DeclarationStatement || m_bindingContext == AssignmentContext::ConstDeclarationStatement)
generator.liftTDZCheckIfPossible(var);
......
......@@ -754,7 +754,6 @@ void SpeculativeJIT::emitCall(Node* node)
RELEASE_ASSERT(!isDirect);
CallVarargsData* data = node->callVarargsData();
GPRReg resultGPR;
unsigned numUsedStackSlots = m_jit.graph().m_nextMachineLocal;
if (isForwardVarargs) {
......@@ -777,6 +776,7 @@ void SpeculativeJIT::emitCall(Node* node)
inlineCallFrame = node->child3()->origin.semantic.inlineCallFrame;
else
inlineCallFrame = node->origin.semantic.inlineCallFrame;
// emitSetupVarargsFrameFastCase modifies the stack pointer if it succeeds.
emitSetupVarargsFrameFastCase(m_jit, scratchGPR2, scratchGPR1, scratchGPR2, scratchGPR3, inlineCallFrame, data->firstVarArgOffset, slowCase);
JITCompiler::Jump done = m_jit.jump();
slowCase.link(&m_jit);
......@@ -784,7 +784,6 @@ void SpeculativeJIT::emitCall(Node* node)
m_jit.exceptionCheck();
m_jit.abortWithReason(DFGVarargsThrowingPathDidNotThrow);
done.link(&m_jit);
resultGPR = scratchGPR2;
} else {
GPRReg argumentsPayloadGPR;
GPRReg argumentsTagGPR;
......@@ -825,10 +824,8 @@ void SpeculativeJIT::emitCall(Node* node)
callOperation(operationSetupVarargsFrame, GPRInfo::returnValueGPR, scratchGPR1, JSValueRegs(argumentsTagGPR, argumentsPayloadGPR), data->firstVarArgOffset, GPRInfo::returnValueGPR);
m_jit.exceptionCheck();
resultGPR = GPRInfo::returnValueGPR;
m_jit.addPtr(TrustedImm32(sizeof(CallerFrameAndPC)), GPRInfo::returnValueGPR, JITCompiler::stackPointerRegister);
}
m_jit.addPtr(TrustedImm32(sizeof(CallerFrameAndPC)), resultGPR, JITCompiler::stackPointerRegister);
DFG_ASSERT(m_jit.graph(), node, isFlushed());
......
......@@ -730,7 +730,6 @@ void SpeculativeJIT::emitCall(Node* node)
RELEASE_ASSERT(!isDirect);
CallVarargsData* data = node->callVarargsData();
GPRReg resultGPR;
unsigned numUsedStackSlots = m_jit.graph().m_nextMachineLocal;
if (isForwardVarargs) {
......@@ -753,6 +752,7 @@ void SpeculativeJIT::emitCall(Node* node)
inlineCallFrame = node->child3()->origin.semantic.inlineCallFrame;
else
inlineCallFrame = node->origin.semantic.inlineCallFrame;
// emitSetupVarargsFrameFastCase modifies the stack pointer if it succeeds.
emitSetupVarargsFrameFastCase(m_jit, scratchGPR2, scratchGPR1, scratchGPR2, scratchGPR3, inlineCallFrame, data->firstVarArgOffset, slowCase);
JITCompiler::Jump done = m_jit.jump();
slowCase.link(&m_jit);
......@@ -760,7 +760,6 @@ void SpeculativeJIT::emitCall(Node* node)
m_jit.exceptionCheck();
m_jit.abortWithReason(DFGVarargsThrowingPathDidNotThrow);
done.link(&m_jit);
resultGPR = scratchGPR2;
} else {
GPRReg argumentsGPR;
GPRReg scratchGPR1;
......@@ -798,11 +797,9 @@ void SpeculativeJIT::emitCall(Node* node)
callOperation(operationSetupVarargsFrame, GPRInfo::returnValueGPR, scratchGPR1, argumentsGPR, data->firstVarArgOffset, GPRInfo::returnValueGPR);
m_jit.exceptionCheck();
resultGPR = GPRInfo::returnValueGPR;
m_jit.addPtr(TrustedImm32(sizeof(CallerFrameAndPC)), GPRInfo::returnValueGPR, JITCompiler::stackPointerRegister);
}
m_jit.addPtr(TrustedImm32(sizeof(CallerFrameAndPC)), resultGPR, JITCompiler::stackPointerRegister);
DFG_ASSERT(m_jit.graph(), node, isFlushed());
// We don't need the arguments array anymore.
......
......@@ -327,7 +327,7 @@ const char* A64DOpcodeBitfield::format()
if (!(opc() & 0x1) && ((immediateS() & 0x1f) == 0x1f) && (is64Bit() == (immediateS() >> 5))) {
// asr/lsr
appendInstructionName(!opc() ? "ars" : "lsr");
appendInstructionName(!opc() ? "asr" : "lsr");
appendRegisterName(rd(), is64Bit());
appendSeparator();
......
......@@ -6392,10 +6392,6 @@ private:
exceptions->append(jit.emitExceptionCheck(AssemblyHelpers::NormalExceptionCheck, AssemblyHelpers::FarJumpWidth));
};
 
auto adjustStack = [&] (GPRReg amount) {
jit.addPtr(CCallHelpers::TrustedImm32(sizeof(CallerFrameAndPC)), amount, CCallHelpers::stackPointerRegister);
};
CCallHelpers::JumpList slowCase;
unsigned originalStackHeight = params.proc().frameSize();
 
......@@ -6415,6 +6411,9 @@ private:
jit.lshiftPtr(CCallHelpers::Imm32(3), scratchGPR1);
jit.addPtr(GPRInfo::callFrameRegister, scratchGPR1);
 
// Before touching stack values, we should update the stack pointer to protect them from signal stack.
jit.addPtr(CCallHelpers::TrustedImm32(sizeof(CallerFrameAndPC)), scratchGPR1, CCallHelpers::stackPointerRegister);
jit.store32(scratchGPR2, CCallHelpers::Address(scratchGPR1, CallFrameSlot::argumentCount * static_cast<int>(sizeof(Register)) + PayloadOffset));
 
int storeOffset = CallFrame::thisArgumentOffset() * static_cast<int>(sizeof(Register));
......@@ -6461,8 +6460,6 @@ private:
dontThrow.link(&jit);
}
adjustStack(scratchGPR1);
ASSERT(calleeGPR == GPRInfo::regT0);
jit.store64(calleeGPR, CCallHelpers::calleeFrameSlot(CallFrameSlot::callee));
......@@ -6702,10 +6699,6 @@ private:
exceptions->append(jit.emitExceptionCheck(AssemblyHelpers::NormalExceptionCheck, AssemblyHelpers::FarJumpWidth));
};
 
auto adjustStack = [&] (GPRReg amount) {
jit.addPtr(CCallHelpers::TrustedImm32(sizeof(CallerFrameAndPC)), amount, CCallHelpers::stackPointerRegister);
};
unsigned originalStackHeight = params.proc().frameSize();
 
if (forwarding) {
......@@ -6717,6 +6710,8 @@ private:
inlineCallFrame = node->child3()->origin.semantic.inlineCallFrame;
else
inlineCallFrame = node->origin.semantic.inlineCallFrame;
// emitSetupVarargsFrameFastCase modifies the stack pointer if it succeeds.
emitSetupVarargsFrameFastCase(jit, scratchGPR2, scratchGPR1, scratchGPR2, scratchGPR3, inlineCallFrame, data->firstVarArgOffset, slowCase);
 
CCallHelpers::Jump done = jit.jump();
......@@ -6726,8 +6721,6 @@ private:
jit.abortWithReason(DFGVarargsThrowingPathDidNotThrow);
done.link(&jit);
adjustStack(scratchGPR2);
} else {
jit.move(CCallHelpers::TrustedImm32(originalStackHeight / sizeof(EncodedJSValue)), scratchGPR1);
jit.setupArgumentsWithExecState(argumentsGPR, scratchGPR1, CCallHelpers::TrustedImm32(data->firstVarArgOffset));
......@@ -6741,7 +6734,7 @@ private:
jit.setupArgumentsWithExecState(scratchGPR2, argumentsGPR, CCallHelpers::TrustedImm32(data->firstVarArgOffset), scratchGPR1);
callWithExceptionCheck(bitwise_cast<void*>(operationSetupVarargsFrame));
adjustStack(GPRInfo::returnValueGPR);
jit.addPtr(CCallHelpers::TrustedImm32(sizeof(CallerFrameAndPC)), GPRInfo::returnValueGPR, CCallHelpers::stackPointerRegister);
 
calleeLateRep.emitRestore(jit, GPRInfo::regT0);
 
......
/*
* Copyright (C) 2016 Apple Inc. All rights reserved.
* Copyright (C) 2016-2017 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
......@@ -28,6 +28,16 @@
#include <wtf/PrintStream.h>
namespace JSC {
#if !COMPILER(GCC_OR_CLANG)
void HeapCell::use() const
{
}
#endif
} // namespace JSC
namespace WTF {
using namespace JSC;
......
/*
* Copyright (C) 2016 Apple Inc. All rights reserved.
* Copyright (C) 2016-2017 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
......@@ -66,6 +66,18 @@ public:
AllocatorAttributes allocatorAttributes() const;
DestructionMode destructionMode() const;
Kind cellKind() const;
// Call use() after the last point where you need `this` pointer to be kept alive. You usually don't
// need to use this, but it might be necessary if you're otherwise referring to an object's innards
// but not the object itself.
#if COMPILER(GCC_OR_CLANG)
void use() const
{
asm volatile ("" : : "r"(this) : "memory");
}
#else
void use() const;
#endif
};
} // namespace JSC
......
......@@ -60,7 +60,7 @@ void emitSetVarargsFrame(CCallHelpers& jit, GPRReg lengthGPR, bool lengthInclude
jit.addPtr(GPRInfo::callFrameRegister, resultGPR);
}
void emitSetupVarargsFrameFastCase(CCallHelpers& jit, GPRReg numUsedSlotsGPR, GPRReg scratchGPR1, GPRReg scratchGPR2, GPRReg scratchGPR3, ValueRecovery argCountRecovery, VirtualRegister firstArgumentReg, unsigned firstVarArgOffset, CCallHelpers::JumpList& slowCase)
static void emitSetupVarargsFrameFastCase(CCallHelpers& jit, GPRReg numUsedSlotsGPR, GPRReg scratchGPR1, GPRReg scratchGPR2, GPRReg scratchGPR3, ValueRecovery argCountRecovery, VirtualRegister firstArgumentReg, unsigned firstVarArgOffset, CCallHelpers::JumpList& slowCase)
{
CCallHelpers::JumpList end;
......@@ -84,6 +84,9 @@ void emitSetupVarargsFrameFastCase(CCallHelpers& jit, GPRReg numUsedSlotsGPR, GP
slowCase.append(jit.branchPtr(CCallHelpers::Above, CCallHelpers::AbsoluteAddress(jit.vm()->addressOfSoftStackLimit()), scratchGPR2));
// Before touching stack values, we should update the stack pointer to protect them from signal stack.
jit.addPtr(CCallHelpers::TrustedImm32(sizeof(CallerFrameAndPC)), scratchGPR2, CCallHelpers::stackPointerRegister);
// Initialize ArgumentCount.
jit.store32(scratchGPR1, CCallHelpers::Address(scratchGPR2, CallFrameSlot::argumentCount * static_cast<int>(sizeof(Register)) + PayloadOffset));
......@@ -108,11 +111,6 @@ void emitSetupVarargsFrameFastCase(CCallHelpers& jit, GPRReg numUsedSlotsGPR, GP
done.link(&jit);
}
void emitSetupVarargsFrameFastCase(CCallHelpers& jit, GPRReg numUsedSlotsGPR, GPRReg scratchGPR1, GPRReg scratchGPR2, GPRReg scratchGPR3, unsigned firstVarArgOffset, CCallHelpers::JumpList& slowCase)
{
emitSetupVarargsFrameFastCase(jit, numUsedSlotsGPR, scratchGPR1, scratchGPR2, scratchGPR3, nullptr, firstVarArgOffset, slowCase);
}
void emitSetupVarargsFrameFastCase(CCallHelpers& jit, GPRReg numUsedSlotsGPR, GPRReg scratchGPR1, GPRReg scratchGPR2, GPRReg scratchGPR3, InlineCallFrame* inlineCallFrame, unsigned firstVarArgOffset, CCallHelpers::JumpList& slowCase)
{
ValueRecovery argumentCountRecovery;
......
......@@ -36,12 +36,6 @@ void emitSetVarargsFrame(CCallHelpers&, GPRReg lengthGPR, bool lengthIncludesThi
// Assumes that SP refers to the last in-use stack location, and after this returns SP will point to
// the newly created frame plus the native header. scratchGPR2 may be the same as numUsedSlotsGPR.
void emitSetupVarargsFrameFastCase(CCallHelpers&, GPRReg numUsedSlotsGPR, GPRReg scratchGPR1, GPRReg scratchGPR2, GPRReg scratchGPR3, ValueRecovery argCountRecovery, VirtualRegister firstArgumentReg, unsigned firstVarArgOffset, CCallHelpers::JumpList& slowCase);
// Variant that assumes normal stack frame.
void emitSetupVarargsFrameFastCase(CCallHelpers&, GPRReg numUsedSlotsGPR, GPRReg scratchGPR1, GPRReg scratchGPR2, GPRReg scratchGPR3, unsigned firstVarArgOffset, CCallHelpers::JumpList& slowCase);
// Variant for potentially inlined stack frames.
void emitSetupVarargsFrameFastCase(CCallHelpers&, GPRReg numUsedSlotsGPR, GPRReg scratchGPR1, GPRReg scratchGPR2, GPRReg scratchGPR3, InlineCallFrame*, unsigned firstVarArgOffset, CCallHelpers::JumpList& slowCase);
} // namespace JSC
......
......@@ -36,6 +36,7 @@
#include "JSBoundFunction.h"
#include "JSCInlines.h"
#include "ObjectConstructor.h"
#include <unicode/ucurr.h>
namespace JSC {
......@@ -94,62 +95,17 @@ static Vector<String> localeData(const String& locale, size_t keyIndex)
return numberingSystemsForLocale(locale);
}
static inline unsigned computeCurrencySortKey(const String& currency)
{
ASSERT(currency.length() == 3);
ASSERT(currency.isAllSpecialCharacters<isASCIIUpper>());
return (currency[0] << 16) + (currency[1] << 8) + currency[2];
}
static inline unsigned computeCurrencySortKey(const char* currency)
{
ASSERT(strlen(currency) == 3);
ASSERT(isAllSpecialCharacters<isASCIIUpper>(currency, 3));
return (currency[0] << 16) + (currency[1] << 8) + currency[2];
}
static unsigned extractCurrencySortKey(std::pair<const char*, unsigned>* currencyMinorUnit)
{
return computeCurrencySortKey(currencyMinorUnit->first);
}
static unsigned computeCurrencyDigits(const String& currency)
{
// 11.1.1 The abstract operation CurrencyDigits (currency)
// "If the ISO 4217 currency and funds code list contains currency as an alphabetic code,
// then return the minor unit value corresponding to the currency from the list; else return 2.
std::pair<const char*, unsigned> currencyMinorUnits[] = {
{ "BHD", 3 },
{ "BIF", 0 },
{ "BYR", 0 },
{ "CLF", 4 },
{ "CLP", 0 },
{ "DJF", 0 },
{ "GNF", 0 },
{ "IQD", 3 },
{ "ISK", 0 },
{ "JOD", 3 },
{ "JPY", 0 },
{ "KMF", 0 },
{ "KRW", 0 },
{ "KWD", 3 },
{ "LYD", 3 },
{ "OMR", 3 },
{ "PYG", 0 },
{ "RWF", 0 },
{ "TND", 3 },
{ "UGX", 0 },
{ "UYI", 0 },
{ "VND", 0 },
{ "VUV", 0 },
{ "XAF", 0 },
{ "XOF", 0 },
{ "XPF", 0 }
};
auto* currencyMinorUnit = tryBinarySearch<std::pair<const char*, unsigned>>(currencyMinorUnits, WTF_ARRAY_LENGTH(currencyMinorUnits), computeCurrencySortKey(currency), extractCurrencySortKey);
if (currencyMinorUnit)
return currencyMinorUnit->second;
return 2;
Vector<UChar> chars = currency.charactersWithNullTermination();
UErrorCode status = U_ZERO_ERROR;
uint32_t result = ucurr_getDefaultFractionDigits(chars.data(), &status);
if (U_FAILURE(status))
result = 2;
return result;
}
void IntlNumberFormat::initializeNumberFormat(ExecState& state, JSValue locales, JSValue optionsValue)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment