Skip to content

Commit

Permalink
Merge r173994 - Web Inspector: console.assert(bitString) TypeSet:50
Browse files Browse the repository at this point in the history
https://bugs.webkit.org/show_bug.cgi?id=137051

Reviewed by Joseph Pecoraro.

Source/JavaScriptCore:

This patch creates stricter requirements on a TypeDescription
being valid. To be valid, a TypeDescription now ensures that
the TypeSet it describes has non null type information.

* inspector/agents/InspectorRuntimeAgent.cpp:
(Inspector::InspectorRuntimeAgent::getRuntimeTypesForVariablesAtOffsets):
* runtime/TypeSet.h:
(JSC::TypeSet::isEmpty):

Source/WebInspectorUI:

This fixes TypeSet's isContainedIn method by ensuring that
the type bit string isn't zero because the test would trivially
pass if the bit string is zero.

* UserInterface/Models/TypeSet.js:
(WebInspector.TypeSet.prototype.isContainedIn):

Canonical link: https://commits.webkit.org/154760.54@webkitgtk/2.6
git-svn-id: https://svn.webkit.org/repository/webkit/releases/WebKitGTK/webkit-2.6@174441 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
saambarati authored and carlosgcampos committed Oct 8, 2014
1 parent a4819b0 commit 424b6d6
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 4 deletions.
16 changes: 16 additions & 0 deletions Source/JavaScriptCore/ChangeLog
@@ -1,3 +1,19 @@
2014-09-25 Saam Barati <saambarati1@gmail.com>

Web Inspector: console.assert(bitString) TypeSet:50
https://bugs.webkit.org/show_bug.cgi?id=137051

Reviewed by Joseph Pecoraro.

This patch creates stricter requirements on a TypeDescription
being valid. To be valid, a TypeDescription now ensures that
the TypeSet it describes has non null type information.

* inspector/agents/InspectorRuntimeAgent.cpp:
(Inspector::InspectorRuntimeAgent::getRuntimeTypesForVariablesAtOffsets):
* runtime/TypeSet.h:
(JSC::TypeSet::isEmpty):

2014-09-23 Tomas Popela <tpopela@redhat.com>

[CLoop] - Fix CLoop on the 32-bit Big-Endians
Expand Down
11 changes: 8 additions & 3 deletions Source/JavaScriptCore/inspector/agents/InspectorRuntimeAgent.cpp
Expand Up @@ -227,15 +227,20 @@ void InspectorRuntimeAgent::getRuntimeTypesForVariablesAtOffsets(ErrorString* er

bool okay;
TypeLocation* typeLocation = vm.typeProfiler()->findLocation(divot, sourceIDAsString.toIntPtrStrict(&okay), static_cast<TypeProfilerSearchDescriptor>(descriptor));
RefPtr<Inspector::Protocol::Runtime::TypeDescription> description = Inspector::Protocol::Runtime::TypeDescription::create()
.setIsValid(!!typeLocation);

RefPtr<TypeSet> typeSet;
if (typeLocation) {
RefPtr<TypeSet> typeSet;
if (typeLocation->m_globalTypeSet && typeLocation->m_globalVariableID != TypeProfilerNoGlobalIDExists)
typeSet = typeLocation->m_globalTypeSet;
else
typeSet = typeLocation->m_instructionTypeSet;
}

bool isValid = typeLocation && typeSet && !typeSet->isEmpty();
RefPtr<Inspector::Protocol::Runtime::TypeDescription> description = Inspector::Protocol::Runtime::TypeDescription::create()
.setIsValid(isValid);

if (isValid) {
description->setLeastCommonAncestor(typeSet->leastCommonAncestor());
description->setPrimitiveTypeNames(typeSet->allPrimitiveTypeNames());
description->setStructures(typeSet->allStructureRepresentations());
Expand Down
1 change: 1 addition & 0 deletions Source/JavaScriptCore/runtime/TypeSet.h
Expand Up @@ -108,6 +108,7 @@ class TypeSet : public RefCounted<TypeSet> {
bool isOverflown() const { return m_isOverflown; }
String leastCommonAncestor() const;
PassRefPtr<Inspector::Protocol::Runtime::TypeSet> inspectorTypeSet() const;
bool isEmpty() const { return m_seenTypes == TypeNothing; }

private:
void dumpSeenTypes();
Expand Down
14 changes: 14 additions & 0 deletions Source/WebInspectorUI/ChangeLog
@@ -1,3 +1,17 @@
2014-09-25 Saam Barati <saambarati1@gmail.com>

Web Inspector: console.assert(bitString) TypeSet:50
https://bugs.webkit.org/show_bug.cgi?id=137051

Reviewed by Joseph Pecoraro.

This fixes TypeSet's isContainedIn method by ensuring that
the type bit string isn't zero because the test would trivially
pass if the bit string is zero.

* UserInterface/Models/TypeSet.js:
(WebInspector.TypeSet.prototype.isContainedIn):

2014-10-02 Andres Gomez <agomez@igalia.com>

Web Inspector: [GTK] Missing icons and enhancing the proportion and visibility of some icons
Expand Down
2 changes: 1 addition & 1 deletion Source/WebInspectorUI/UserInterface/Models/TypeSet.js
Expand Up @@ -89,6 +89,6 @@ WebInspector.TypeSet.prototype = {
// ------ (AND)
// 0b0010 != bitString

return (this._bitString & test) === this._bitString;
return this._bitString && (this._bitString & test) === this._bitString;
}
};

0 comments on commit 424b6d6

Please sign in to comment.