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

Side by Side Diff: src/js/macros.py

Issue 1432683002: Revert of Implement flag and source getters on RegExp.prototype. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@rproto
Patch Set: Created 5 years, 1 month 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
« no previous file with comments | « src/js/harmony-regexp.js ('k') | src/js/prologue.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 2006-2009 the V8 project authors. All rights reserved. 1 # Copyright 2006-2009 the V8 project authors. All rights reserved.
2 # Redistribution and use in source and binary forms, with or without 2 # Redistribution and use in source and binary forms, with or without
3 # modification, are permitted provided that the following conditions are 3 # modification, are permitted provided that the following conditions are
4 # met: 4 # met:
5 # 5 #
6 # * Redistributions of source code must retain the above copyright 6 # * Redistributions of source code must retain the above copyright
7 # notice, this list of conditions and the following disclaimer. 7 # notice, this list of conditions and the following disclaimer.
8 # * Redistributions in binary form must reproduce the above 8 # * Redistributions in binary form must reproduce the above
9 # copyright notice, this list of conditions and the following 9 # copyright notice, this list of conditions and the following
10 # disclaimer in the documentation and/or other materials provided 10 # disclaimer in the documentation and/or other materials provided
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
171 define INFINITY = (1/0); 171 define INFINITY = (1/0);
172 define UNDEFINED = (void 0); 172 define UNDEFINED = (void 0);
173 173
174 # Macros implemented in Python. 174 # Macros implemented in Python.
175 python macro CHAR_CODE(str) = ord(str[1]); 175 python macro CHAR_CODE(str) = ord(str[1]);
176 176
177 # Constants used on an array to implement the properties of the RegExp object. 177 # Constants used on an array to implement the properties of the RegExp object.
178 define REGEXP_NUMBER_OF_CAPTURES = 0; 178 define REGEXP_NUMBER_OF_CAPTURES = 0;
179 define REGEXP_FIRST_CAPTURE = 3; 179 define REGEXP_FIRST_CAPTURE = 3;
180 180
181 # Constants and macros for internal slot access.
182 define REGEXP_GLOBAL_MASK = 1;
183 define REGEXP_IGNORE_CASE_MASK = 2;
184 define REGEXP_MULTILINE_MASK = 4;
185 define REGEXP_STICKY_MASK = 8;
186 define REGEXP_UNICODE_MASK = 16;
187
188 macro REGEXP_GLOBAL(regexp) = (regexp[regExpFlagsSymbol] & REGEXP_GLOBAL_MASK);
189 macro REGEXP_IGNORE_CASE(regexp) = (regexp[regExpFlagsSymbol] & REGEXP_IGNORE_CA SE_MASK);
190 macro REGEXP_MULTILINE(regexp) = (regexp[regExpFlagsSymbol] & REGEXP_MULTILINE_M ASK);
191 macro REGEXP_STICKY(regexp) = (regexp[regExpFlagsSymbol] & REGEXP_STICKY_MASK);
192 macro REGEXP_UNICODE(regexp) = (regexp[regExpFlagsSymbol] & REGEXP_UNICODE_MASK) ;
193 macro REGEXP_SOURCE(regexp) = (regexp[regExpSourceSymbol]);
194
195 # We can't put macros in macros so we use constants here. 181 # We can't put macros in macros so we use constants here.
196 # REGEXP_NUMBER_OF_CAPTURES 182 # REGEXP_NUMBER_OF_CAPTURES
197 macro NUMBER_OF_CAPTURES(array) = ((array)[0]); 183 macro NUMBER_OF_CAPTURES(array) = ((array)[0]);
198 184
199 # Limit according to ECMA 262 15.9.1.1 185 # Limit according to ECMA 262 15.9.1.1
200 define MAX_TIME_MS = 8640000000000000; 186 define MAX_TIME_MS = 8640000000000000;
201 # Limit which is MAX_TIME_MS + msPerMonth. 187 # Limit which is MAX_TIME_MS + msPerMonth.
202 define MAX_TIME_BEFORE_UTC = 8640002592000000; 188 define MAX_TIME_BEFORE_UTC = 8640002592000000;
203 189
204 # Gets the value of a Date object. If arg is not a Date object 190 # Gets the value of a Date object. If arg is not a Date object
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
316 define NOT_FOUND = -1; 302 define NOT_FOUND = -1;
317 303
318 # Check whether debug is active. 304 # Check whether debug is active.
319 define DEBUG_IS_ACTIVE = (%_DebugIsActive() != 0); 305 define DEBUG_IS_ACTIVE = (%_DebugIsActive() != 0);
320 macro DEBUG_IS_STEPPING(function) = (%_DebugIsActive() != 0 && %DebugCallbackSup portsStepping(function)); 306 macro DEBUG_IS_STEPPING(function) = (%_DebugIsActive() != 0 && %DebugCallbackSup portsStepping(function));
321 macro DEBUG_PREPARE_STEP_IN_IF_STEPPING(function) = if (%_DebugIsActive() != 0) %DebugPrepareStepInIfStepping(function); 307 macro DEBUG_PREPARE_STEP_IN_IF_STEPPING(function) = if (%_DebugIsActive() != 0) %DebugPrepareStepInIfStepping(function);
322 308
323 # SharedFlag equivalents 309 # SharedFlag equivalents
324 define kNotShared = false; 310 define kNotShared = false;
325 define kShared = true; 311 define kShared = true;
OLDNEW
« no previous file with comments | « src/js/harmony-regexp.js ('k') | src/js/prologue.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698