Skip to content

Commit 1d8fa71

Browse files
committed
Static size inference for JavaScript objects
https://bugs.webkit.org/show_bug.cgi?id=108093 Reviewed by Phil Pizlo. ../JavaScriptCore: * API/JSObjectRef.cpp: * JavaScriptCore.order: * JavaScriptCore.xcodeproj/project.pbxproj: Pay the tax man. * bytecode/CodeBlock.cpp: (JSC::CodeBlock::dumpBytecode): op_new_object and op_create_this now have an extra inferredInlineCapacity argument. This is the statically inferred inline capacity, just from analyzing source text. op_new_object also gets a pointer to an allocation profile. (For op_create_this, the profile is in the construtor function.) (JSC::CodeBlock::CodeBlock): Link op_new_object. (JSC::CodeBlock::stronglyVisitStrongReferences): Mark our profiles. * bytecode/CodeBlock.h: (CodeBlock): Removed some dead code. Added object allocation profiles. * bytecode/Instruction.h: (JSC): New union type, since an instruction operand may point to an object allocation profile now. * bytecode/ObjectAllocationProfile.h: Added. (JSC): (ObjectAllocationProfile): (JSC::ObjectAllocationProfile::offsetOfAllocator): (JSC::ObjectAllocationProfile::offsetOfStructure): (JSC::ObjectAllocationProfile::ObjectAllocationProfile): (JSC::ObjectAllocationProfile::isNull): (JSC::ObjectAllocationProfile::initialize): (JSC::ObjectAllocationProfile::structure): (JSC::ObjectAllocationProfile::inlineCapacity): (JSC::ObjectAllocationProfile::clear): (JSC::ObjectAllocationProfile::visitAggregate): (JSC::ObjectAllocationProfile::possibleDefaultPropertyCount): New class for tracking a prediction about object allocation: structure, inline capacity, allocator to use. * bytecode/Opcode.h: (JSC): (JSC::padOpcodeName): Updated instruction sizes. * bytecode/UnlinkedCodeBlock.cpp: (JSC::UnlinkedCodeBlock::UnlinkedCodeBlock): * bytecode/UnlinkedCodeBlock.h: (JSC): (JSC::UnlinkedCodeBlock::addObjectAllocationProfile): (JSC::UnlinkedCodeBlock::numberOfObjectAllocationProfiles): (UnlinkedCodeBlock): Unlinked support for allocation profiles. * bytecompiler/BytecodeGenerator.cpp: (JSC::BytecodeGenerator::generate): Kill all remaining analyses at the end of codegen, since this is our last opportunity. (JSC::BytecodeGenerator::BytecodeGenerator): Added a static property analyzer to bytecode generation. It tracks initializing assignments and makes a guess about how many will happen. (JSC::BytecodeGenerator::newObjectAllocationProfile): (JSC): (JSC::BytecodeGenerator::emitProfiledOpcode): (JSC::BytecodeGenerator::emitMove): (JSC::BytecodeGenerator::emitResolve): (JSC::BytecodeGenerator::emitResolveBase): (JSC::BytecodeGenerator::emitResolveBaseForPut): (JSC::BytecodeGenerator::emitResolveWithBaseForPut): (JSC::BytecodeGenerator::emitResolveWithThis): (JSC::BytecodeGenerator::emitGetById): (JSC::BytecodeGenerator::emitPutById): (JSC::BytecodeGenerator::emitDirectPutById): (JSC::BytecodeGenerator::emitPutGetterSetter): (JSC::BytecodeGenerator::emitGetArgumentByVal): (JSC::BytecodeGenerator::emitGetByVal): Added hooks to the static property analyzer, so it can observe allocations and stores. (JSC::BytecodeGenerator::emitCreateThis): Factored this into a helper function because it was a significant amount of logic, and I wanted to add to it. (JSC::BytecodeGenerator::emitNewObject): (JSC::BytecodeGenerator::emitExpectedFunctionSnippet): (JSC::BytecodeGenerator::emitCall): (JSC::BytecodeGenerator::emitCallVarargs): (JSC::BytecodeGenerator::emitConstruct): Added a hook to profiled opcodes to track their stores, in case a store kills a profiled allocation. Since profiled opcodes are basically the only interesting stores we do, this is a convenient place to notice any store that might kill an allocation. * bytecompiler/BytecodeGenerator.h: (BytecodeGenerator): As above. * bytecompiler/StaticPropertyAnalysis.h: Added. (JSC): (StaticPropertyAnalysis): (JSC::StaticPropertyAnalysis::create): (JSC::StaticPropertyAnalysis::addPropertyIndex): (JSC::StaticPropertyAnalysis::record): (JSC::StaticPropertyAnalysis::propertyIndexCount): (JSC::StaticPropertyAnalysis::StaticPropertyAnalysis): Simple helper class for tracking allocations and stores. * bytecompiler/StaticPropertyAnalyzer.h: Added. (StaticPropertyAnalyzer): (JSC::StaticPropertyAnalyzer::StaticPropertyAnalyzer): (JSC::StaticPropertyAnalyzer::createThis): (JSC::StaticPropertyAnalyzer::newObject): (JSC::StaticPropertyAnalyzer::putById): (JSC::StaticPropertyAnalyzer::mov): (JSC::StaticPropertyAnalyzer::kill): Helper class for observing allocations and stores and making an inline capacity guess. The heuristics here are intentionally minimal because we don't want this one class to try to re-create something like a DFG or a runtime analysis. If we discover that we need those kinds of analyses, we should just replace this class with something else. This class tracks multiple registers that alias the same object -- that happens a lot, when moving locals into temporary registers -- but it doesn't track control flow or multiple objects that alias the same register. * dfg/DFGAbstractState.cpp: (JSC::DFG::AbstractState::execute): Updated for rename. * dfg/DFGByteCodeParser.cpp: (JSC::DFG::ByteCodeParser::parseBlock): Updated for inline capacity and allocation profile. * dfg/DFGNode.h: (JSC::DFG::Node::hasInlineCapacity): (Node): (JSC::DFG::Node::inlineCapacity): (JSC::DFG::Node::hasFunction): Give the graph a good way to represent inline capacity for an allocation. * dfg/DFGNodeType.h: (DFG): Updated for rename. * dfg/DFGOperations.cpp: Updated for interface change. * dfg/DFGOperations.h: We pass the inline capacity to the slow case as an argument. This is the simplest way, since it's stored as a bytecode operand. * dfg/DFGPredictionPropagationPhase.cpp: (JSC::DFG::PredictionPropagationPhase::propagate): Updated for rename. * dfg/DFGRepatch.cpp: (JSC::DFG::tryCacheGetByID): Fixed a horrible off-by-one-half bug that only appears when doing an inline cached load for property number 64 on a 32-bit system. In JSVALUE32_64 land, "offsetRelativeToPatchedStorage" is the offset of the 64bit JSValue -- but we'll actually issue two loads, one for the payload at that offset, and one for the tag at that offset + 4. We need to ensure that both loads have a compact representation, or we'll corrupt the instruction stream. * dfg/DFGSpeculativeJIT.cpp: (JSC::DFG::SpeculativeJIT::emitAllocateJSArray): * dfg/DFGSpeculativeJIT.h: (JSC::DFG::SpeculativeJIT::callOperation): (JSC::DFG::SpeculativeJIT::emitAllocateBasicStorage): (SpeculativeJIT): (JSC::DFG::SpeculativeJIT::emitAllocateJSObject): * dfg/DFGSpeculativeJIT32_64.cpp: (JSC::DFG::SpeculativeJIT::compile): * dfg/DFGSpeculativeJIT64.cpp: (JSC::DFG::SpeculativeJIT::compile): Lots of refactoring to support passing an allocator to our allocation function, and/or passing a Structure as a register instead of an immediate. * heap/MarkedAllocator.h: (DFG): (MarkedAllocator): (JSC::MarkedAllocator::offsetOfFreeListHead): Added an accessor to simplify JIT code generation of allocation from an arbitrary allocator. * jit/JIT.h: (JSC): * jit/JITInlines.h: (JSC): (JSC::JIT::emitAllocateJSObject): * jit/JITOpcodes.cpp: (JSC::JIT::emit_op_new_object): (JSC::JIT::emitSlow_op_new_object): (JSC::JIT::emit_op_create_this): (JSC::JIT::emitSlow_op_create_this): * jit/JITOpcodes32_64.cpp: (JSC::JIT::emit_op_new_object): (JSC::JIT::emitSlow_op_new_object): (JSC::JIT::emit_op_create_this): (JSC::JIT::emitSlow_op_create_this): Same refactoring as done for the DFG. * jit/JITStubs.cpp: (JSC::tryCacheGetByID): Fixed the same bug mentioned above. (JSC::DEFINE_STUB_FUNCTION): Updated for interface changes. * llint/LLIntData.cpp: (JSC::LLInt::Data::performAssertions): Updated for interface changes. * llint/LLIntSlowPaths.cpp: (JSC::LLInt::LLINT_SLOW_PATH_DECL): * llint/LowLevelInterpreter.asm: * llint/LowLevelInterpreter32_64.asm: * llint/LowLevelInterpreter64.asm: Same refactoring as for the JITs. * profiler/ProfilerBytecode.cpp: * profiler/ProfilerBytecodes.cpp: * profiler/ProfilerCompilation.cpp: * profiler/ProfilerCompiledBytecode.cpp: * profiler/ProfilerDatabase.cpp: * profiler/ProfilerOSRExit.cpp: * profiler/ProfilerOrigin.cpp: * profiler/ProfilerProfiledBytecodes.cpp: Include ObjectConstructor.h because that's where createEmptyObject() lives now. * runtime/Executable.h: (JSC::JSFunction::JSFunction): Updated for rename. * runtime/JSCellInlines.h: (JSC::allocateCell): Updated to match the allocator selection code in the JIT, so it's clearer that both are correct. * runtime/JSFunction.cpp: (JSC::JSFunction::JSFunction): (JSC::JSFunction::createAllocationProfile): (JSC::JSFunction::visitChildren): (JSC::JSFunction::getOwnPropertySlot): (JSC::JSFunction::put): (JSC::JSFunction::defineOwnProperty): (JSC::JSFunction::getConstructData): * runtime/JSFunction.h: (JSC::JSFunction::offsetOfScopeChain): (JSC::JSFunction::offsetOfExecutable): (JSC::JSFunction::offsetOfAllocationProfile): (JSC::JSFunction::allocationProfile): (JSFunction): (JSC::JSFunction::tryGetAllocationProfile): (JSC::JSFunction::addAllocationProfileWatchpoint): Changed inheritorID data member to be an ObjectAllocationProfile, which includes a pointer to the desired allocator. This simplifies JIT code, since we don't have to compute the allocator on the fly. I verified by code inspection that JSFunction is still only 64 bytes. * runtime/JSGlobalObject.cpp: (JSC::JSGlobalObject::reset): (JSC::JSGlobalObject::visitChildren): * runtime/JSGlobalObject.h: (JSGlobalObject): (JSC::JSGlobalObject::dateStructure): No direct pointer to the empty object structure anymore, because now clients need to specify how much inline capacity they want. * runtime/JSONObject.cpp: * runtime/JSObject.h: (JSC): (JSFinalObject): (JSC::JSFinalObject::defaultInlineCapacity): (JSC::JSFinalObject::maxInlineCapacity): (JSC::JSFinalObject::createStructure): A little refactoring to try to clarify where some of these constants derive from. (JSC::maxOffsetRelativeToPatchedStorage): Used for bug fix, above. * runtime/JSProxy.cpp: (JSC::JSProxy::setTarget): Ugly, but effective. * runtime/LiteralParser.cpp: * runtime/ObjectConstructor.cpp: (JSC::constructObject): (JSC::constructWithObjectConstructor): (JSC::callObjectConstructor): (JSC::objectConstructorCreate): Updated for interface changes. * runtime/ObjectConstructor.h: (JSC::constructEmptyObject): Clarified your options for how to allocate an empty object, to emphasize what things can actually vary. * runtime/PropertyOffset.h: These constants have moved because they're really higher level concepts to do with the layout of objects and the collector. PropertyOffset is just an abstract number line, independent of those things. * runtime/PrototypeMap.cpp: (JSC::PrototypeMap::emptyObjectStructureForPrototype): (JSC::PrototypeMap::clearEmptyObjectStructureForPrototype): * runtime/PrototypeMap.h: (PrototypeMap): The map key is now a pair of prototype and inline capacity, since Structure encodes inline capacity. * runtime/Structure.cpp: (JSC::Structure::Structure): (JSC::Structure::materializePropertyMap): (JSC::Structure::addPropertyTransition): (JSC::Structure::nonPropertyTransition): (JSC::Structure::copyPropertyTableForPinning): * runtime/Structure.h: (Structure): (JSC::Structure::totalStorageSize): (JSC::Structure::transitionCount): (JSC::Structure::create): Fixed a nasty refactoring bug that only shows up after enabling variable-sized inline capacities: we were passing our type info where our inline capacity was expected. The compiler didn't notice because both have type int :(. ../WebCore: * ForwardingHeaders/runtime/ObjectConstructor.h: Added. * bindings/js/JSInjectedScriptHostCustom.cpp: * bindings/js/JSSQLResultSetRowListCustom.cpp: Include ObjectConstructor.h because that's where createEmptyObject() is located now. * bindings/js/SerializedScriptValue.cpp: (WebCore::CloneDeserializer::deserialize): Updated for interface change. Canonical link: https://commits.webkit.org/126355@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@141050 268f45cc-cd09-0410-ab3c-d52691b4dbfc
1 parent 5f93abc commit 1d8fa71

