Remove some unused fields from class CompilationInfo.

Review URL: http://codereview.chromium.org/3533007

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5557 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 35672077
...@@ -42,15 +42,11 @@ namespace internal { ...@@ -42,15 +42,11 @@ namespace internal {
class CompilationInfo BASE_EMBEDDED { class CompilationInfo BASE_EMBEDDED {
public: public:
// Lazy compilation of a JSFunction. // Lazy compilation of a JSFunction.
CompilationInfo(Handle<JSFunction> closure, CompilationInfo(Handle<JSFunction> closure, int loop_nesting)
int loop_nesting,
Handle<Object> receiver)
: closure_(closure), : closure_(closure),
function_(NULL), function_(NULL),
is_eval_(false), is_eval_(false),
loop_nesting_(loop_nesting), loop_nesting_(loop_nesting) {
receiver_(receiver) {
Initialize();
ASSERT(!closure_.is_null() && ASSERT(!closure_.is_null() &&
shared_info_.is_null() && shared_info_.is_null() &&
script_.is_null()); script_.is_null());
...@@ -62,7 +58,6 @@ class CompilationInfo BASE_EMBEDDED { ...@@ -62,7 +58,6 @@ class CompilationInfo BASE_EMBEDDED {
function_(NULL), function_(NULL),
is_eval_(false), is_eval_(false),
loop_nesting_(0) { loop_nesting_(0) {
Initialize();
ASSERT(closure_.is_null() && ASSERT(closure_.is_null() &&
!shared_info_.is_null() && !shared_info_.is_null() &&
script_.is_null()); script_.is_null());
...@@ -74,7 +69,6 @@ class CompilationInfo BASE_EMBEDDED { ...@@ -74,7 +69,6 @@ class CompilationInfo BASE_EMBEDDED {
function_(literal), function_(literal),
is_eval_(is_eval), is_eval_(is_eval),
loop_nesting_(0) { loop_nesting_(0) {
Initialize();
ASSERT(closure_.is_null() && ASSERT(closure_.is_null() &&
shared_info_.is_null() && shared_info_.is_null() &&
!script_.is_null()); !script_.is_null());
...@@ -112,11 +106,6 @@ class CompilationInfo BASE_EMBEDDED { ...@@ -112,11 +106,6 @@ class CompilationInfo BASE_EMBEDDED {
// Simple accessors. // Simple accessors.
bool is_eval() { return is_eval_; } bool is_eval() { return is_eval_; }
int loop_nesting() { return loop_nesting_; } 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() { bool has_global_object() {
return !closure().is_null() && (closure()->context()->global() != NULL); return !closure().is_null() && (closure()->context()->global() != NULL);
...@@ -126,18 +115,10 @@ class CompilationInfo BASE_EMBEDDED { ...@@ -126,18 +115,10 @@ class CompilationInfo BASE_EMBEDDED {
return has_global_object() ? closure()->context()->global() : NULL; 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. // Derived accessors.
Scope* scope() { return function()->scope(); } Scope* scope() { return function()->scope(); }
private: private:
void Initialize() {
has_this_properties_ = false;
has_globals_ = false;
}
Handle<JSFunction> closure_; Handle<JSFunction> closure_;
Handle<SharedFunctionInfo> shared_info_; Handle<SharedFunctionInfo> shared_info_;
Handle<Script> script_; Handle<Script> script_;
...@@ -147,11 +128,6 @@ class CompilationInfo BASE_EMBEDDED { ...@@ -147,11 +128,6 @@ class CompilationInfo BASE_EMBEDDED {
bool is_eval_; bool is_eval_;
int loop_nesting_; int loop_nesting_;
Handle<Object> receiver_;
bool has_this_properties_;
bool has_globals_;
DISALLOW_COPY_AND_ASSIGN(CompilationInfo); DISALLOW_COPY_AND_ASSIGN(CompilationInfo);
}; };
......
...@@ -785,14 +785,13 @@ bool CompileLazyShared(Handle<SharedFunctionInfo> shared, ...@@ -785,14 +785,13 @@ bool CompileLazyShared(Handle<SharedFunctionInfo> shared,
bool CompileLazy(Handle<JSFunction> function, bool CompileLazy(Handle<JSFunction> function,
Handle<Object> receiver,
ClearExceptionFlag flag) { ClearExceptionFlag flag) {
if (function->shared()->is_compiled()) { if (function->shared()->is_compiled()) {
function->set_code(function->shared()->code()); function->set_code(function->shared()->code());
function->shared()->set_code_age(0); function->shared()->set_code_age(0);
return true; return true;
} else { } else {
CompilationInfo info(function, 0, receiver); CompilationInfo info(function, 0);
bool result = CompileLazyHelper(&info, flag); bool result = CompileLazyHelper(&info, flag);
PROFILE(FunctionCreateEvent(*function)); PROFILE(FunctionCreateEvent(*function));
return result; return result;
...@@ -801,14 +800,13 @@ bool CompileLazy(Handle<JSFunction> function, ...@@ -801,14 +800,13 @@ bool CompileLazy(Handle<JSFunction> function,
bool CompileLazyInLoop(Handle<JSFunction> function, bool CompileLazyInLoop(Handle<JSFunction> function,
Handle<Object> receiver,
ClearExceptionFlag flag) { ClearExceptionFlag flag) {
if (function->shared()->is_compiled()) { if (function->shared()->is_compiled()) {
function->set_code(function->shared()->code()); function->set_code(function->shared()->code());
function->shared()->set_code_age(0); function->shared()->set_code_age(0);
return true; return true;
} else { } else {
CompilationInfo info(function, 1, receiver); CompilationInfo info(function, 1);
bool result = CompileLazyHelper(&info, flag); bool result = CompileLazyHelper(&info, flag);
PROFILE(FunctionCreateEvent(*function)); PROFILE(FunctionCreateEvent(*function));
return result; return result;
......
...@@ -345,13 +345,9 @@ bool EnsureCompiled(Handle<SharedFunctionInfo> shared, ...@@ -345,13 +345,9 @@ bool EnsureCompiled(Handle<SharedFunctionInfo> shared,
bool CompileLazyShared(Handle<SharedFunctionInfo> shared, bool CompileLazyShared(Handle<SharedFunctionInfo> shared,
ClearExceptionFlag flag); ClearExceptionFlag flag);
bool CompileLazy(Handle<JSFunction> function, bool CompileLazy(Handle<JSFunction> function, ClearExceptionFlag flag);
Handle<Object> receiver,
ClearExceptionFlag flag);
bool CompileLazyInLoop(Handle<JSFunction> function, bool CompileLazyInLoop(Handle<JSFunction> function, ClearExceptionFlag flag);
Handle<Object> receiver,
ClearExceptionFlag flag);
class NoHandleAllocation BASE_EMBEDDED { class NoHandleAllocation BASE_EMBEDDED {
public: public:
......
...@@ -1541,18 +1541,17 @@ void KeyedStoreIC::UpdateCaches(LookupResult* lookup, ...@@ -1541,18 +1541,17 @@ void KeyedStoreIC::UpdateCaches(LookupResult* lookup,
// Static IC stub generators. // Static IC stub generators.
// //
static Object* CompileFunction(Object* result, static JSFunction* CompileFunction(JSFunction* function,
Handle<Object> object,
InLoopFlag in_loop) { InLoopFlag in_loop) {
// Compile now with optimization. // Compile now with optimization.
HandleScope scope; HandleScope scope;
Handle<JSFunction> function = Handle<JSFunction>(JSFunction::cast(result)); Handle<JSFunction> function_handle(function);
if (in_loop == IN_LOOP) { if (in_loop == IN_LOOP) {
CompileLazyInLoop(function, object, CLEAR_EXCEPTION); CompileLazyInLoop(function_handle, CLEAR_EXCEPTION);
} else { } else {
CompileLazy(function, object, CLEAR_EXCEPTION); CompileLazy(function_handle, CLEAR_EXCEPTION);
} }
return *function; return *function_handle;
} }
...@@ -1575,7 +1574,7 @@ Object* CallIC_Miss(Arguments args) { ...@@ -1575,7 +1574,7 @@ Object* CallIC_Miss(Arguments args) {
if (!result->IsJSFunction() || JSFunction::cast(result)->is_compiled()) { if (!result->IsJSFunction() || JSFunction::cast(result)->is_compiled()) {
return result; 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 @@ Object* KeyedCallIC_Miss(Arguments args) { ...@@ -1591,7 +1590,7 @@ Object* KeyedCallIC_Miss(Arguments args) {
if (!result->IsJSFunction() || JSFunction::cast(result)->is_compiled()) { if (!result->IsJSFunction() || JSFunction::cast(result)->is_compiled()) {
return result; return result;
} }
return CompileFunction(result, args.at<Object>(0), ic.target()->ic_in_loop()); return CompileFunction(JSFunction::cast(result), ic.target()->ic_in_loop());
} }
......
...@@ -6374,7 +6374,7 @@ static Object* Runtime_LazyCompile(Arguments args) { ...@@ -6374,7 +6374,7 @@ static Object* Runtime_LazyCompile(Arguments args) {
// this means that things called through constructors are never known to // 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. // be in loops. We compile them as if they are in loops here just in case.
ASSERT(!function->is_compiled()); ASSERT(!function->is_compiled());
if (!CompileLazyInLoop(function, Handle<Object>::null(), KEEP_EXCEPTION)) { if (!CompileLazyInLoop(function, KEEP_EXCEPTION)) {
return Failure::Exception(); return Failure::Exception();
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment