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

Unified Diff: src/parser.cc

Issue 159653005: Not for committing. Proof that NaCl stuff is insane. Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: moar Created 6 years, 10 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 | « no previous file | src/preparser.h » ('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 24eaef0c3d34c51e45a11b17fcd121d5a0e9e84e..7eeb37e4b031168ebec36e75f2e3c12c70bb7fa1 100644
--- a/src/parser.cc
+++ b/src/parser.cc
@@ -559,31 +559,38 @@ int ParserTraits::NextMaterializedLiteralIndex() {
void ParserTraits::ReportMessageAt(Scanner::Location source_location,
const char* message,
Vector<const char*> args) {
+ fprintf(stderr, "ParserTraits::ReportMessageAt\n");
MessageLocation location(parser_->script_,
source_location.beg_pos,
source_location.end_pos);
+ fprintf(stderr, "message %s, args len %d\n", message, args.length());
Factory* factory = parser_->isolate()->factory();
Handle<FixedArray> elements = factory->NewFixedArray(args.length());
for (int i = 0; i < args.length(); i++) {
+ fprintf(stderr, "looping %d %s\n", i, args[i]);
Handle<String> arg_string = factory->NewStringFromUtf8(CStrVector(args[i]));
elements->set(i, *arg_string);
}
Handle<JSArray> array = factory->NewJSArrayWithElements(elements);
Handle<Object> result = factory->NewSyntaxError(message, array);
parser_->isolate()->Throw(*result, &location);
+ fprintf(stderr, "ParserTraits::ReportMessageAt returns\n");
}
void ParserTraits::ReportMessage(const char* message,
Vector<Handle<String> > args) {
+ fprintf(stderr, "ParserTraits::ReportMessage\n");
Scanner::Location source_location = parser_->scanner().location();
ReportMessageAt(source_location, message, args);
+ fprintf(stderr, "ParserTraits::ReportMessage returns\n");
}
void ParserTraits::ReportMessageAt(Scanner::Location source_location,
const char* message,
Vector<Handle<String> > args) {
+ fprintf(stderr, "ParserTraits::ReportMessageAtB\n");
MessageLocation location(parser_->script_,
source_location.beg_pos,
source_location.end_pos);
@@ -595,6 +602,7 @@ void ParserTraits::ReportMessageAt(Scanner::Location source_location,
Handle<JSArray> array = factory->NewJSArrayWithElements(elements);
Handle<Object> result = factory->NewSyntaxError(message, array);
parser_->isolate()->Throw(*result, &location);
+ fprintf(stderr, "ParserTraits::ReportMessageAtB returns\n");
}
@@ -3496,10 +3504,25 @@ DebuggerStatement* Parser::ParseDebuggerStatement(bool* ok) {
void Parser::ReportInvalidPreparseData(Handle<String> name, bool* ok) {
+ fprintf(stderr, "ReportInvalidPreparseData\n");
SmartArrayPointer<char> name_string = name->ToCString(DISALLOW_NULLS);
const char* element[1] = { name_string.get() };
- ReportMessage("invalid_preparser_data",
- Vector<const char*>(element, 1));
+ Vector<const char*> args_array(element, 1);
+ fprintf(stderr, "constructed args array, length is %d\n", args_array.length());
+
+ // WTF: Adding this line makes it pass!!!
+ //fprintf(stderr, "args_array is at %p\n", reinterpret_cast<void*>(&args_array));
+
+ // This is not enough:
+ // void* foo = reinterpret_cast<void*>(&args_array);
+ // USE(foo);
+
+ // This is not enough either:
+ // const char* foo = reinterpret_cast<const char*>(&args_array);
+ // foo++;
+
+ ReportMessage("invalid_preparser_data", args_array);
+ fprintf(stderr, "ReportInvalidPreparseData returns\n");
*ok = false;
}
« no previous file with comments | « no previous file | src/preparser.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698