Source/JavaScriptCore/ChangeLog

 12019-01-08 Dominik Infuehr <dinfuehr@igalia.com>
 2
 3 Enable DFG on ARM/Linux again
 4 https://bugs.webkit.org/show_bug.cgi?id=192496
 5
 6 Reviewed by NOBODY (OOPS!).
 7
 8 After changing the bytecode format DFG was disabled on all 32-bit
 9 architectures. Enable DFG now again on ARM/Linux. Do not use register
 10 r11 in compiled DFG mode since it is already used in LLInt as metadataTable
 11 register. Also clean up code since ARM traditional isn't supported anymore.
 12
 13 * dfg/DFGOSRExit.cpp:
 14 (JSC::DFG::restoreCalleeSavesFromVMEntryFrameCalleeSavesBuffer):
 15 (JSC::DFG::copyCalleeSavesToVMEntryFrameCalleeSavesBuffer):
 16 * jit/CallFrameShuffler.cpp:
 17 (JSC::CallFrameShuffler::CallFrameShuffler):
 18 * jit/GPRInfo.h:
 19 (JSC::GPRInfo::toIndex):
 20 * llint/LowLevelInterpreter32_64.asm:
 21 * offlineasm/arm.rb:
 22
1232019-01-07 Devin Rousso <drousso@apple.com>
224
325 Web Inspector: extend XHR breakpoints to work with fetch

Source/WTF/ChangeLog

 12019-01-08 Dominik Infuehr <dinfuehr@igalia.com>
 2
 3 Enable DFG on ARM/Linux again
 4 https://bugs.webkit.org/show_bug.cgi?id=192496
 5
 6 Reviewed by NOBODY (OOPS!).
 7
 8 After changing the bytecode format DFG was disabled on all 32-bit
 9 architectures. Enable DFG now again on ARM/Linux.
 10
 11 * wtf/Platform.h:
 12
1132019-01-07 David Kilzer <ddkilzer@apple.com>
214
315 Prefer RetainPtr<NSObject> to RetainPtr<NSObject *>

Source/JavaScriptCore/assembler/AbstractMacroAssembler.h

@@public:
749749 m_jumps.append(other.m_jumps.begin(), other.m_jumps.size());
750750 }
751751
752  bool empty()
 752 bool empty() const
753753 {
754754 return !m_jumps.size();
755755 }

Source/JavaScriptCore/dfg/DFGOSRExit.cpp

@@static JSValue jsValueFor(CPUState& cpu, JSValueSource source)
7575
7676#if NUMBER_OF_CALLEE_SAVES_REGISTERS > 0
7777
78 static_assert(is64Bit(), "we only support callee save registers on 64-bit");
79 
8078// Based on AssemblyHelpers::emitRestoreCalleeSavesFor().
8179static void restoreCalleeSavesFor(Context& context, CodeBlock* codeBlock)
8280{

@@static void restoreCalleeSavesFromVMEntryFrameCalleeSavesBuffer(Context& context
137135 size_t uintptrOffset = entry.offset() / sizeof(UCPURegister);
138136 if (entry.reg().isGPR())
139137 context.gpr(entry.reg().gpr()) = calleeSaveBuffer[uintptrOffset];
140  else
 138 else {
 139#if USE(JSVALUE64)
141140 context.fpr(entry.reg().fpr()) = bitwise_cast<double>(calleeSaveBuffer[uintptrOffset]);
 141#else
 142 // FIXME: support callee-saved floating point registers on 32-bit architectures
 143 RELEASE_ASSERT_NOT_REACHED();
 144#endif
 145 }
142146 }
143147}
144148

@@static void copyCalleeSavesToVMEntryFrameCalleeSavesBuffer(Context& context)
161165 continue;
162166 if (entry.reg().isGPR())
163167 stack.set(calleeSaveBuffer, entry.offset(), context.gpr<UCPURegister>(entry.reg().gpr()));
164  else
 168 else {
 169#if USE(JSVALUE64)
165170 stack.set(calleeSaveBuffer, entry.offset(), context.fpr<UCPURegister>(entry.reg().fpr()));
 171#else
 172 // FIXME: support callee-saved floating point registers on 32-bit architectures
 173 RELEASE_ASSERT_NOT_REACHED();
 174#endif
 175 }
166176 }
167177}
168178

Source/JavaScriptCore/jit/CallFrameShuffler.cpp

