source: webkit/trunk/JavaScriptCore/kjs/regexp.h@ 37457

Last change on this file since 37457 was 37457, checked in by [email protected], 17 years ago

2008-10-09 Alp Toker <[email protected]>

Reviewed by Mark Rowe.

https://bugs.webkit.org/show_bug.cgi?id=20760
Implement support for x86 Linux in CTI

Prepare to enable CTI/WREC on supported architectures.

Make it possible to use the CTI_ARGUMENT workaround with GCC as well
as MSVC by fixing some preprocessor conditionals.

Note that CTI/WREC no longer requires CTI_ARGUMENT on Linux so we
don't actually enable it except when building with MSVC. GCC on Win32
remains untested.

Adapt inline ASM code to use the global symbol underscore prefix only
on Darwin and to call the properly mangled Machine::cti_vm_throw
symbol name depending on CTI_ARGUMENT.

Also avoid global inclusion of the JIT infrastructure headers
throughout WebCore and WebKit causing recompilation of about ~1500
source files after modification to X86Assembler.h, CTI.h, WREC.h,
which are only used deep inside JavaScriptCore.

  • Property svn:eol-style set to native
File size: 2.5 KB
Line 
1/*
2 * Copyright (C) 1999-2000 Harri Porten ([email protected])
3 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved.
4 *
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version.
9 *
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
14 *
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18 *
19 */
20
21#ifndef KJS_REGEXP_H
22#define KJS_REGEXP_H
23
24#include "ustring.h"
25#include <wtf/Forward.h>
26#include <wtf/RefCounted.h>
27
28struct JSRegExp;
29
30namespace JSC {
31
32 class JSGlobalData;
33
34 class RegExp : public RefCounted<RegExp> {
35 public:
36 static PassRefPtr<RegExp> create(JSGlobalData*, const UString& pattern);
37 static PassRefPtr<RegExp> create(JSGlobalData*, const UString& pattern, const UString& flags);
38 ~RegExp();
39
40 bool global() const { return m_flagBits & Global; }
41 bool ignoreCase() const { return m_flagBits & IgnoreCase; }
42 bool multiline() const { return m_flagBits & Multiline; }
43
44 const UString& pattern() const { return m_pattern; }
45 const UString& flags() const { return m_flags; }
46
47 bool isValid() const { return !m_constructionError; }
48 const char* errorMessage() const { return m_constructionError; }
49
50 int match(const UString&, int offset, OwnArrayPtr<int>* ovector = 0);
51 unsigned numSubpatterns() const { return m_numSubpatterns; }
52
53 private:
54 RegExp(JSGlobalData*, const UString& pattern);
55 RegExp(JSGlobalData*, const UString& pattern, const UString& flags);
56
57 void compile();
58
59 enum FlagBits { Global = 1, IgnoreCase = 2, Multiline = 4 };
60
61 UString m_pattern; // FIXME: Just decompile m_regExp instead of storing this.
62 UString m_flags; // FIXME: Just decompile m_regExp instead of storing this.
63 int m_flagBits;
64 JSRegExp* m_regExp;
65 const char* m_constructionError;
66 unsigned m_numSubpatterns;
67
68#if ENABLE(WREC)
69 // Called as a WRECFunction
70 void* m_wrecFunction;
71#endif
72 };
73
74} // namespace JSC
75
76#endif // KJS_REGEXP_H
Note: See TracBrowser for help on using the repository browser.