A patchable GetById right after a watchpoint should have the appropriate nop padding
https://bugs.webkit.org/show_bug.cgi?id=94635
Reviewed by Mark Hahnenberg.
Source/JavaScriptCore:
* assembler/AbstractMacroAssembler.h:
(JSC::AbstractMacroAssembler::padBeforePatch):
(AbstractMacroAssembler):
* assembler/MacroAssemblerARMv7.h:
(JSC::MacroAssemblerARMv7::load32WithCompactAddressOffsetPatch):
(JSC::MacroAssemblerARMv7::moveWithPatch):
(JSC::MacroAssemblerARMv7::patchableJump):
* assembler/MacroAssemblerX86.h:
(JSC::MacroAssemblerX86::moveWithPatch):
(JSC::MacroAssemblerX86::branchPtrWithPatch):
(JSC::MacroAssemblerX86::storePtrWithPatch):
* assembler/MacroAssemblerX86Common.h:
(JSC::MacroAssemblerX86Common::load32WithAddressOffsetPatch):
(JSC::MacroAssemblerX86Common::load32WithCompactAddressOffsetPatch):
(JSC::MacroAssemblerX86Common::loadCompactWithAddressOffsetPatch):
(JSC::MacroAssemblerX86Common::store32WithAddressOffsetPatch):
* assembler/MacroAssemblerX86_64.h:
(JSC::MacroAssemblerX86_64::loadPtrWithAddressOffsetPatch):
(JSC::MacroAssemblerX86_64::loadPtrWithCompactAddressOffsetPatch):
(JSC::MacroAssemblerX86_64::storePtrWithAddressOffsetPatch):
(JSC::MacroAssemblerX86_64::moveWithPatch):
* jit/JumpReplacementWatchpoint.cpp:
(JSC::JumpReplacementWatchpoint::fireInternal):
LayoutTests:
* fast/js/dfg-patchable-get-by-id-after-watchpoint-expected.txt: Added.
* fast/js/dfg-patchable-get-by-id-after-watchpoint.html: Added.
* fast/js/script-tests/dfg-patchable-get-by-id-after-watchpoint.js: Added.
(foo):
(O):
(O.prototype.f):
(P1):
(P2):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@126214 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/Source/JavaScriptCore/assembler/MacroAssemblerX86.h b/Source/JavaScriptCore/assembler/MacroAssemblerX86.h
index da9dd8f..d1a4ff3 100644
--- a/Source/JavaScriptCore/assembler/MacroAssemblerX86.h
+++ b/Source/JavaScriptCore/assembler/MacroAssemblerX86.h
@@ -175,6 +175,7 @@
DataLabelPtr moveWithPatch(TrustedImmPtr initialValue, RegisterID dest)
{
+ padBeforePatch();
m_assembler.movl_i32r(initialValue.asIntptr(), dest);
return DataLabelPtr(this);
}
@@ -191,6 +192,7 @@
Jump branchPtrWithPatch(RelationalCondition cond, RegisterID left, DataLabelPtr& dataLabel, TrustedImmPtr initialRightValue = TrustedImmPtr(0))
{
+ padBeforePatch();
m_assembler.cmpl_ir_force32(initialRightValue.asIntptr(), left);
dataLabel = DataLabelPtr(this);
return Jump(m_assembler.jCC(x86Condition(cond)));
@@ -198,6 +200,7 @@
Jump branchPtrWithPatch(RelationalCondition cond, Address left, DataLabelPtr& dataLabel, TrustedImmPtr initialRightValue = TrustedImmPtr(0))
{
+ padBeforePatch();
m_assembler.cmpl_im_force32(initialRightValue.asIntptr(), left.offset, left.base);
dataLabel = DataLabelPtr(this);
return Jump(m_assembler.jCC(x86Condition(cond)));
@@ -205,6 +208,7 @@
DataLabelPtr storePtrWithPatch(TrustedImmPtr initialValue, ImplicitAddress address)
{
+ padBeforePatch();
m_assembler.movl_i32m(initialValue.asIntptr(), address.offset, address.base);
return DataLabelPtr(this);
}