Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1)

Side by Side Diff: src/objects.h

Issue 567313003: RegExp: Add support for the ES6-proposed sticky flag (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Add missing test of --harmony-regexps flag Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/jsregexp.cc ('k') | src/regexp.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef V8_OBJECTS_H_ 5 #ifndef V8_OBJECTS_H_
6 #define V8_OBJECTS_H_ 6 #define V8_OBJECTS_H_
7 7
8 #include "src/allocation.h" 8 #include "src/allocation.h"
9 #include "src/assert-scope.h" 9 #include "src/assert-scope.h"
10 #include "src/base/bits.h" 10 #include "src/base/bits.h"
(...skipping 8013 matching lines...) Expand 10 before | Expand all | Expand 10 after
8024 // - max number of registers used by irregexp implementations. 8024 // - max number of registers used by irregexp implementations.
8025 // - number of capture registers (output values) of the regexp. 8025 // - number of capture registers (output values) of the regexp.
8026 class JSRegExp: public JSObject { 8026 class JSRegExp: public JSObject {
8027 public: 8027 public:
8028 // Meaning of Type: 8028 // Meaning of Type:
8029 // NOT_COMPILED: Initial value. No data has been stored in the JSRegExp yet. 8029 // NOT_COMPILED: Initial value. No data has been stored in the JSRegExp yet.
8030 // ATOM: A simple string to match against using an indexOf operation. 8030 // ATOM: A simple string to match against using an indexOf operation.
8031 // IRREGEXP: Compiled with Irregexp. 8031 // IRREGEXP: Compiled with Irregexp.
8032 // IRREGEXP_NATIVE: Compiled to native code with Irregexp. 8032 // IRREGEXP_NATIVE: Compiled to native code with Irregexp.
8033 enum Type { NOT_COMPILED, ATOM, IRREGEXP }; 8033 enum Type { NOT_COMPILED, ATOM, IRREGEXP };
8034 enum Flag { NONE = 0, GLOBAL = 1, IGNORE_CASE = 2, MULTILINE = 4 }; 8034 enum Flag {
8035 NONE = 0,
8036 GLOBAL = 1,
8037 IGNORE_CASE = 2,
8038 MULTILINE = 4,
8039 STICKY = 8
8040 };
8035 8041
8036 class Flags { 8042 class Flags {
8037 public: 8043 public:
8038 explicit Flags(uint32_t value) : value_(value) { } 8044 explicit Flags(uint32_t value) : value_(value) { }
8039 bool is_global() { return (value_ & GLOBAL) != 0; } 8045 bool is_global() { return (value_ & GLOBAL) != 0; }
8040 bool is_ignore_case() { return (value_ & IGNORE_CASE) != 0; } 8046 bool is_ignore_case() { return (value_ & IGNORE_CASE) != 0; }
8041 bool is_multiline() { return (value_ & MULTILINE) != 0; } 8047 bool is_multiline() { return (value_ & MULTILINE) != 0; }
8048 bool is_sticky() { return (value_ & STICKY) != 0; }
8042 uint32_t value() { return value_; } 8049 uint32_t value() { return value_; }
8043 private: 8050 private:
8044 uint32_t value_; 8051 uint32_t value_;
8045 }; 8052 };
8046 8053
8047 DECL_ACCESSORS(data, Object) 8054 DECL_ACCESSORS(data, Object)
8048 8055
8049 inline Type TypeTag(); 8056 inline Type TypeTag();
8050 inline int CaptureCount(); 8057 inline int CaptureCount();
8051 inline Flags GetFlags(); 8058 inline Flags GetFlags();
(...skipping 3083 matching lines...) Expand 10 before | Expand all | Expand 10 after
11135 } else { 11142 } else {
11136 value &= ~(1 << bit_position); 11143 value &= ~(1 << bit_position);
11137 } 11144 }
11138 return value; 11145 return value;
11139 } 11146 }
11140 }; 11147 };
11141 11148
11142 } } // namespace v8::internal 11149 } } // namespace v8::internal
11143 11150
11144 #endif // V8_OBJECTS_H_ 11151 #endif // V8_OBJECTS_H_
OLDNEW
« no previous file with comments | « src/jsregexp.cc ('k') | src/regexp.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698