Revision: 5557
Author: [email protected]
Date: Wed Sep 29 10:38:37 2010
Log: Remove some unused fields from class CompilationInfo.

Review URL: http://codereview.chromium.org/3533007
http://code.google.com/p/v8/source/detail?r=5557

Modified:
 /branches/bleeding_edge/src/compiler.h
 /branches/bleeding_edge/src/handles.cc
 /branches/bleeding_edge/src/handles.h
 /branches/bleeding_edge/src/ic.cc
 /branches/bleeding_edge/src/runtime.cc

=======================================
--- /branches/bleeding_edge/src/compiler.h      Fri Aug 13 02:07:09 2010
+++ /branches/bleeding_edge/src/compiler.h      Wed Sep 29 10:38:37 2010
@@ -42,15 +42,11 @@
 class CompilationInfo BASE_EMBEDDED {
  public:
   // Lazy compilation of a JSFunction.
-  CompilationInfo(Handle<JSFunction> closure,
-                  int loop_nesting,
-                  Handle<Object> receiver)
+  CompilationInfo(Handle<JSFunction> closure, int loop_nesting)
       : closure_(closure),
         function_(NULL),
         is_eval_(false),
-        loop_nesting_(loop_nesting),
-        receiver_(receiver) {
-    Initialize();
+        loop_nesting_(loop_nesting) {
     ASSERT(!closure_.is_null() &&
            shared_info_.is_null() &&
            script_.is_null());
@@ -62,7 +58,6 @@
         function_(NULL),
         is_eval_(false),
         loop_nesting_(0) {
-    Initialize();
     ASSERT(closure_.is_null() &&
            !shared_info_.is_null() &&
            script_.is_null());
@@ -74,7 +69,6 @@
         function_(literal),
         is_eval_(is_eval),
         loop_nesting_(0) {
-    Initialize();
     ASSERT(closure_.is_null() &&
            shared_info_.is_null() &&
            !script_.is_null());
@@ -112,11 +106,6 @@
   // Simple accessors.
   bool is_eval() { return is_eval_; }
   int loop_nesting() { return loop_nesting_; }
-  bool has_receiver() { return !receiver_.is_null(); }
-  Handle<Object> receiver() { return receiver_; }
-
-  bool has_this_properties() { return has_this_properties_; }
-  void set_has_this_properties(bool flag) { has_this_properties_ = flag; }

   bool has_global_object() {
return !closure().is_null() && (closure()->context()->global() != NULL);
@@ -125,19 +114,11 @@
   GlobalObject* global_object() {
     return has_global_object() ? closure()->context()->global() : NULL;
   }
-
-  bool has_globals() { return has_globals_; }
-  void set_has_globals(bool flag) { has_globals_ = flag; }

   // Derived accessors.
   Scope* scope() { return function()->scope(); }

  private:
-  void Initialize() {
-    has_this_properties_ = false;
-    has_globals_ = false;
-  }
-
   Handle<JSFunction> closure_;
   Handle<SharedFunctionInfo> shared_info_;
   Handle<Script> script_;
@@ -147,11 +128,6 @@
   bool is_eval_;
   int loop_nesting_;

-  Handle<Object> receiver_;
-
-  bool has_this_properties_;
-  bool has_globals_;
-
   DISALLOW_COPY_AND_ASSIGN(CompilationInfo);
 };

=======================================
--- /branches/bleeding_edge/src/handles.cc      Thu Sep 23 02:15:26 2010
+++ /branches/bleeding_edge/src/handles.cc      Wed Sep 29 10:38:37 2010
@@ -785,14 +785,13 @@


 bool CompileLazy(Handle<JSFunction> function,
-                 Handle<Object> receiver,
                  ClearExceptionFlag flag) {
   if (function->shared()->is_compiled()) {
     function->set_code(function->shared()->code());
     function->shared()->set_code_age(0);
     return true;
   } else {
-    CompilationInfo info(function, 0, receiver);
+    CompilationInfo info(function, 0);
     bool result = CompileLazyHelper(&info, flag);
     PROFILE(FunctionCreateEvent(*function));
     return result;
@@ -801,14 +800,13 @@


 bool CompileLazyInLoop(Handle<JSFunction> function,
-                       Handle<Object> receiver,
                        ClearExceptionFlag flag) {
   if (function->shared()->is_compiled()) {
     function->set_code(function->shared()->code());
     function->shared()->set_code_age(0);
     return true;
   } else {
-    CompilationInfo info(function, 1, receiver);
+    CompilationInfo info(function, 1);
     bool result = CompileLazyHelper(&info, flag);
     PROFILE(FunctionCreateEvent(*function));
     return result;
=======================================
--- /branches/bleeding_edge/src/handles.h       Wed Aug 11 06:48:58 2010
+++ /branches/bleeding_edge/src/handles.h       Wed Sep 29 10:38:37 2010
@@ -345,13 +345,9 @@
 bool CompileLazyShared(Handle<SharedFunctionInfo> shared,
                        ClearExceptionFlag flag);

-bool CompileLazy(Handle<JSFunction> function,
-                 Handle<Object> receiver,
-                 ClearExceptionFlag flag);
-
-bool CompileLazyInLoop(Handle<JSFunction> function,
-                       Handle<Object> receiver,
-                       ClearExceptionFlag flag);
+bool CompileLazy(Handle<JSFunction> function, ClearExceptionFlag flag);
+
+bool CompileLazyInLoop(Handle<JSFunction> function, ClearExceptionFlag flag);

 class NoHandleAllocation BASE_EMBEDDED {
  public:
=======================================
--- /branches/bleeding_edge/src/ic.cc   Mon Sep 20 06:50:27 2010
+++ /branches/bleeding_edge/src/ic.cc   Wed Sep 29 10:38:37 2010
@@ -1541,18 +1541,17 @@
 // Static IC stub generators.
 //

-static Object* CompileFunction(Object* result,
-                               Handle<Object> object,
-                               InLoopFlag in_loop) {
+static JSFunction* CompileFunction(JSFunction* function,
+                                   InLoopFlag in_loop) {
   // Compile now with optimization.
   HandleScope scope;
- Handle<JSFunction> function = Handle<JSFunction>(JSFunction::cast(result));
+  Handle<JSFunction> function_handle(function);
   if (in_loop == IN_LOOP) {
-    CompileLazyInLoop(function, object, CLEAR_EXCEPTION);
+    CompileLazyInLoop(function_handle, CLEAR_EXCEPTION);
   } else {
-    CompileLazy(function, object, CLEAR_EXCEPTION);
-  }
-  return *function;
+    CompileLazy(function_handle, CLEAR_EXCEPTION);
+  }
+  return *function_handle;
 }


@@ -1575,7 +1574,7 @@
   if (!result->IsJSFunction() || JSFunction::cast(result)->is_compiled()) {
     return result;
   }
- return CompileFunction(result, args.at<Object>(0), ic.target()->ic_in_loop()); + return CompileFunction(JSFunction::cast(result), ic.target()->ic_in_loop());
 }


@@ -1591,7 +1590,7 @@
   if (!result->IsJSFunction() || JSFunction::cast(result)->is_compiled()) {
     return result;
   }
- return CompileFunction(result, args.at<Object>(0), ic.target()->ic_in_loop()); + return CompileFunction(JSFunction::cast(result), ic.target()->ic_in_loop());
 }


=======================================
--- /branches/bleeding_edge/src/runtime.cc      Wed Sep 29 03:57:23 2010
+++ /branches/bleeding_edge/src/runtime.cc      Wed Sep 29 10:38:37 2010
@@ -6374,7 +6374,7 @@
   // this means that things called through constructors are never known to
// be in loops. We compile them as if they are in loops here just in case.
   ASSERT(!function->is_compiled());
- if (!CompileLazyInLoop(function, Handle<Object>::null(), KEEP_EXCEPTION)) {
+  if (!CompileLazyInLoop(function, KEEP_EXCEPTION)) {
     return Failure::Exception();
   }

--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev

Reply via email to