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

Unified Diff: src/js/macros.py

Issue 1419823010: Implement flag and source getters on RegExp.prototype. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@rproto
Patch Set: new webkit expectations 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 side-by-side diff with in-line comments
Download patch
Index: src/js/macros.py
diff --git a/src/js/macros.py b/src/js/macros.py
index f9bb12b705023c348d43a165c46b416aa2ec99d6..95b23a1443f036ad4b328a2889bf1c1ab1242e45 100644
--- a/src/js/macros.py
+++ b/src/js/macros.py
@@ -181,6 +181,14 @@ python macro CHAR_CODE(str) = ord(str[1]);
define REGEXP_NUMBER_OF_CAPTURES = 0;
define REGEXP_FIRST_CAPTURE = 3;
+# Macros for internal slot access.
+macro REGEXP_GLOBAL(regexp) = (regexp[regExpFlagsSymbol] & 1);
+macro REGEXP_IGNORE_CASE(regexp) = (regexp[regExpFlagsSymbol] & 2);
+macro REGEXP_MULTILINE(regexp) = (regexp[regExpFlagsSymbol] & 4);
+macro REGEXP_STICKY(regexp) = (regexp[regExpFlagsSymbol] & 8);
+macro REGEXP_UNICODE(regexp) = (regexp[regExpFlagsSymbol] & 16);
+macro REGEXP_SOURCE(regexp) = (regexp[regExpSourceSymbol]);
+
# We can't put macros in macros so we use constants here.
# REGEXP_NUMBER_OF_CAPTURES
macro NUMBER_OF_CAPTURES(array) = ((array)[0]);
« src/bootstrapper.cc ('K') | « 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