<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[172402] trunk/Source/JavaScriptCore</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/172402">172402</a></dd>
<dt>Author</dt> <dd>burg@cs.washington.edu</dd>
<dt>Date</dt> <dd>2014-08-11 12:19:47 -0700 (Mon, 11 Aug 2014)</dd>
</dl>
<h3>Log Message</h3>
<pre>Web Inspector: use type builders to construct high fidelity type information payloads
https://bugs.webkit.org/show_bug.cgi?id=135803
Reviewed by Timothy Hatcher.
Due to some typos in the protocol file, the code had worked with raw objects
rather than with type builders. Convert to using builders.
* inspector/agents/InspectorRuntimeAgent.cpp:
(Inspector::InspectorRuntimeAgent::getRuntimeTypesForVariablesAtOffsets):
* inspector/agents/InspectorRuntimeAgent.h:
* inspector/protocol/Runtime.json: Fix 'item' for 'items'; true for 'true'.
* runtime/HighFidelityTypeProfiler.cpp:
(JSC::HighFidelityTypeProfiler::getTypesForVariableAtOffsetForInspector):
* runtime/HighFidelityTypeProfiler.h:
* runtime/TypeSet.cpp:
(JSC::TypeSet::allStructureRepresentations):
(JSC::StructureShape::stringRepresentation):
(JSC::StructureShape::inspectorRepresentation):
* runtime/TypeSet.h:</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceJavaScriptCoreChangeLog">trunk/Source/JavaScriptCore/ChangeLog</a></li>
<li><a href="#trunkSourceJavaScriptCoreinspectoragentsInspectorRuntimeAgentcpp">trunk/Source/JavaScriptCore/inspector/agents/InspectorRuntimeAgent.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreinspectoragentsInspectorRuntimeAgenth">trunk/Source/JavaScriptCore/inspector/agents/InspectorRuntimeAgent.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreinspectorprotocolRuntimejson">trunk/Source/JavaScriptCore/inspector/protocol/Runtime.json</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeHighFidelityTypeProfilercpp">trunk/Source/JavaScriptCore/runtime/HighFidelityTypeProfiler.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeHighFidelityTypeProfilerh">trunk/Source/JavaScriptCore/runtime/HighFidelityTypeProfiler.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeTypeSetcpp">trunk/Source/JavaScriptCore/runtime/TypeSet.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeTypeSeth">trunk/Source/JavaScriptCore/runtime/TypeSet.h</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceJavaScriptCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/ChangeLog (172401 => 172402)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/ChangeLog        2014-08-11 18:59:44 UTC (rev 172401)
+++ trunk/Source/JavaScriptCore/ChangeLog        2014-08-11 19:19:47 UTC (rev 172402)
</span><span class="lines">@@ -1,3 +1,26 @@
</span><ins>+2014-08-11 Brian J. Burg <burg@cs.washington.edu>
+
+ Web Inspector: use type builders to construct high fidelity type information payloads
+ https://bugs.webkit.org/show_bug.cgi?id=135803
+
+ Reviewed by Timothy Hatcher.
+
+ Due to some typos in the protocol file, the code had worked with raw objects
+ rather than with type builders. Convert to using builders.
+
+ * inspector/agents/InspectorRuntimeAgent.cpp:
+ (Inspector::InspectorRuntimeAgent::getRuntimeTypesForVariablesAtOffsets):
+ * inspector/agents/InspectorRuntimeAgent.h:
+ * inspector/protocol/Runtime.json: Fix 'item' for 'items'; true for 'true'.
+ * runtime/HighFidelityTypeProfiler.cpp:
+ (JSC::HighFidelityTypeProfiler::getTypesForVariableAtOffsetForInspector):
+ * runtime/HighFidelityTypeProfiler.h:
+ * runtime/TypeSet.cpp:
+ (JSC::TypeSet::allStructureRepresentations):
+ (JSC::StructureShape::stringRepresentation):
+ (JSC::StructureShape::inspectorRepresentation):
+ * runtime/TypeSet.h:
+
</ins><span class="cx"> 2014-08-11 Mark Hahnenberg <mhahnenberg@apple.com>
</span><span class="cx">
</span><span class="cx"> for-in optimization should also make sure the base matches the object being iterated
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreinspectoragentsInspectorRuntimeAgentcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/inspector/agents/InspectorRuntimeAgent.cpp (172401 => 172402)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/agents/InspectorRuntimeAgent.cpp        2014-08-11 18:59:44 UTC (rev 172401)
+++ trunk/Source/JavaScriptCore/inspector/agents/InspectorRuntimeAgent.cpp        2014-08-11 19:19:47 UTC (rev 172402)
</span><span class="lines">@@ -194,19 +194,19 @@
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void InspectorRuntimeAgent::getRuntimeTypesForVariablesAtOffsets(ErrorString* errorString, const RefPtr<Inspector::InspectorArray>& in_locations, RefPtr<Inspector::InspectorArray>& out_types)
</del><ins>+void InspectorRuntimeAgent::getRuntimeTypesForVariablesAtOffsets(ErrorString* errorString, const RefPtr<Inspector::InspectorArray>& locations, RefPtr<Inspector::TypeBuilder::Array<Inspector::TypeBuilder::Runtime::TypeDescription>>& typeDescriptions)
</ins><span class="cx"> {
</span><span class="cx"> static const bool verbose = false;
</span><span class="cx"> VM& vm = globalVM();
</span><del>- out_types = Inspector::InspectorArray::create();
</del><ins>+ typeDescriptions = Inspector::TypeBuilder::Array<Inspector::TypeBuilder::Runtime::TypeDescription>::create();
</ins><span class="cx"> if (!vm.isProfilingTypesWithHighFidelity())
</span><span class="cx"> return;
</span><span class="cx">
</span><span class="cx"> double start = currentTimeMS();
</span><span class="cx"> vm.highFidelityLog()->processHighFidelityLog("User Query");
</span><span class="cx">
</span><del>- for (size_t i = 0; i < in_locations->length(); i++) {
- RefPtr<Inspector::InspectorValue> value = in_locations->get(i);
</del><ins>+ for (size_t i = 0; i < locations->length(); i++) {
+ RefPtr<Inspector::InspectorValue> value = locations->get(i);
</ins><span class="cx"> RefPtr<InspectorObject> location;
</span><span class="cx"> if (!value->asObject(&location)) {
</span><span class="cx"> *errorString = ASCIILiteral("Array of TypeLocation objects has an object that does not have type of TypeLocation.");
</span><span class="lines">@@ -219,11 +219,11 @@
</span><span class="cx"> location->getNumber(ASCIILiteral("typeInformationDescriptor"), &descriptor);
</span><span class="cx"> location->getString(ASCIILiteral("sourceID"), &sourceIDAsString);
</span><span class="cx"> location->getNumber(ASCIILiteral("divot"), &divot);
</span><del>-
- RefPtr<Inspector::InspectorObject> typeDescription = Inspector::InspectorObject::create();
</del><ins>+
+ RefPtr<Inspector::TypeBuilder::Runtime::TypeDescription> typeDescription = Inspector::TypeBuilder::Runtime::TypeDescription::create();
</ins><span class="cx"> bool okay;
</span><span class="cx"> vm.highFidelityTypeProfiler()->getTypesForVariableAtOffsetForInspector(static_cast<TypeProfilerSearchDescriptor>(descriptor), divot, sourceIDAsString.toIntPtrStrict(&okay), typeDescription);
</span><del>- out_types->pushObject(typeDescription);
</del><ins>+ typeDescriptions->addItem(typeDescription);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> double end = currentTimeMS();
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreinspectoragentsInspectorRuntimeAgenth"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/inspector/agents/InspectorRuntimeAgent.h (172401 => 172402)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/agents/InspectorRuntimeAgent.h        2014-08-11 18:59:44 UTC (rev 172401)
+++ trunk/Source/JavaScriptCore/inspector/agents/InspectorRuntimeAgent.h        2014-08-11 19:19:47 UTC (rev 172402)
</span><span class="lines">@@ -66,7 +66,7 @@
</span><span class="cx"> virtual void getProperties(ErrorString*, const String& objectId, const bool* ownProperties, RefPtr<Inspector::TypeBuilder::Array<Inspector::TypeBuilder::Runtime::PropertyDescriptor>>& result, RefPtr<Inspector::TypeBuilder::Array<Inspector::TypeBuilder::Runtime::InternalPropertyDescriptor>>& internalProperties) override final;
</span><span class="cx"> virtual void releaseObjectGroup(ErrorString*, const String& objectGroup) override final;
</span><span class="cx"> virtual void run(ErrorString*) override;
</span><del>- virtual void getRuntimeTypesForVariablesAtOffsets(ErrorString*, const RefPtr<Inspector::InspectorArray>& in_locations, RefPtr<Inspector::InspectorArray>& out_types) override;
</del><ins>+ virtual void getRuntimeTypesForVariablesAtOffsets(ErrorString*, const RefPtr<Inspector::InspectorArray>& locations, RefPtr<Inspector::TypeBuilder::Array<Inspector::TypeBuilder::Runtime::TypeDescription>>&) override;
</ins><span class="cx">
</span><span class="cx"> void setScriptDebugServer(ScriptDebugServer* scriptDebugServer) { m_scriptDebugServer = scriptDebugServer; }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreinspectorprotocolRuntimejson"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/inspector/protocol/Runtime.json (172401 => 172402)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/protocol/Runtime.json        2014-08-11 18:59:44 UTC (rev 172401)
+++ trunk/Source/JavaScriptCore/inspector/protocol/Runtime.json        2014-08-11 19:19:47 UTC (rev 172402)
</span><span class="lines">@@ -116,9 +116,9 @@
</span><span class="cx"> "id": "StructureDescription",
</span><span class="cx"> "type": "object",
</span><span class="cx"> "properties": [
</span><del>- { "name": "fields", "type": "array", "items": { "type": "string" }, "description": "Array of strings, where the strings represent object properties." },
- { "name": "constructorName", "type": "string", "description": "Name of the constructor." },
- { "name": "prototypeStructure", "$ref": "StructureDescription", "optional": "true", "description": "Pointer to the StructureRepresentation of the protoype if one exists." }
</del><ins>+ { "name": "fields", "type": "array", "items": { "type": "string" }, "optional": true, "description": "Array of strings, where the strings represent object properties." },
+ { "name": "constructorName", "type": "string", "optional": true, "description": "Name of the constructor." },
+ { "name": "prototypeStructure", "$ref": "StructureDescription", "optional": true, "description": "Pointer to the StructureRepresentation of the protoype if one exists." }
</ins><span class="cx"> ]
</span><span class="cx"> },
</span><span class="cx"> {
</span><span class="lines">@@ -127,8 +127,8 @@
</span><span class="cx"> "description": "Container for type information that has been gathered.",
</span><span class="cx"> "properties": [
</span><span class="cx"> { "name": "displayTypeName", "type": "string", "optional": true, "description": "What the inspector should display as a simple type." },
</span><del>- { "name": "localPrimitiveTypeNames", "type": "array", "items": { "type": "string" }, "optional": "true", "description": "Array of type names for primtive types (int, string, etc) seen at an instruction" },
- { "name": "localObjectTypeNames", "type": "array", "items": { "type": "string" }, "optional": "true", "description": "Array of type names for all object seen at an instruction" },
</del><ins>+ { "name": "localPrimitiveTypeNames", "type": "array", "items": { "type": "string" }, "optional": true, "description": "Array of type names for primtive types (int, string, etc) seen at an instruction" },
+ { "name": "localObjectTypeNames", "type": "array", "items": { "type": "string" }, "optional": true, "description": "Array of type names for all object seen at an instruction" },
</ins><span class="cx"> { "name": "localStructures", "type": "array", "items": { "$ref": "StructureDescription" }, "optional": true, "description": "Array of descriptions for all structures seen at this this instruction." },
</span><span class="cx"> { "name": "globalPrimitiveTypeNames", "type": "array", "items": { "type": "string" }, "optional": true, "description": "Array of type names for all primitive types seen globally." },
</span><span class="cx"> { "name": "globalObjectTypeNames", "type": "array", "items": { "type": "string" }, "optional": true, "description": "Array of type names for all primitive types seen globally." },
</span><span class="lines">@@ -236,7 +236,7 @@
</span><span class="cx"> { "name": "locations", "type": "array", "items": { "$ref": "TypeLocation" }, "description": "An array of type locations we're requesting information for. Results are expected in the same order they're sent in."}
</span><span class="cx"> ],
</span><span class="cx"> "returns": [
</span><del>- { "name": "types", "type": "array", "item": { "$ref": "TypeDescription", "description": "Types for requested variable." } }
</del><ins>+ { "name": "types", "type": "array", "items": { "$ref": "TypeDescription", "description": "Types for requested variable." } }
</ins><span class="cx"> ],
</span><span class="cx"> "description": "Returns detailed informtation on given function."
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeHighFidelityTypeProfilercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/HighFidelityTypeProfiler.cpp (172401 => 172402)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/HighFidelityTypeProfiler.cpp        2014-08-11 18:59:44 UTC (rev 172401)
+++ trunk/Source/JavaScriptCore/runtime/HighFidelityTypeProfiler.cpp        2014-08-11 19:19:47 UTC (rev 172402)
</span><span class="lines">@@ -69,21 +69,21 @@
</span><span class="cx"> bucket.append(location);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void HighFidelityTypeProfiler::getTypesForVariableAtOffsetForInspector(TypeProfilerSearchDescriptor descriptor, unsigned divot, intptr_t sourceID, RefPtr<Inspector::InspectorObject>& ret)
</del><ins>+void HighFidelityTypeProfiler::getTypesForVariableAtOffsetForInspector(TypeProfilerSearchDescriptor descriptor, unsigned divot, intptr_t sourceID, RefPtr<Inspector::TypeBuilder::Runtime::TypeDescription>& description)
</ins><span class="cx"> {
</span><span class="cx"> TypeLocation* location = findLocation(divot, sourceID, descriptor);
</span><span class="cx"> if (!location)
</span><span class="cx"> return;
</span><span class="cx">
</span><span class="cx"> if (location->m_globalTypeSet && location->m_globalVariableID != HighFidelityNoGlobalIDExists) {
</span><del>- ret->setString(ASCIILiteral("displayTypeName"), location->m_globalTypeSet->displayName());
- ret->setArray(ASCIILiteral("globalPrimitiveTypeNames"), location->m_globalTypeSet->allPrimitiveTypeNames()->asArray());
- ret->setArray(ASCIILiteral("globalStructures"), location->m_globalTypeSet->allStructureRepresentations()->asArray());
</del><ins>+ description->setDisplayTypeName(location->m_globalTypeSet->displayName());
+ description->setGlobalPrimitiveTypeNames(location->m_globalTypeSet->allPrimitiveTypeNames());
+ description->setGlobalStructures(location->m_globalTypeSet->allStructureRepresentations());
</ins><span class="cx"> } else
</span><del>- ret->setString(ASCIILiteral("displayTypeName"), location->m_instructionTypeSet->displayName());
</del><ins>+ description->setDisplayTypeName(location->m_instructionTypeSet->displayName());
</ins><span class="cx">
</span><del>- ret->setArray(ASCIILiteral("localPrimitiveTypeNames"), location->m_instructionTypeSet->allPrimitiveTypeNames()->asArray());
- ret->setArray(ASCIILiteral("localStructures"), location->m_instructionTypeSet->allStructureRepresentations()->asArray());
</del><ins>+ description->setLocalPrimitiveTypeNames(location->m_instructionTypeSet->allPrimitiveTypeNames());
+ description->setLocalStructures(location->m_instructionTypeSet->allStructureRepresentations());
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> static bool descriptorMatchesTypeLocation(TypeProfilerSearchDescriptor descriptor, TypeLocation* location)
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeHighFidelityTypeProfilerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/HighFidelityTypeProfiler.h (172401 => 172402)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/HighFidelityTypeProfiler.h        2014-08-11 18:59:44 UTC (rev 172401)
+++ trunk/Source/JavaScriptCore/runtime/HighFidelityTypeProfiler.h        2014-08-11 19:19:47 UTC (rev 172402)
</span><span class="lines">@@ -36,9 +36,6 @@
</span><span class="cx"> namespace Inspector { namespace TypeBuilder { namespace Runtime {
</span><span class="cx"> class TypeDescription;
</span><span class="cx"> }}}
</span><del>-namespace Inspector {
-class InspectorObject;
-}
</del><span class="cx">
</span><span class="cx"> namespace JSC {
</span><span class="cx">
</span><span class="lines">@@ -99,7 +96,7 @@
</span><span class="cx"> class HighFidelityTypeProfiler {
</span><span class="cx"> public:
</span><span class="cx"> void logTypesForTypeLocation(TypeLocation*);
</span><del>- void getTypesForVariableAtOffsetForInspector(TypeProfilerSearchDescriptor descriptor, unsigned divot, intptr_t sourceID, RefPtr<Inspector::InspectorObject>&);
</del><ins>+ void getTypesForVariableAtOffsetForInspector(TypeProfilerSearchDescriptor descriptor, unsigned divot, intptr_t sourceID, RefPtr<Inspector::TypeBuilder::Runtime::TypeDescription>&);
</ins><span class="cx"> void insertNewLocation(TypeLocation*);
</span><span class="cx"> FunctionHasExecutedCache* functionHasExecutedCache() { return &m_functionHasExecutedCache; }
</span><span class="cx"> TypeLocationCache* typeLocationCache() { return &m_typeLocationCache; }
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeTypeSetcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/TypeSet.cpp (172401 => 172402)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/TypeSet.cpp        2014-08-11 18:59:44 UTC (rev 172401)
+++ trunk/Source/JavaScriptCore/runtime/TypeSet.cpp        2014-08-11 19:19:47 UTC (rev 172402)
</span><span class="lines">@@ -236,14 +236,14 @@
</span><span class="cx"> return seen.release();
</span><span class="cx"> }
</span><span class="cx">
</span><del>-PassRefPtr<Inspector::TypeBuilder::Array<Inspector::InspectorObject>> TypeSet::allStructureRepresentations() const
</del><ins>+PassRefPtr<Inspector::TypeBuilder::Array<Inspector::TypeBuilder::Runtime::StructureDescription>> TypeSet::allStructureRepresentations() const
</ins><span class="cx"> {
</span><del>- RefPtr<Inspector::TypeBuilder::Array<Inspector::InspectorObject>> ret = Inspector::TypeBuilder::Array<Inspector::InspectorObject>::create();
</del><ins>+ RefPtr<Inspector::TypeBuilder::Array<Inspector::TypeBuilder::Runtime::StructureDescription>> description = Inspector::TypeBuilder::Array<Inspector::TypeBuilder::Runtime::StructureDescription>::create();
</ins><span class="cx">
</span><span class="cx"> for (size_t i = 0; i < m_structureHistory->size(); i++)
</span><del>- ret->addItem(m_structureHistory->at(i)->inspectorRepresentation());
</del><ins>+ description->addItem(m_structureHistory->at(i)->inspectorRepresentation());
</ins><span class="cx">
</span><del>- return ret.release();
</del><ins>+ return description.release();
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> String TypeSet::leastCommonAncestor() const
</span><span class="lines">@@ -341,8 +341,8 @@
</span><span class="cx">
</span><span class="cx"> representation.append("{");
</span><span class="cx"> while (curShape) {
</span><del>- for (auto iter = curShape->m_fields.begin(), end = curShape->m_fields.end(); iter != end; ++iter) {
- String prop((*iter).get());
</del><ins>+ for (auto it = curShape->m_fields.begin(), end = curShape->m_fields.end(); it != end; ++it) {
+ String prop((*it).get());
</ins><span class="cx"> representation.append(prop);
</span><span class="cx"> representation.append(", ");
</span><span class="cx"> }
</span><span class="lines">@@ -364,23 +364,23 @@
</span><span class="cx"> return representation.toString();
</span><span class="cx"> }
</span><span class="cx">
</span><del>-PassRefPtr<Inspector::InspectorObject> StructureShape::inspectorRepresentation()
</del><ins>+PassRefPtr<Inspector::TypeBuilder::Runtime::StructureDescription> StructureShape::inspectorRepresentation()
</ins><span class="cx"> {
</span><del>- RefPtr<Inspector::InspectorObject> base = Inspector::InspectorObject::create();
- RefPtr<Inspector::InspectorObject> currentObject = base;
</del><ins>+ RefPtr<Inspector::TypeBuilder::Runtime::StructureDescription> base = Inspector::TypeBuilder::Runtime::StructureDescription::create();
+ RefPtr<Inspector::TypeBuilder::Runtime::StructureDescription> currentObject = base;
</ins><span class="cx"> RefPtr<StructureShape> currentShape = this;
</span><span class="cx">
</span><span class="cx"> while (currentShape) {
</span><del>- RefPtr<Inspector::TypeBuilder::Array<String>> fields = Inspector::TypeBuilder::Array<String>::create();
- for (auto iter = currentShape->m_fields.begin(), end = currentShape->m_fields.end(); iter != end; ++iter)
- fields->addItem((*iter).get());
</del><ins>+ auto fields = Inspector::TypeBuilder::Array<String>::create();
+ for (auto it = currentShape->m_fields.begin(), end = currentShape->m_fields.end(); it != end; ++it)
+ fields->addItem((*it).get());
</ins><span class="cx">
</span><del>- currentObject->setArray(ASCIILiteral("fields"), fields->asArray());
- currentObject->setString(ASCIILiteral("constructorName"), currentShape->m_constructorName);
</del><ins>+ currentObject->setFields(fields);
+ currentObject->setConstructorName(currentShape->m_constructorName);
</ins><span class="cx">
</span><span class="cx"> if (currentShape->m_proto) {
</span><del>- RefPtr<Inspector::InspectorObject> nextObject = Inspector::InspectorObject::create();
- currentObject->setObject(ASCIILiteral("prototypeStructure"), nextObject);
</del><ins>+ RefPtr<Inspector::TypeBuilder::Runtime::StructureDescription> nextObject = Inspector::TypeBuilder::Runtime::StructureDescription::create();
+ currentObject->setPrototypeStructure(nextObject);
</ins><span class="cx"> currentObject = nextObject;
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeTypeSeth"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/TypeSet.h (172401 => 172402)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/TypeSet.h        2014-08-11 18:59:44 UTC (rev 172401)
+++ trunk/Source/JavaScriptCore/runtime/TypeSet.h        2014-08-11 19:19:47 UTC (rev 172402)
</span><span class="lines">@@ -32,15 +32,17 @@
</span><span class="cx"> #include <wtf/text/WTFString.h>
</span><span class="cx"> #include <wtf/Vector.h>
</span><span class="cx">
</span><del>-namespace Inspector { namespace TypeBuilder {
-template<typename T>
-class Array;
-}}
</del><ins>+namespace Inspector {
+namespace TypeBuilder {
+template<typename T> class Array;
</ins><span class="cx">
</span><del>-namespace Inspector {
-class InspectorObject;
</del><ins>+namespace Runtime {
+class StructureDescription;
</ins><span class="cx"> }
</span><span class="cx">
</span><ins>+}
+}
+
</ins><span class="cx"> namespace JSC {
</span><span class="cx">
</span><span class="cx"> class JSValue;
</span><span class="lines">@@ -68,7 +70,7 @@
</span><span class="cx"> void markAsFinal();
</span><span class="cx"> void addProperty(RefPtr<StringImpl>);
</span><span class="cx"> String stringRepresentation();
</span><del>- PassRefPtr<Inspector::InspectorObject> inspectorRepresentation();
</del><ins>+ PassRefPtr<Inspector::TypeBuilder::Runtime::StructureDescription> inspectorRepresentation();
</ins><span class="cx"> void setConstructorName(String name) { m_constructorName = (name.isEmpty() ? "Object" : name); }
</span><span class="cx"> String constructorName() { return m_constructorName; }
</span><span class="cx"> void setProto(PassRefPtr<StructureShape> shape) { m_proto = shape; }
</span><span class="lines">@@ -93,7 +95,7 @@
</span><span class="cx"> JS_EXPORT_PRIVATE String seenTypes() const;
</span><span class="cx"> String displayName() const;
</span><span class="cx"> PassRefPtr<Inspector::TypeBuilder::Array<String>> allPrimitiveTypeNames() const;
</span><del>- PassRefPtr<Inspector::TypeBuilder::Array<Inspector::InspectorObject>> allStructureRepresentations() const;
</del><ins>+ PassRefPtr<Inspector::TypeBuilder::Array<Inspector::TypeBuilder::Runtime::StructureDescription>> allStructureRepresentations() const;
</ins><span class="cx">
</span><span class="cx"> private:
</span><span class="cx"> String leastCommonAncestor() const;
</span></span></pre>
</div>
</div>
</body>
</html>