Make SegmentedVector Noncopyable
authoroliver@apple.com <oliver@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 11 Mar 2013 21:02:39 +0000 (21:02 +0000)
committeroliver@apple.com <oliver@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 11 Mar 2013 21:02:39 +0000 (21:02 +0000)
commita7fedc00e137bd12929926c70f8fc4ad22f81fc0
tree11bbaae1baba14c48f407df6fba2e176c5cd1a68
parent1f5ca1bd84f2ce91148f60b9e0f7b0f22fb3b4c3
Make SegmentedVector Noncopyable
https://bugs.webkit.org/show_bug.cgi?id=112059

Reviewed by Geoffrey Garen.

Source/JavaScriptCore:

Copying a SegmentedVector is very expensive, and really shouldn't
be necessary.  So I've taken the one place where we currently copy
and replaced it with a regular Vector, and replaced the address
dependent logic with a indexing ref instead.

* bytecompiler/BytecodeGenerator.cpp:
(JSC::BytecodeGenerator::newLabelScope):
(JSC::BytecodeGenerator::emitComplexJumpScopes):
* bytecompiler/BytecodeGenerator.h:
(BytecodeGenerator):
* bytecompiler/LabelScope.h:
(JSC):
(JSC::LabelScopePtr::LabelScopePtr):
(LabelScopePtr):
(JSC::LabelScopePtr::operator=):
(JSC::LabelScopePtr::~LabelScopePtr):
(JSC::LabelScopePtr::operator*):
(JSC::LabelScopePtr::operator->):
* bytecompiler/NodesCodegen.cpp:
(JSC::DoWhileNode::emitBytecode):
(JSC::WhileNode::emitBytecode):
(JSC::ForNode::emitBytecode):
(JSC::ForInNode::emitBytecode):
(JSC::SwitchNode::emitBytecode):
(JSC::LabelNode::emitBytecode):

Source/WTF:

Copying a SegmentedVector can be extraordinarily expensive, so we beat
it with the Noncopyable stick - that way we can ensure that if anyone
wants an actual copy they know what they're doing.

* wtf/SegmentedVector.h:
(SegmentedVector):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@145401 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp
Source/JavaScriptCore/bytecompiler/BytecodeGenerator.h
Source/JavaScriptCore/bytecompiler/LabelScope.h
Source/JavaScriptCore/bytecompiler/NodesCodegen.cpp
Source/WTF/ChangeLog
Source/WTF/wtf/SegmentedVector.h