71 files changed

Lines changed: 1240 additions & 336 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎Source/JavaScriptCore/API/JSObjectRef.cpp‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@
4848
#include "JSRetainPtr.h"
4949
#include "JSString.h"
5050
#include "JSValueRef.h"
51+
#include "ObjectConstructor.h"
5152
#include "ObjectPrototype.h"
5253
#include "Operations.h"
5354
#include "PropertyNameArray.h"

‎Source/JavaScriptCore/ChangeLog‎

Lines changed: 309 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,312 @@
1+
2013-01-28 Geoffrey Garen <ggaren@apple.com>
2+
3+
Static size inference for JavaScript objects
4+
https://bugs.webkit.org/show_bug.cgi?id=108093
5+
6+
Reviewed by Phil Pizlo.
7+
8+
* API/JSObjectRef.cpp:
9+
* JavaScriptCore.order:
10+
* JavaScriptCore.xcodeproj/project.pbxproj: Pay the tax man.
11+
12+
* bytecode/CodeBlock.cpp:
13+
(JSC::CodeBlock::dumpBytecode): op_new_object and op_create_this now
14+
have an extra inferredInlineCapacity argument. This is the statically
15+
inferred inline capacity, just from analyzing source text. op_new_object
16+
also gets a pointer to an allocation profile. (For op_create_this, the
17+
profile is in the construtor function.)
18+
19+
(JSC::CodeBlock::CodeBlock): Link op_new_object.
20+
21+
(JSC::CodeBlock::stronglyVisitStrongReferences): Mark our profiles.
22+
23+
* bytecode/CodeBlock.h:
24+
(CodeBlock): Removed some dead code. Added object allocation profiles.
25+
26+
* bytecode/Instruction.h:
27+
(JSC): New union type, since an instruction operand may point to an
28+
object allocation profile now.
29+
30+
* bytecode/ObjectAllocationProfile.h: Added.
31+
(JSC):
32+
(ObjectAllocationProfile):
33+
(JSC::ObjectAllocationProfile::offsetOfAllocator):
34+
(JSC::ObjectAllocationProfile::offsetOfStructure):
35+
(JSC::ObjectAllocationProfile::ObjectAllocationProfile):
36+
(JSC::ObjectAllocationProfile::isNull):
37+
(JSC::ObjectAllocationProfile::initialize):
38+
(JSC::ObjectAllocationProfile::structure):
39+
(JSC::ObjectAllocationProfile::inlineCapacity):
40+
(JSC::ObjectAllocationProfile::clear):
41+
(JSC::ObjectAllocationProfile::visitAggregate):
42+
(JSC::ObjectAllocationProfile::possibleDefaultPropertyCount): New class
43+
for tracking a prediction about object allocation: structure, inline
44+
capacity, allocator to use.
45+
46+
* bytecode/Opcode.h:
47+
(JSC):
48+
(JSC::padOpcodeName): Updated instruction sizes.
49+
50+
* bytecode/UnlinkedCodeBlock.cpp:
51+
(JSC::UnlinkedCodeBlock::UnlinkedCodeBlock):
52+
* bytecode/UnlinkedCodeBlock.h:
53+
(JSC):
54+
(JSC::UnlinkedCodeBlock::addObjectAllocationProfile):
55+
(JSC::UnlinkedCodeBlock::numberOfObjectAllocationProfiles):
56+
(UnlinkedCodeBlock): Unlinked support for allocation profiles.
57+
58+
* bytecompiler/BytecodeGenerator.cpp:
59+
(JSC::BytecodeGenerator::generate): Kill all remaining analyses at the
60+
end of codegen, since this is our last opportunity.
61+
62+
(JSC::BytecodeGenerator::BytecodeGenerator): Added a static property
63+
analyzer to bytecode generation. It tracks initializing assignments and
64+
makes a guess about how many will happen.
65+
66+
(JSC::BytecodeGenerator::newObjectAllocationProfile):
67+
(JSC):
68+
(JSC::BytecodeGenerator::emitProfiledOpcode):
69+
(JSC::BytecodeGenerator::emitMove):
70+
(JSC::BytecodeGenerator::emitResolve):
71+
(JSC::BytecodeGenerator::emitResolveBase):
72+
(JSC::BytecodeGenerator::emitResolveBaseForPut):
73+
(JSC::BytecodeGenerator::emitResolveWithBaseForPut):
74+
(JSC::BytecodeGenerator::emitResolveWithThis):
75+
(JSC::BytecodeGenerator::emitGetById):
76+
(JSC::BytecodeGenerator::emitPutById):
77+
(JSC::BytecodeGenerator::emitDirectPutById):
78+
(JSC::BytecodeGenerator::emitPutGetterSetter):
79+
(JSC::BytecodeGenerator::emitGetArgumentByVal):
80+
(JSC::BytecodeGenerator::emitGetByVal): Added hooks to the static property
81+
analyzer, so it can observe allocations and stores.
82+
83+
(JSC::BytecodeGenerator::emitCreateThis): Factored this into a helper
84+
function because it was a significant amount of logic, and I wanted to
85+
add to it.
86+
87+
(JSC::BytecodeGenerator::emitNewObject):
88+
(JSC::BytecodeGenerator::emitExpectedFunctionSnippet):
89+
(JSC::BytecodeGenerator::emitCall):
90+
(JSC::BytecodeGenerator::emitCallVarargs):
91+
(JSC::BytecodeGenerator::emitConstruct): Added a hook to profiled opcodes
92+
to track their stores, in case a store kills a profiled allocation. Since
93+
profiled opcodes are basically the only interesting stores we do, this
94+
is a convenient place to notice any store that might kill an allocation.
95+
96+
* bytecompiler/BytecodeGenerator.h:
97+
(BytecodeGenerator): As above.
98+
99+
* bytecompiler/StaticPropertyAnalysis.h: Added.
100+
(JSC):
101+
(StaticPropertyAnalysis):
102+
(JSC::StaticPropertyAnalysis::create):
103+
(JSC::StaticPropertyAnalysis::addPropertyIndex):
104+
(JSC::StaticPropertyAnalysis::record):
105+
(JSC::StaticPropertyAnalysis::propertyIndexCount):
106+
(JSC::StaticPropertyAnalysis::StaticPropertyAnalysis): Simple helper
107+
class for tracking allocations and stores.
108+
109+
* bytecompiler/StaticPropertyAnalyzer.h: Added.
110+
(StaticPropertyAnalyzer):
111+
(JSC::StaticPropertyAnalyzer::StaticPropertyAnalyzer):
112+
(JSC::StaticPropertyAnalyzer::createThis):
113+
(JSC::StaticPropertyAnalyzer::newObject):
114+
(JSC::StaticPropertyAnalyzer::putById):
115+
(JSC::StaticPropertyAnalyzer::mov):
116+
(JSC::StaticPropertyAnalyzer::kill): Helper class for observing allocations
117+
and stores and making an inline capacity guess. The heuristics here are
118+
intentionally minimal because we don't want this one class to try to
119+
re-create something like a DFG or a runtime analysis. If we discover that
120+
we need those kinds of analyses, we should just replace this class with
121+
something else.
122+
123+
This class tracks multiple registers that alias the same object -- that
124+
happens a lot, when moving locals into temporary registers -- but it
125+
doesn't track control flow or multiple objects that alias the same register.
126+
127+
* dfg/DFGAbstractState.cpp:
128+
(JSC::DFG::AbstractState::execute): Updated for rename.
129+
130+
* dfg/DFGByteCodeParser.cpp:
131+
(JSC::DFG::ByteCodeParser::parseBlock): Updated for inline capacity and
132+
allocation profile.
133+
134+
* dfg/DFGNode.h:
135+
(JSC::DFG::Node::hasInlineCapacity):
136+
(Node):
137+
(JSC::DFG::Node::inlineCapacity):
138+
(JSC::DFG::Node::hasFunction): Give the graph a good way to represent
139+
inline capacity for an allocation.
140+
141+
* dfg/DFGNodeType.h:
142+
(DFG): Updated for rename.
143+
144+
* dfg/DFGOperations.cpp: Updated for interface change.
145+
146+
* dfg/DFGOperations.h: We pass the inline capacity to the slow case as
147+
an argument. This is the simplest way, since it's stored as a bytecode operand.
148+
149+
* dfg/DFGPredictionPropagationPhase.cpp:
150+
(JSC::DFG::PredictionPropagationPhase::propagate): Updated for rename.
151+
152+
* dfg/DFGRepatch.cpp:
153+
(JSC::DFG::tryCacheGetByID): Fixed a horrible off-by-one-half bug that only
154+
appears when doing an inline cached load for property number 64 on a 32-bit
155+
system. In JSVALUE32_64 land, "offsetRelativeToPatchedStorage" is the
156+
offset of the 64bit JSValue -- but we'll actually issue two loads, one for
157+
the payload at that offset, and one for the tag at that offset + 4. We need
158+
to ensure that both loads have a compact representation, or we'll corrupt
159+
the instruction stream.
160+
161+
* dfg/DFGSpeculativeJIT.cpp:
162+
(JSC::DFG::SpeculativeJIT::emitAllocateJSArray):
163+
* dfg/DFGSpeculativeJIT.h:
164+
(JSC::DFG::SpeculativeJIT::callOperation):
165+
(JSC::DFG::SpeculativeJIT::emitAllocateBasicStorage):
166+
(SpeculativeJIT):
167+
(JSC::DFG::SpeculativeJIT::emitAllocateJSObject):
168+
* dfg/DFGSpeculativeJIT32_64.cpp:
169+
(JSC::DFG::SpeculativeJIT::compile):
170+
* dfg/DFGSpeculativeJIT64.cpp:
171+
(JSC::DFG::SpeculativeJIT::compile): Lots of refactoring to support
172+
passing an allocator to our allocation function, and/or passing a Structure
173+
as a register instead of an immediate.
174+
175+
* heap/MarkedAllocator.h:
176+
(DFG):
177+
(MarkedAllocator):
178+
(JSC::MarkedAllocator::offsetOfFreeListHead): Added an accessor to simplify
179+
JIT code generation of allocation from an arbitrary allocator.
180+
181+
* jit/JIT.h:
182+
(JSC):
183+
* jit/JITInlines.h:
184+
(JSC):
185+
(JSC::JIT::emitAllocateJSObject):
186+
* jit/JITOpcodes.cpp:
187+
(JSC::JIT::emit_op_new_object):
188+
(JSC::JIT::emitSlow_op_new_object):
189+
(JSC::JIT::emit_op_create_this):
190+
(JSC::JIT::emitSlow_op_create_this):
191+
* jit/JITOpcodes32_64.cpp:
192+
(JSC::JIT::emit_op_new_object):
193+
(JSC::JIT::emitSlow_op_new_object):
194+
(JSC::JIT::emit_op_create_this):
195+
(JSC::JIT::emitSlow_op_create_this): Same refactoring as done for the DFG.
196+
197+
* jit/JITStubs.cpp:
198+
(JSC::tryCacheGetByID): Fixed the same bug mentioned above.
199+
200+
(JSC::DEFINE_STUB_FUNCTION): Updated for interface changes.
201+
202+
* llint/LLIntData.cpp:
203+
(JSC::LLInt::Data::performAssertions): Updated for interface changes.
204+
205+
* llint/LLIntSlowPaths.cpp:
206+
(JSC::LLInt::LLINT_SLOW_PATH_DECL):
207+
* llint/LowLevelInterpreter.asm:
208+
* llint/LowLevelInterpreter32_64.asm:
209+
* llint/LowLevelInterpreter64.asm: Same refactoring as for the JITs.
210+
211+
* profiler/ProfilerBytecode.cpp:
212+
* profiler/ProfilerBytecodes.cpp:
213+
* profiler/ProfilerCompilation.cpp:
214+
* profiler/ProfilerCompiledBytecode.cpp:
215+
* profiler/ProfilerDatabase.cpp:
216+
* profiler/ProfilerOSRExit.cpp:
217+
* profiler/ProfilerOrigin.cpp:
218+
* profiler/ProfilerProfiledBytecodes.cpp: Include ObjectConstructor.h
219+
because that's where createEmptyObject() lives now.
220+
221+
* runtime/Executable.h:
222+
(JSC::JSFunction::JSFunction): Updated for rename.
223+
224+
* runtime/JSCellInlines.h:
225+
(JSC::allocateCell): Updated to match the allocator selection code in
226+
the JIT, so it's clearer that both are correct.
227+
228+
* runtime/JSFunction.cpp:
229+
(JSC::JSFunction::JSFunction):
230+
(JSC::JSFunction::createAllocationProfile):
231+
(JSC::JSFunction::visitChildren):
232+
(JSC::JSFunction::getOwnPropertySlot):
233+
(JSC::JSFunction::put):
234+
(JSC::JSFunction::defineOwnProperty):
235+
(JSC::JSFunction::getConstructData):
236+
* runtime/JSFunction.h:
237+
(JSC::JSFunction::offsetOfScopeChain):
238+
(JSC::JSFunction::offsetOfExecutable):
239+
(JSC::JSFunction::offsetOfAllocationProfile):
240+
(JSC::JSFunction::allocationProfile):
241+
(JSFunction):
242+
(JSC::JSFunction::tryGetAllocationProfile):
243+
(JSC::JSFunction::addAllocationProfileWatchpoint): Changed inheritorID
244+
data member to be an ObjectAllocationProfile, which includes a pointer
245+
to the desired allocator. This simplifies JIT code, since we don't have
246+
to compute the allocator on the fly. I verified by code inspection that
247+
JSFunction is still only 64 bytes.
248+
249+
* runtime/JSGlobalObject.cpp:
250+
(JSC::JSGlobalObject::reset):
251+
(JSC::JSGlobalObject::visitChildren):
252+
* runtime/JSGlobalObject.h:
253+
(JSGlobalObject):
254+
(JSC::JSGlobalObject::dateStructure): No direct pointer to the empty
255+
object structure anymore, because now clients need to specify how much
256+
inline capacity they want.
257+
258+
* runtime/JSONObject.cpp:
259+
* runtime/JSObject.h:
260+
(JSC):
261+
(JSFinalObject):
262+
(JSC::JSFinalObject::defaultInlineCapacity):
263+
(JSC::JSFinalObject::maxInlineCapacity):
264+
(JSC::JSFinalObject::createStructure): A little refactoring to try to
265+
clarify where some of these constants derive from.
266+
267+
(JSC::maxOffsetRelativeToPatchedStorage): Used for bug fix, above.
268+
269+
* runtime/JSProxy.cpp:
270+
(JSC::JSProxy::setTarget): Ugly, but effective.
271+
272+
* runtime/LiteralParser.cpp:
273+
* runtime/ObjectConstructor.cpp:
274+
(JSC::constructObject):
275+
(JSC::constructWithObjectConstructor):
276+
(JSC::callObjectConstructor):
277+
(JSC::objectConstructorCreate): Updated for interface changes.
278+
279+
* runtime/ObjectConstructor.h:
280+
(JSC::constructEmptyObject): Clarified your options for how to allocate
281+
an empty object, to emphasize what things can actually vary.
282+
283+
* runtime/PropertyOffset.h: These constants have moved because they're
284+
really higher level concepts to do with the layout of objects and the
285+
collector. PropertyOffset is just an abstract number line, independent
286+
of those things.
287+
288+
* runtime/PrototypeMap.cpp:
289+
(JSC::PrototypeMap::emptyObjectStructureForPrototype):
290+
(JSC::PrototypeMap::clearEmptyObjectStructureForPrototype):
291+
* runtime/PrototypeMap.h:
292+
(PrototypeMap): The map key is now a pair of prototype and inline capacity,
293+
since Structure encodes inline capacity.
294+
295+
* runtime/Structure.cpp:
296+
(JSC::Structure::Structure):
297+
(JSC::Structure::materializePropertyMap):
298+
(JSC::Structure::addPropertyTransition):
299+
(JSC::Structure::nonPropertyTransition):
300+
(JSC::Structure::copyPropertyTableForPinning):
301+
* runtime/Structure.h:
302+
(Structure):
303+
(JSC::Structure::totalStorageSize):
304+
(JSC::Structure::transitionCount):
305+
(JSC::Structure::create): Fixed a nasty refactoring bug that only shows
306+
up after enabling variable-sized inline capacities: we were passing our
307+
type info where our inline capacity was expected. The compiler didn't
308+
notice because both have type int :(.
309+
1310
2013-01-28 Oliver Hunt <oliver@apple.com>
2311

3312
Add more assertions to the property storage use in arrays

‎Source/JavaScriptCore/JavaScriptCore.order‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,6 @@ __ZN3JSC16NativeExecutable6createERNS_12JSGlobalDataENS_21MacroAssemblerCodePtrE
233233
__ZN3JSC8JSObject34putDirectFunctionWithoutTransitionEPNS_9ExecStateEPNS_10JSFunctionEj
234234
__ZN3JSC10JSFunction4nameEPNS_9ExecStateE
235235
__ZN3JSC15ObjectPrototypeC1EPNS_9ExecStateEPNS_14JSGlobalObjectEPNS_9StructureE
236-
__ZN3JSC8JSObject17createInheritorIDERNS_12JSGlobalDataE
237236
__ZN3JSC14ArrayPrototypeC1EPNS_14JSGlobalObjectEPNS_9StructureE
238237
__ZN3JSC7JSArrayC2ERNS_12JSGlobalDataEPNS_9StructureE
239238
__ZN3JSC15StringPrototypeC1EPNS_9ExecStateEPNS_14JSGlobalObjectEPNS_9StructureE

‎Source/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreExports.def‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ EXPORTS
2727
??0SHA1@WTF@@QAE@XZ
2828
??0StringObject@JSC@@IAE@AAVJSGlobalData@1@PAVStructure@1@@Z
2929
??0StringPrintStream@WTF@@QAE@XZ
30-
??0Structure@JSC@@AAE@AAVJSGlobalData@1@PAVJSGlobalObject@1@VJSValue@1@ABVTypeInfo@1@PBUClassInfo@1@EH@Z
30+
??0Structure@JSC@@AAE@AAVJSGlobalData@1@PAVJSGlobalObject@1@VJSValue@1@ABVTypeInfo@1@PBUClassInfo@1@EI@Z
3131
??0ThreadCondition@WTF@@QAE@XZ
3232
??0WTFThreadData@WTF@@QAE@XZ
3333
??0WrapperBase@MemoryInstrumentation@WTF@@QAE@PBDPBX@Z
@@ -195,6 +195,7 @@ EXPORTS
195195
?dumpSampleData@JSGlobalData@JSC@@QAEXPAVExecState@2@@Z
196196
?EcmaScriptConverter@DoubleToStringConverter@double_conversion@WTF@@SAABV123@XZ
197197
?empty@StringImpl@WTF@@SAPAV12@XZ
198+
?emptyObjectStructureForPrototype@PrototypeMap@JSC@@QAEPAVStructure@2@PAVJSObject@2@I@Z
198199
?enumerable@PropertyDescriptor@JSC@@QBE_NXZ
199200
?equalUTF16WithUTF8@Unicode@WTF@@YA_NPB_W0PBD1@Z
200201
?evaluate@DebuggerCallFrame@JSC@@QBE?AVJSValue@2@ABVString@WTF@@AAV32@@Z

0 commit comments

Comments
 (0)