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

Unified Diff: src/parser.cc

Issue 12095035: %X => %_X, %_X => %__X (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: addressed comments Created 7 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/ia32/full-codegen-ia32.cc ('k') | src/runtime.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/parser.cc
diff --git a/src/parser.cc b/src/parser.cc
index 29b1fe74c6058a344f12d75e5d9407f0b86d1ae6..722e374f72a4f1554172ce4ed24d2e25b61d8229 100644
--- a/src/parser.cc
+++ b/src/parser.cc
@@ -4627,7 +4627,7 @@ Expression* Parser::ParseV8Intrinsic(bool* ok) {
function->function_id == Runtime::kIS_VAR) {
// %IS_VAR(x) evaluates to x if x is a variable,
// leads to a parse error otherwise. Could be implemented as an
- // inline function %_IS_VAR(x) to eliminate this special case.
+ // inline function %__IS_VAR(x) to eliminate this special case.
if (args->length() == 1 && args->at(0)->AsVariableProxy() != NULL) {
return args->at(0);
} else {
@@ -4646,11 +4646,16 @@ Expression* Parser::ParseV8Intrinsic(bool* ok) {
return NULL;
}
- // Check that the function is defined if it's an inline runtime call.
- if (function == NULL && name->Get(0) == '_') {
- ReportMessage("not_defined", Vector<Handle<String> >(&name, 1));
- *ok = false;
- return NULL;
+ if (function == NULL && name->length() > 0 && name->Get(0) == '_') {
+ // Check that the function is defined if it's an inline runtime call.
+ if (name->length() > 1 && name->Get(1) == '_') {
+ ReportMessage("not_defined", Vector<Handle<String> >(&name, 1));
+ *ok = false;
+ return NULL;
+ }
+ // Assume this is a runtime-js function called via %_name.
+ name = isolate()->factory()->NewSubString(name, 1, name->length());
+ name = isolate()->factory()->LookupSymbol(name);
}
// We have a valid intrinsics call or a call to a builtin.
« no previous file with comments | « src/ia32/full-codegen-ia32.cc ('k') | src/runtime.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698