[JSC] Embed RegExp into constant buffer in UnlinkedCodeBlock and CodeBlock
authorutatane.tea@gmail.com <utatane.tea@gmail.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 9 Jul 2018 21:29:41 +0000 (21:29 +0000)
committerutatane.tea@gmail.com <utatane.tea@gmail.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 9 Jul 2018 21:29:41 +0000 (21:29 +0000)
commite0cb45a84d77c1c8e896e382e86fcdf5f31358cf
treeef7a4373e928d5c8c56b432c7a6802b575f2a292
parent8d06eb1e5198781dd5368723e813131311bcfc04
[JSC] Embed RegExp into constant buffer in UnlinkedCodeBlock and CodeBlock
https://bugs.webkit.org/show_bug.cgi?id=187477

Reviewed by Mark Lam.

Before this patch, RegExp* is specially held in m_regexp buffer which resides in CodeBlock's RareData.
However, it is not necessary since JSCells can be reside in a constant buffer.
This patch embeds RegExp* to a constant buffer in UnlinkedCodeBlock and CodeBlock. And remove RegExp
vector from RareData.

We also move the code of dumping RegExp from BytecodeDumper to RegExp::dumpToStream.

* bytecode/BytecodeDumper.cpp:
(JSC::BytecodeDumper<Block>::dumpBytecode):
(JSC::BytecodeDumper<Block>::dumpBlock):
(JSC::regexpToSourceString): Deleted.
(JSC::regexpName): Deleted.
(JSC::BytecodeDumper<Block>::dumpRegExps): Deleted.
* bytecode/BytecodeDumper.h:
* bytecode/CodeBlock.h:
(JSC::CodeBlock::regexp const): Deleted.
(JSC::CodeBlock::numberOfRegExps const): Deleted.
* bytecode/UnlinkedCodeBlock.cpp:
(JSC::UnlinkedCodeBlock::visitChildren):
(JSC::UnlinkedCodeBlock::shrinkToFit):
* bytecode/UnlinkedCodeBlock.h:
(JSC::UnlinkedCodeBlock::addRegExp): Deleted.
(JSC::UnlinkedCodeBlock::numberOfRegExps const): Deleted.
(JSC::UnlinkedCodeBlock::regexp const): Deleted.
* bytecompiler/BytecodeGenerator.cpp:
(JSC::BytecodeGenerator::emitNewRegExp):
(JSC::BytecodeGenerator::addRegExp): Deleted.
* bytecompiler/BytecodeGenerator.h:
* dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::parseBlock):
* jit/JITOpcodes.cpp:
(JSC::JIT::emit_op_new_regexp):
* llint/LLIntSlowPaths.cpp:
(JSC::LLInt::LLINT_SLOW_PATH_DECL):
* runtime/JSCJSValue.cpp:
(JSC::JSValue::dumpInContextAssumingStructure const):
* runtime/RegExp.cpp:
(JSC::regexpToSourceString):
(JSC::RegExp::dumpToStream):
* runtime/RegExp.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@233657 268f45cc-cd09-0410-ab3c-d52691b4dbfc
14 files changed:
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/bytecode/BytecodeDumper.cpp
Source/JavaScriptCore/bytecode/BytecodeDumper.h
Source/JavaScriptCore/bytecode/CodeBlock.h
Source/JavaScriptCore/bytecode/UnlinkedCodeBlock.cpp
Source/JavaScriptCore/bytecode/UnlinkedCodeBlock.h
Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp
Source/JavaScriptCore/bytecompiler/BytecodeGenerator.h
Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp
Source/JavaScriptCore/jit/JITOpcodes.cpp
Source/JavaScriptCore/llint/LLIntSlowPaths.cpp
Source/JavaScriptCore/runtime/JSCJSValue.cpp
Source/JavaScriptCore/runtime/RegExp.cpp
Source/JavaScriptCore/runtime/RegExp.h