Changeset 148259 in webkit
- Timestamp:
- Apr 11, 2013 8:42:46 PM (11 years ago)
- Location:
- trunk/Source/JavaScriptCore
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r148207 r148259 1 2013-04-11 Benjamin Poulain <bpoulain@apple.com> 2 3 Merge CharacterClassTable into CharacterClass 4 https://bugs.webkit.org/show_bug.cgi?id=114409 5 6 Reviewed by Darin Adler. 7 8 CharacterClassTable is only a pointer and a boolean. 9 It is a little overkill to make a separate allocation 10 for that. 11 12 * create_regex_tables: 13 * yarr/YarrJIT.cpp: 14 (JSC::Yarr::YarrGenerator::matchCharacterClass): 15 * yarr/YarrPattern.cpp: 16 (JSC::Yarr::CharacterClassConstructor::charClass): 17 * yarr/YarrPattern.h: 18 (CharacterClass): 19 (JSC::Yarr::CharacterClass::CharacterClass): 20 1 21 2013-04-11 Michael Saboff <msaboff@apple.com> 2 22 -
trunk/Source/JavaScriptCore/create_regex_tables
r83860 r148259 1 # Copyright (C) 2010 Apple Inc. All rights reserved.1 # Copyright (C) 2010, 2013 Apple Inc. All rights reserved. 2 2 # 3 3 # Redistribution and use in source and binary forms, with or without … … 91 91 if emitTables and classes["UseTable"]: 92 92 if "Inverse" in classes: 93 function += (" CharacterClass* characterClass = new CharacterClass( CharacterClassTable::create(_%sData, true));\n" % (classes["Inverse"]))93 function += (" CharacterClass* characterClass = new CharacterClass(_%sData, true);\n" % (classes["Inverse"])) 94 94 else: 95 function += (" CharacterClass* characterClass = new CharacterClass( CharacterClassTable::create(_%sData, false));\n" % (name))95 function += (" CharacterClass* characterClass = new CharacterClass(_%sData, false);\n" % (name)) 96 96 else: 97 function += (" CharacterClass* characterClass = new CharacterClass (0);\n")97 function += (" CharacterClass* characterClass = new CharacterClass;\n") 98 98 for (min, max) in ranges: 99 99 if (min == max): -
trunk/Source/JavaScriptCore/yarr/YarrJIT.cpp
r144083 r148259 1 1 /* 2 * Copyright (C) 2009 Apple Inc. All rights reserved.2 * Copyright (C) 2009, 2013 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 180 180 { 181 181 if (charClass->m_table) { 182 ExtendedAddress tableEntry(character, reinterpret_cast<intptr_t>(charClass->m_table ->m_table));183 matchDest.append(branchTest8(charClass->m_table ->m_inverted ? Zero : NonZero, tableEntry));182 ExtendedAddress tableEntry(character, reinterpret_cast<intptr_t>(charClass->m_table)); 183 matchDest.append(branchTest8(charClass->m_tableInverted ? Zero : NonZero, tableEntry)); 184 184 return; 185 185 } -
trunk/Source/JavaScriptCore/yarr/YarrPattern.cpp
r143018 r148259 1 1 /* 2 * Copyright (C) 2009 Apple Inc. All rights reserved.2 * Copyright (C) 2009, 2013 Apple Inc. All rights reserved. 3 3 * Copyright (C) 2010 Peter Varga (pvarga@inf.u-szeged.hu), University of Szeged 4 4 * … … 178 178 PassOwnPtr<CharacterClass> charClass() 179 179 { 180 OwnPtr<CharacterClass> characterClass = adoptPtr(new CharacterClass (0));180 OwnPtr<CharacterClass> characterClass = adoptPtr(new CharacterClass); 181 181 182 182 characterClass->m_matches.swap(m_matches); -
trunk/Source/JavaScriptCore/yarr/YarrPattern.h
r143018 r148259 1 1 /* 2 * Copyright (C) 2009 Apple Inc. All rights reserved.2 * Copyright (C) 2009, 2013 Apple Inc. All rights reserved. 3 3 * Copyright (C) 2010 Peter Varga (pvarga@inf.u-szeged.hu), University of Szeged 4 4 * … … 51 51 }; 52 52 53 struct CharacterClassTable : RefCounted<CharacterClassTable> {54 const char* m_table;55 bool m_inverted;56 static PassRefPtr<CharacterClassTable> create(const char* table, bool inverted)57 {58 return adoptRef(new CharacterClassTable(table, inverted));59 }60 61 private:62 CharacterClassTable(const char* table, bool inverted)63 : m_table(table)64 , m_inverted(inverted)65 {66 }67 };68 69 53 struct CharacterClass { 70 54 WTF_MAKE_FAST_ALLOCATED; 71 55 public: 72 56 // All CharacterClass instances have to have the full set of matches and ranges, 73 // they may have an optional table for faster lookups (which must match the57 // they may have an optional m_table for faster lookups (which must match the 74 58 // specified matches and ranges) 75 CharacterClass(PassRefPtr<CharacterClassTable> table) 59 CharacterClass() 60 : m_table(0) 61 { 62 } 63 CharacterClass(const char* table, bool inverted) 76 64 : m_table(table) 65 , m_tableInverted(inverted) 77 66 { 78 67 } … … 81 70 Vector<UChar> m_matchesUnicode; 82 71 Vector<CharacterRange> m_rangesUnicode; 83 RefPtr<CharacterClassTable> m_table; 72 73 const char* m_table; 74 bool m_tableInverted; 84 75 }; 85 76
Note: See TracChangeset
for help on using the changeset viewer.