@@CallFrameShuffler::CallFrameShuffler(CCallHelpers& jit, const CallFrameShuffleDa
5151 m_lockedRegisters.clear(GPRInfo::toRegister(i));
5252 for (unsigned i = FPRInfo::numberOfRegisters; i--; )
5353 m_lockedRegisters.clear(FPRInfo::toRegister(i));
54  // ... as well as the runtime registers.
 54
 55#if USE(JSVALUE64)
 56 // ... as well as the runtime registers on 64-bit architectures.
 57 // However do not use these registers on 32-bit architectures since
 58 // saving and restoring callee-saved registers in CallFrameShuffler isn't supported
 59 // on 32-bit architectures yet.
5560 m_lockedRegisters.exclude(RegisterSet::vmCalleeSaveRegisters());
 61#endif
5662
5763 ASSERT(!data.callee.isInJSStack() || data.callee.virtualRegister().isLocal());
5864 addNew(VirtualRegister(CallFrameSlot::callee), data.callee);

Source/JavaScriptCore/jit/GPRInfo.h

@@public:
528528
529529#if CPU(ARM)
530530#define NUMBER_OF_ARGUMENT_REGISTERS 4u
531 #if CPU(ARM_THUMB2)
532531#define NUMBER_OF_CALLEE_SAVES_REGISTERS 1u
533 #else
534 #define NUMBER_OF_CALLEE_SAVES_REGISTERS 0u
535 #endif
536532
537533class GPRInfo {
538534public:

@@public:
548544 static const GPRReg regT4 = ARMRegisters::r8;
549545 static const GPRReg regT5 = ARMRegisters::r9;
550546 static const GPRReg regT6 = ARMRegisters::r10;
551 #if CPU(ARM_THUMB2)
552  static const GPRReg regT7 = ARMRegisters::r11;
553 #else
554  static const GPRReg regT7 = ARMRegisters::r7;
555 #endif
 547 static const GPRReg regT7 = ARMRegisters::r5;
556548 static const GPRReg regT8 = ARMRegisters::r4;
557549 static const GPRReg regCS0 = ARMRegisters::r11;
558550 // These registers match the baseline JIT.

@@public:
587579 ASSERT(reg != InvalidGPRReg);
588580 ASSERT(static_cast<int>(reg) < 16);
589581 static const unsigned indexForRegister[16] =
590 #if CPU(ARM_THUMB2)
591  { 0, 1, 2, 3, 8, InvalidIndex, InvalidIndex, InvalidIndex, 4, 5, 6, 7, InvalidIndex, InvalidIndex, InvalidIndex, InvalidIndex };
592 #else
593  { 0, 1, 2, 3, 8, InvalidIndex, InvalidIndex, 7, 4, 5, 6, InvalidIndex, InvalidIndex, InvalidIndex, InvalidIndex, InvalidIndex };
594 #endif
 582 { 0, 1, 2, 3, 8, 7, InvalidIndex, InvalidIndex, 4, 5, 6, InvalidIndex, InvalidIndex, InvalidIndex, InvalidIndex, InvalidIndex };
595583 unsigned result = indexForRegister[reg];
596584 return result;
597585 }

Source/JavaScriptCore/llint/LowLevelInterpreter32_64.asm

@@end)
20022002
20032003
20042004op(llint_throw_from_slow_path_trampoline, macro()
 2005 loadp Callee[cfr], t1
 2006 andp MarkedBlockMask, t1
 2007 loadp MarkedBlockFooterOffset + MarkedBlock::Footer::m_vm[t1], t1
 2008 copyCalleeSavesToVMEntryFrameCalleeSavesBuffer(t1, t2)
 2009
20052010 callSlowPath(_llint_slow_path_handle_exception)
20062011
20072012 # When throwing from the interpreter (i.e. throwing from LLIntSlowPaths), so

@@op(llint_throw_from_slow_path_trampoline, macro()
20102015 loadp Callee[cfr], t1
20112016 andp MarkedBlockMask, t1
20122017 loadp MarkedBlockFooterOffset + MarkedBlock::Footer::m_vm[t1], t1
2013  copyCalleeSavesToVMEntryFrameCalleeSavesBuffer(t1, t2)
20142018 jmp VM::targetMachinePCForThrow[t1]
20152019end)
20162020

Source/JavaScriptCore/offlineasm/arm.rb

@@require "risc"
3434# x2 => t2, a2, r2
3535# x3 => t3, a3, r3
3636# x6 => (callee-save scratch)
37 # x7 => cfr (ARMv7 only)
 37# x7 => cfr
3838# x8 => t4 (callee-save)
3939# x9 => t5 (callee-save)
4040# x10 => (callee-save scratch)

@@require "risc"
5555# d6 => (scratch)
5656# d7 => (scratch)
5757
58 def isARMv7
59  case $activeBackend
60  when "ARMv7"
61  true
62  else
63  raise "bad value for $activeBackend: #{$activeBackend}"
64  end
65 end
66 
6758class Node
6859 def armSingle
6960 doubleOperand = armOperand

@@def armMoveImmediate(value, register)
9182 $asm.puts "mov #{register.armOperand}, \##{value}"
9283 elsif (~value) >= 0 && (~value) < 256
9384 $asm.puts "mvn #{register.armOperand}, \##{~value}"
94  elsif isARMv7
 85 else
9586 $asm.puts "movw #{register.armOperand}, \##{value & 0xffff}"
9687 if (value & 0xffff0000) != 0
9788 $asm.puts "movt #{register.armOperand}, \##{(value >> 16) & 0xffff}"
9889 end
99  else
100  $asm.puts "ldr #{register.armOperand}, =#{value}"
10190 end
10291end
10392

@@class RegisterID
119108 when "t5"
120109 "r9"
121110 when "cfr"
122  isARMv7 ? "r7" : "r11"
 111 "r7"
123112 when "csr0"
124113 "r11"
125114 when "lr"

@@class Instruction
609598 else
610599 $asm.puts "mov pc, #{operands[0].armOperand}"
611600 end
612  if not isARMv7 and not isARMv7Traditional
613  $asm.puts ".ltorg"
614  end
615601 when "call"
616602 if operands[0].label?
617603 if OS_DARWIN

@@class Instruction
692678 $asm.puts "add #{dest.armOperand}, pc, #{dest.armOperand}"
693679 $asm.puts "ldr #{dest.armOperand}, [#{dest.armOperand}, #{temp.armOperand}]"
694680
695  offset = $activeBackend == "ARMv7" ? 4 : 8
 681 offset = 4
696682
697683 $asm.deferNextLabelAction {
698684 $asm.puts "#{gotLabel}:"

Source/WTF/wtf/Platform.h

760760#if !defined(ENABLE_JIT)
761761#define ENABLE_JIT 1
762762#endif
763 /* But still disable DFG for now. */
764 #undef ENABLE_DFG_JIT
765 #define ENABLE_DFG_JIT 0
766763#else
767764/* Disable JIT and force C_LOOP on all 32bit-architectures but ARMv7-Thumb2/Linux. */
768765#undef ENABLE_JIT

Tools/ChangeLog

 12019-01-08 Dominik Infuehr <dinfuehr@igalia.com>
 2
 3 Enable DFG on ARM/Linux again
 4 https://bugs.webkit.org/show_bug.cgi?id=192496
 5
 6 Reviewed by NOBODY (OOPS!).
 7
 8 After changing the bytecode format DFG was disabled on all 32-bit
 9 architectures. Enable DFG now again on ARM/Linux. Run again JIT-tests
 10 on ARM by default.
 11
 12 * Scripts/run-jsc-stress-tests:
 13
1142019-01-07 David Kilzer <ddkilzer@apple.com>
215
316 Leak of ScrollCompletionCallbackData (16 bytes) in com.apple.WebKit.WebContent running WebKit layout tests

Tools/Scripts/run-jsc-stress-tests

@@$hostOS = determineOS unless $hostOS
449449$architecture = determineArchitecture unless $architecture
450450$isFTLPlatform = !($architecture == "x86" || $architecture == "arm" || $architecture == "mips" || $hostOS == "windows")
451451
452 if ["arm", "mips", "x86"].include?($architecture)
 452if ["mips", "x86"].include?($architecture)
453453 # The JIT is temporarily disabled on these platforms since
454454 # https://trac.webkit.org/changeset/237547
455455 $jitTests = false

LayoutTests/ChangeLog

 12019-01-08 Dominik Infuehr <dinfuehr@igalia.com>
 2
 3 Enable DFG on ARM/Linux again
 4 https://bugs.webkit.org/show_bug.cgi?id=192496
 5
 6 Reviewed by NOBODY (OOPS!).
 7
 8 After changing the bytecode format DFG was disabled on all 32-bit
 9 architectures. Enable DFG now again on ARM/Linux. Disable tests that
 10 run out of executable memory with LLInt disabled.
 11
 12 * js/script-tests/dfg-float32array.js:
 13 * js/script-tests/dfg-float64array.js:
 14 * js/script-tests/dfg-int16array.js:
 15 * js/script-tests/dfg-int32array-overflow-values.js:
 16 * js/script-tests/dfg-int32array.js:
 17 * js/script-tests/dfg-int8array.js:
 18 * js/script-tests/dfg-uint16array.js:
 19 * js/script-tests/dfg-uint32array.js:
 20 * js/script-tests/dfg-uint8array.js:
 21
1222019-01-07 Youenn Fablet <youenn@apple.com>
223
324 LayoutTests/http/wpt/fetch/csp-reports-bypass-csp-checks.html is flaky

LayoutTests/js/script-tests/dfg-float32array.js

1 //@ noNoLLIntRunLayoutTest if $architecture == "arm" and $hostOS == "darwin"
 1//@ noNoLLIntRunLayoutTest if $architecture == "arm"
22
33description(
44"This tests that float32 arrays work in the DFG."

LayoutTests/js/script-tests/dfg-float64array.js

1 //@ noNoLLIntRunLayoutTest if $architecture == "arm" and $hostOS == "darwin"
 1//@ noNoLLIntRunLayoutTest if $architecture == "arm"
22
33description(
44"This tests that float64 arrays work in the DFG."

LayoutTests/js/script-tests/dfg-int16array.js

1 //@ noNoLLIntRunLayoutTest if $architecture == "arm" and $hostOS == "darwin"
 1//@ noNoLLIntRunLayoutTest if $architecture == "arm"
22
33description(
44"This tests that int16 arrays work in the DFG."

LayoutTests/js/script-tests/dfg-int32array-overflow-values.js

1 //@ noNoLLIntRunLayoutTest if $architecture == "arm" and $hostOS == "darwin"
 1//@ noNoLLIntRunLayoutTest if $architecture == "arm"
22
33description(
44"This tests that int32 arrays work in the DFG."

LayoutTests/js/script-tests/dfg-int32array.js

1 //@ noNoLLIntRunLayoutTest if $architecture == "arm" and $hostOS == "darwin"
 1//@ noNoLLIntRunLayoutTest if $architecture == "arm"
22
33description(
44"This tests that int32 arrays work in the DFG."

LayoutTests/js/script-tests/dfg-int8array.js

1 //@ noNoLLIntRunLayoutTest if $architecture == "arm" and $hostOS == "darwin"
 1//@ noNoLLIntRunLayoutTest if $architecture == "arm"
22
33description(
44"This tests that int8 arrays work in the DFG."

LayoutTests/js/script-tests/dfg-uint16array.js

1 //@ noNoLLIntRunLayoutTest if $architecture == "arm" and $hostOS == "darwin"
 1//@ noNoLLIntRunLayoutTest if $architecture == "arm"
22
33description(
44"This tests that uint16 arrays work in the DFG."

LayoutTests/js/script-tests/dfg-uint32array.js

1 //@ noNoLLIntRunLayoutTest if $architecture == "arm" and $hostOS == "darwin"
 1//@ noNoLLIntRunLayoutTest if $architecture == "arm"
22
33description(
44"This tests that uint32 arrays work in the DFG."

LayoutTests/js/script-tests/dfg-uint8array.js

1 //@ noNoLLIntRunLayoutTest if $architecture == "arm" and $hostOS == "darwin"
 1//@ noNoLLIntRunLayoutTest if $architecture == "arm"
22
33description(
44"This tests that uint8 arrays work in the DFG."

JSTests/ChangeLog

 12019-01-08 Dominik Infuehr <dinfuehr@igalia.com>
 2
 3 Enable DFG on ARM/Linux again
 4 https://bugs.webkit.org/show_bug.cgi?id=192496
 5
 6 Reviewed by NOBODY (OOPS!).
 7
 8 Test wasn't really skipped before moving the line with skip
 9 to the top.
 10
 11 * stress/regress-192717.js:
 12
1132019-01-04 Tadeu Zagallo <tzagallo@apple.com>
214
315 Baseline version of get_by_id may corrupt metadata

JSTests/stress/regress-192717.js

1 //@ runDefault("--useLLInt=false", "--forceCodeBlockToJettisonDueToOldAge=true", "--maxPerThreadStackUsage=200000", "--exceptionStackTraceLimit=1", "--defaultErrorStackTraceLimit=1")
21//@ skip if $memoryLimited or $buildType == "debug"
 2//@ runDefault("--useLLInt=false", "--forceCodeBlockToJettisonDueToOldAge=true", "--maxPerThreadStackUsage=200000", "--exceptionStackTraceLimit=1", "--defaultErrorStackTraceLimit=1")
33
44let foo = 'let a';
55for (let i = 0; i < 400000; i++)