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

Unified Diff: runtime/lib/regexp.cc

Issue 11293290: Fix native argument handling (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 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
« no previous file with comments | « runtime/lib/object.cc ('k') | runtime/lib/string.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/lib/regexp.cc
===================================================================
--- runtime/lib/regexp.cc (revision 14922)
+++ runtime/lib/regexp.cc (working copy)
@@ -21,12 +21,13 @@
DEFINE_NATIVE_ENTRY(JSSyntaxRegExp_factory, 4) {
- ASSERT(AbstractTypeArguments::CheckedHandle(arguments->At(0)).IsNull());
- const Instance& arg1 = Instance::CheckedHandle(arguments->At(1));
+ ASSERT(AbstractTypeArguments::CheckedHandle(
+ arguments->NativeArgAt(0)).IsNull());
+ const Instance& arg1 = Instance::CheckedHandle(arguments->NativeArgAt(1));
CheckAndThrowExceptionIfNull(arg1);
- GET_NATIVE_ARGUMENT(String, pattern, arguments->At(1));
- GET_NATIVE_ARGUMENT(Instance, handle_multi_line, arguments->At(2));
- GET_NATIVE_ARGUMENT(Instance, handle_ignore_case, arguments->At(3));
+ GET_NATIVE_ARGUMENT(String, pattern, arguments->NativeArgAt(1));
+ GET_NATIVE_ARGUMENT(Instance, handle_multi_line, arguments->NativeArgAt(2));
+ GET_NATIVE_ARGUMENT(Instance, handle_ignore_case, arguments->NativeArgAt(3));
bool ignore_case = handle_ignore_case.raw() == Bool::True();
bool multi_line = handle_multi_line.raw() == Bool::True();
return Jscre::Compile(pattern, multi_line, ignore_case);
@@ -34,28 +35,28 @@
DEFINE_NATIVE_ENTRY(JSSyntaxRegExp_getPattern, 1) {
- const JSRegExp& regexp = JSRegExp::CheckedHandle(arguments->At(0));
+ const JSRegExp& regexp = JSRegExp::CheckedHandle(arguments->NativeArgAt(0));
ASSERT(!regexp.IsNull());
return regexp.pattern();
}
DEFINE_NATIVE_ENTRY(JSSyntaxRegExp_multiLine, 1) {
- const JSRegExp& regexp = JSRegExp::CheckedHandle(arguments->At(0));
+ const JSRegExp& regexp = JSRegExp::CheckedHandle(arguments->NativeArgAt(0));
ASSERT(!regexp.IsNull());
return Bool::Get(regexp.is_multi_line());
}
DEFINE_NATIVE_ENTRY(JSSyntaxRegExp_ignoreCase, 1) {
- const JSRegExp& regexp = JSRegExp::CheckedHandle(arguments->At(0));
+ const JSRegExp& regexp = JSRegExp::CheckedHandle(arguments->NativeArgAt(0));
ASSERT(!regexp.IsNull());
return Bool::Get(regexp.is_ignore_case());
}
DEFINE_NATIVE_ENTRY(JSSyntaxRegExp_getGroupCount, 1) {
- const JSRegExp& regexp = JSRegExp::CheckedHandle(arguments->At(0));
+ const JSRegExp& regexp = JSRegExp::CheckedHandle(arguments->NativeArgAt(0));
ASSERT(!regexp.IsNull());
if (regexp.is_initialized()) {
return regexp.num_bracket_expressions();
@@ -72,12 +73,12 @@
DEFINE_NATIVE_ENTRY(JSSyntaxRegExp_ExecuteMatch, 3) {
- const JSRegExp& regexp = JSRegExp::CheckedHandle(arguments->At(0));
+ const JSRegExp& regexp = JSRegExp::CheckedHandle(arguments->NativeArgAt(0));
ASSERT(!regexp.IsNull());
- const Instance& arg1 = Instance::CheckedHandle(arguments->At(1));
+ const Instance& arg1 = Instance::CheckedHandle(arguments->NativeArgAt(1));
CheckAndThrowExceptionIfNull(arg1);
- GET_NATIVE_ARGUMENT(String, str, arguments->At(1));
- GET_NATIVE_ARGUMENT(Smi, start_index, arguments->At(2));
+ GET_NATIVE_ARGUMENT(String, str, arguments->NativeArgAt(1));
+ GET_NATIVE_ARGUMENT(Smi, start_index, arguments->NativeArgAt(2));
return Jscre::Execute(regexp, str, start_index.Value());
}
« no previous file with comments | « runtime/lib/object.cc ('k') | runtime/lib/string.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698