Revision: 17033
Author:   [email protected]
Date:     Tue Oct  1 09:27:03 2013 UTC
Log:      Limit entry points into the parser API.

[email protected]

Review URL: https://codereview.chromium.org/24104006
http://code.google.com/p/v8/source/detail?r=17033

Modified:
 /branches/bleeding_edge/src/parser.cc
 /branches/bleeding_edge/src/parser.h
 /branches/bleeding_edge/test/cctest/test-parsing.cc

=======================================
--- /branches/bleeding_edge/src/parser.cc       Mon Sep 30 17:42:58 2013 UTC
+++ /branches/bleeding_edge/src/parser.cc       Tue Oct  1 09:27:03 2013 UTC
@@ -3170,8 +3170,7 @@
       if (op == Token::NOT) {
         // Convert the literal to a boolean condition and negate it.
         bool condition = literal->BooleanValue();
-        Handle<Object> result(isolate()->heap()->ToBoolean(!condition),
-                              isolate());
+ Handle<Object> result = isolate()->factory()->ToBoolean(!condition);
         return factory()->NewLiteral(result);
       } else if (literal->IsNumber()) {
         // Compute some expressions involving only number literals.
=======================================
--- /branches/bleeding_edge/src/parser.h        Wed Sep  4 07:05:11 2013 UTC
+++ /branches/bleeding_edge/src/parser.h        Tue Oct  1 09:27:03 2013 UTC
@@ -461,9 +461,6 @@
   static bool Parse(CompilationInfo* info) { return Parser(info).Parse(); }
   bool Parse();

-  // Returns NULL if parsing failed.
-  FunctionLiteral* ParseProgram();
-
   void ReportMessageAt(Scanner::Location loc,
                        const char* message,
                        Vector<const char*> args);
@@ -568,6 +565,9 @@
     Mode old_mode_;
   };

+  // Returns NULL if parsing failed.
+  FunctionLiteral* ParseProgram();
+
   FunctionLiteral* ParseLazy();
   FunctionLiteral* ParseLazy(Utf16CharacterStream* source);

=======================================
--- /branches/bleeding_edge/test/cctest/test-parsing.cc Thu Sep 19 09:17:13 2013 UTC +++ /branches/bleeding_edge/test/cctest/test-parsing.cc Tue Oct 1 09:27:03 2013 UTC
@@ -1027,11 +1027,11 @@
     parser.set_allow_harmony_scoping(true);
     info.MarkAsGlobal();
     info.SetLanguageMode(source_data[i].language_mode);
-    i::FunctionLiteral* function = parser.ParseProgram();
-    CHECK(function != NULL);
+    parser.Parse();
+    CHECK(info.function() != NULL);

     // Check scope types and positions.
-    i::Scope* scope = function->scope();
+    i::Scope* scope = info.function()->scope();
     CHECK(scope->is_global_scope());
     CHECK_EQ(scope->start_position(), 0);
     CHECK_EQ(scope->end_position(), kProgramSize);
@@ -1137,7 +1137,8 @@
     i::Parser parser(&info);
     SET_PARSER_FLAGS(parser, flags);
     info.MarkAsGlobal();
-    function = parser.ParseProgram();
+    parser.Parse();
+    function = info.function();
   }

   // Check that preparsing fails iff parsing fails.

--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to