Changeset 167174 in webkit
- Timestamp:
- Apr 11, 2014 5:25:06 PM (10 years ago)
- Location:
- trunk/Source/JavaScriptCore
- Files:
-
- 4 added
- 3 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r167165 r167174 1 2014-04-11 Brian J. Burg <burg@cs.washington.edu> 2 3 Web Replay: code generator should consider enclosing class when computing duplicate type names 4 https://bugs.webkit.org/show_bug.cgi?id=131554 5 6 Reviewed by Timothy Hatcher. 7 8 We need to prepend an enum's enclosing class, if any, so that multiple enums with the same name 9 can coexist without triggering a "duplicate types" error. Now, such enums must be referenced 10 by the enclosing class and enum name. 11 12 Added tests for the new syntax, and rebaselined one test to reflect a previous patch's change. 13 14 * replay/scripts/CodeGeneratorReplayInputs.py: 15 (Type.type_name): Prepend the enclosing class name. 16 (Type.type_name.is): 17 * replay/scripts/tests/expected/fail-on-duplicate-enum-type.json-error: Added. 18 * replay/scripts/tests/expected/generate-enums-with-same-base-name.json-TestReplayInputs.cpp: Added. 19 * replay/scripts/tests/expected/generate-enums-with-same-base-name.json-TestReplayInputs.h: Added. 20 * replay/scripts/tests/expected/generate-input-with-vector-members.json-TestReplayInputs.h: Rebaseline. 21 * replay/scripts/tests/fail-on-duplicate-enum-type.json: Added. 22 * replay/scripts/tests/generate-enums-with-same-base-name.json: Added. 23 1 24 2014-04-11 Gavin Barraclough <baraclough@apple.com> 2 25 -
trunk/Source/JavaScriptCore/replay/scripts/CodeGeneratorReplayInputs.py
r165521 r167174 331 331 332 332 def type_name(self, qualified=False): 333 return "%s%s" % (self.qualified_prefix(), self._name) if qualified else self._name 333 if qualified: 334 return "%s%s" % (self.qualified_prefix(), self._name) 335 elif self.enclosing_class is not None: 336 return "%s::%s" % (self.enclosing_class, self._name) 337 else: 338 return self._name 334 339 335 340 def storage_type(self, qualified=False): -
trunk/Source/JavaScriptCore/replay/scripts/tests/expected/generate-enums-with-same-base-name.json-TestReplayInputs.h
r167173 r167174 25 25 */ 26 26 27 // DO NOT EDIT THIS FILE. It is automatically generated from generate- input-with-vector-members.json27 // DO NOT EDIT THIS FILE. It is automatically generated from generate-enums-with-same-base-name.json 28 28 // by the script: JavaScriptCore/replay/scripts/CodeGeneratorReplayInputs.py 29 29 30 #ifndef generate_ input_with_vector_members_json_TestReplayInputs_h31 #define generate_ input_with_vector_members_json_TestReplayInputs_h30 #ifndef generate_enums_with_same_base_name_json_TestReplayInputs_h 31 #define generate_enums_with_same_base_name_json_TestReplayInputs_h 32 32 33 33 #if ENABLE(WEB_REPLAY) 34 34 #include "InternalNamespaceHeaderIncludeDummy.h" 35 35 #include <platform/ExternalNamespaceHeaderIncludeDummy.h> 36 #include <replay/FormData.h> 37 #include <replay/PlatformEvent.h> 36 38 37 namespace WebCore {38 class WebThing;39 }40 41 namespace JSC {42 class JSThing;43 }44 39 45 40 46 41 namespace Test { 47 class ArrayOfThings;42 class FormCombo; 48 43 } // namespace Test 49 44 50 45 namespace JSC { 51 template<> struct InputTraits<Test:: ArrayOfThings> {46 template<> struct InputTraits<Test::FormCombo> { 52 47 static InputQueue queue() { return InputQueue::ScriptMemoizedData; } 53 48 static const AtomicString& type(); 54 49 55 static void encode(JSC::EncodedValue&, const Test::ArrayOfThings&); 56 static bool decode(JSC::EncodedValue&, std::unique_ptr<Test::ArrayOfThings>&); 50 static void encode(JSC::EncodedValue&, const Test::FormCombo&); 51 static bool decode(JSC::EncodedValue&, std::unique_ptr<Test::FormCombo>&); 52 }; 53 template<> struct EncodingTraits<WebCore::FormData::Type> { 54 typedef WebCore::FormData::Type DecodedType; 55 56 static EncodedValue encodeValue(const WebCore::FormData::Type& value); 57 static bool decodeValue(EncodedValue&, WebCore::FormData::Type& value); 57 58 }; 58 59 60 template<> struct EncodingTraits<PlatformEvent::Type> { 61 typedef PlatformEvent::Type DecodedType; 62 63 static EncodedValue encodeValue(const PlatformEvent::Type& value); 64 static bool decodeValue(EncodedValue&, PlatformEvent::Type& value); 65 }; 59 66 } // namespace JSC 60 67 61 68 namespace Test { 62 class ArrayOfThings : public NondeterministicInput<ArrayOfThings> {69 class FormCombo : public NondeterministicInput<FormCombo> { 63 70 public: 64 ArrayOfThings(Vector<double>& doubles, Vector<JSThing>& jsthings, Vector<WebThing>& webthings);65 virtual ~ ArrayOfThings();71 FormCombo(PlatformEvent::Type eventType, FormData::Type formType); 72 virtual ~FormCombo(); 66 73 67 const Vector<double>& doubles() const { return m_doubles; } 68 const Vector<JSThing>& jsthings() const { return m_jsthings; } 69 const Vector<WebThing>& webthings() const { return m_webthings; } 74 PlatformEvent::Type eventType() const { return m_eventType; } 75 FormData::Type formType() const { return m_formType; } 70 76 private: 71 Vector<double> m_doubles; 72 Vector<JSThing> m_jsthings; 73 Vector<WebThing> m_webthings; 77 PlatformEvent::Type m_eventType; 78 FormData::Type m_formType; 74 79 }; 75 80 } // namespace Test 76 81 77 82 #define TEST_REPLAY_INPUT_NAMES_FOR_EACH(macro) \ 78 macro( ArrayOfThings) \83 macro(FormCombo) \ 79 84 \ 80 85 // end of TEST_REPLAY_INPUT_NAMES_FOR_EACH … … 82 87 #endif // ENABLE(WEB_REPLAY) 83 88 84 #endif // generate- input-with-vector-members.json-TestReplayInputs_h89 #endif // generate-enums-with-same-base-name.json-TestReplayInputs_h -
trunk/Source/JavaScriptCore/replay/scripts/tests/expected/generate-input-with-vector-members.json-TestReplayInputs.h
r163918 r167174 35 35 #include <platform/ExternalNamespaceHeaderIncludeDummy.h> 36 36 37 namespace WebCore {38 class WebThing;39 }40 41 namespace JSC {42 class JSThing;43 }44 37 45 38
Note: See TracChangeset
for help on using the changeset viewer.