WebKit Bugzilla
Attachment 356798 Details for
Bug 192006
: Record right offset with aligned wide instructions
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-192006-20181207130453.patch (text/plain), 5.00 KB, created by
Dominik Inführ
on 2018-12-07 04:04:55 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Dominik Inführ
Created:
2018-12-07 04:04:55 PST
Size:
5.00 KB
patch
obsolete
>Subversion Revision: 238950 >diff --git a/Source/JavaScriptCore/ChangeLog b/Source/JavaScriptCore/ChangeLog >index ac53c4cf7c1eb23870742f6de68a16f3b43f3bbd..852a4428b489c235af5d04693638ffa572ce63cf 100644 >--- a/Source/JavaScriptCore/ChangeLog >+++ b/Source/JavaScriptCore/ChangeLog >@@ -1,3 +1,23 @@ >+2018-11-27 Dominik Infuehr <dinfuehr@igalia.com> >+ >+ Record right offset with aligned wide instructions >+ https://bugs.webkit.org/show_bug.cgi?id=192006 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Aligning bytecode instructions inserts nops into the instruction stream. >+ Emitting an instruction did not record the actual start of the instruction with >+ aligned instructions, but the nop just before the actual instruction. This was >+ problematic with the StaticPropertyAnalyzer that used the wrong instruction offset. >+ >+ * bytecode/InstructionStream.h: >+ (JSC::InstructionStream::MutableRef::clone): >+ * bytecompiler/BytecodeGenerator.cpp: >+ (JSC::BytecodeGenerator::alignWideOpcode): >+ (JSC::BytecodeGenerator::emitCreateThis): >+ (JSC::BytecodeGenerator::emitNewObject): >+ * generator/Opcode.rb: >+ > 2018-12-05 Mark Lam <mark.lam@apple.com> > > speculationFromCell() should speculate non-Identifier strings as SpecString instead of SpecStringVar. >diff --git a/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp b/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp >index 828aed0469d9fbd81f7a78ff1c106787f1b90bd7..ee515c944cd1ad999f0d9b4a5710062a99b801c7 100644 >--- a/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp >+++ b/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp >@@ -1323,11 +1323,8 @@ void BytecodeGenerator::recordOpcode(OpcodeID opcodeID) > void BytecodeGenerator::alignWideOpcode() > { > #if CPU(NEEDS_ALIGNED_ACCESS) >- OpcodeID lastOpcodeID = m_lastOpcodeID; >- m_lastOpcodeID = op_end; > while ((m_writer.position() + 1) % OpcodeSize::Wide) > OpNop::emit<OpcodeSize::Narrow>(this); >- recordOpcode(lastOpcodeID); > #endif > } > >@@ -2784,9 +2781,11 @@ RegisterID* BytecodeGenerator::emitGetArgument(RegisterID* dst, int32_t index) > > RegisterID* BytecodeGenerator::emitCreateThis(RegisterID* dst) > { >- m_staticPropertyAnalyzer.createThis(dst, m_writer.ref()); >- > OpCreateThis::emit(this, dst, dst, 0); >+ >+ auto inst = m_lastInstruction; >+ m_staticPropertyAnalyzer.createThis(dst, WTFMove(inst)); >+ > m_codeBlock->addPropertyAccessInstruction(m_lastInstruction.offset()); > return dst; > } >@@ -2893,9 +2892,11 @@ void BytecodeGenerator::restoreTDZStack(const BytecodeGenerator::PreservedTDZSta > > RegisterID* BytecodeGenerator::emitNewObject(RegisterID* dst) > { >- m_staticPropertyAnalyzer.newObject(dst, m_writer.ref()); >- > OpNewObject::emit(this, dst, 0); >+ >+ auto inst = m_lastInstruction; >+ m_staticPropertyAnalyzer.newObject(dst, WTFMove(inst)); >+ > return dst; > } > >diff --git a/Source/JavaScriptCore/generator/Opcode.rb b/Source/JavaScriptCore/generator/Opcode.rb >index 523ff593c7ead27e89afb675ee3817e7efa5aa84..98555f86b28e7ac691d2b966636688def79fab4c 100644 >--- a/Source/JavaScriptCore/generator/Opcode.rb >+++ b/Source/JavaScriptCore/generator/Opcode.rb >@@ -114,9 +114,9 @@ EOF > <<-EOF.chomp > static void emit(BytecodeGenerator* gen#{typed_args}) > { >- gen->recordOpcode(opcodeID);#{@metadata.create_emitter_local} >- emit<OpcodeSize::Narrow, NoAssert, false>(gen#{untyped_args}#{metadata_arg}) >- || emit<OpcodeSize::Wide, Assert, false>(gen#{untyped_args}#{metadata_arg}); >+ #{@metadata.create_emitter_local} >+ emit<OpcodeSize::Narrow, NoAssert, true>(gen#{untyped_args}#{metadata_arg}) >+ || emit<OpcodeSize::Wide, Assert, true>(gen#{untyped_args}#{metadata_arg}); > } > #{%{ > template<OpcodeSize size, FitsAssertion shouldAssert = Assert> >@@ -128,22 +128,22 @@ EOF > template<OpcodeSize size, FitsAssertion shouldAssert = Assert, bool recordOpcode = true> > static bool emit(BytecodeGenerator* gen#{typed_args}#{metadata_param}) > { >- if (recordOpcode) >- gen->recordOpcode(opcodeID); >- bool didEmit = emitImpl<size>(gen#{untyped_args}#{metadata_arg}); >+ bool didEmit = emitImpl<size, recordOpcode>(gen#{untyped_args}#{metadata_arg}); > if (shouldAssert == Assert) > ASSERT(didEmit); > return didEmit; > } > > private: >- template<OpcodeSize size> >+ template<OpcodeSize size, bool recordOpcode> > static bool emitImpl(BytecodeGenerator* gen#{typed_args}#{metadata_param}) > { > if (size == OpcodeSize::Wide) > gen->alignWideOpcode(); > if (#{map_fields_with_size("", "size", &:fits_check).join "\n && "} > && (size == OpcodeSize::Wide ? #{op_wide.fits_check(Size::Narrow)} : true)) { >+ if (recordOpcode) >+ gen->recordOpcode(opcodeID); > if (size == OpcodeSize::Wide) > #{op_wide.fits_write Size::Narrow} > #{map_fields_with_size(" ", "size", &:fits_write).join "\n"}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 192006
:
355724
|
355725
|
355728
|
355734
|
355858
|
356798
|
356822