diff options
author | Simon Hausmann <simon.hausmann@digia.com> | 2012-10-22 15:40:17 +0200 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@digia.com> | 2012-10-22 15:40:17 +0200 |
commit | 43a42f108af6bcbd91f2672731c3047c26213af1 (patch) | |
tree | 7fa092e5f5d873c72f2486a70e26be26f7a38bec /Source/JavaScriptCore/bytecode/ArrayProfile.h | |
parent | d9cf437c840c6eb7417bdd97e6c40979255d3158 (diff) | |
download | qtwebkit-43a42f108af6bcbd91f2672731c3047c26213af1.tar.gz |
Imported WebKit commit 302e7806bff028bd1167a1ec7c86a1ee00ecfb49 (http://svn.webkit.org/repository/webkit/trunk@132067)
New snapshot that fixes build without QtWidgets
Diffstat (limited to 'Source/JavaScriptCore/bytecode/ArrayProfile.h')
-rw-r--r-- | Source/JavaScriptCore/bytecode/ArrayProfile.h | 33 |
1 files changed, 32 insertions, 1 deletions
diff --git a/Source/JavaScriptCore/bytecode/ArrayProfile.h b/Source/JavaScriptCore/bytecode/ArrayProfile.h index 3b462eaba..ffc136258 100644 --- a/Source/JavaScriptCore/bytecode/ArrayProfile.h +++ b/Source/JavaScriptCore/bytecode/ArrayProfile.h @@ -40,13 +40,44 @@ class LLIntOffsetsExtractor; typedef unsigned ArrayModes; #define asArrayModes(type) \ - (1 << static_cast<unsigned>(type)) + (static_cast<unsigned>(1) << static_cast<unsigned>(type)) + +#define ALL_NON_ARRAY_ARRAY_MODES \ + (asArrayModes(NonArray) \ + | asArrayModes(NonArrayWithContiguous) \ + | asArrayModes(NonArrayWithArrayStorage) \ + | asArrayModes(NonArrayWithSlowPutArrayStorage)) + +#define ALL_ARRAY_ARRAY_MODES \ + (asArrayModes(ArrayClass) \ + | asArrayModes(ArrayWithContiguous) \ + | asArrayModes(ArrayWithArrayStorage) \ + | asArrayModes(ArrayWithSlowPutArrayStorage)) + +#define ALL_ARRAY_MODES (ALL_NON_ARRAY_ARRAY_MODES | ALL_ARRAY_ARRAY_MODES) inline ArrayModes arrayModeFromStructure(Structure* structure) { return asArrayModes(structure->indexingType()); } +const char* arrayModesToString(ArrayModes); + +inline bool mergeArrayModes(ArrayModes& left, ArrayModes right) +{ + ArrayModes newModes = left | right; + if (newModes == left) + return false; + left = newModes; + return true; +} + +// Checks if proven is a subset of expected. +inline bool arrayModesAlreadyChecked(ArrayModes proven, ArrayModes expected) +{ + return (expected | proven) == expected; +} + class ArrayProfile { public: ArrayProfile() |