Commit b38b81bb authored by verwaest@chromium.org's avatar verwaest@chromium.org

Always cache the original target in a handle on the IC.

This requires us to always open a handle-scope in the miss handlers.

BUG=
R=ulan@chromium.org

Review URL: https://chromiumcodereview.appspot.com/25238002

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@17037 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 14422a69
This diff is collapsed.
...@@ -95,7 +95,9 @@ class IC { ...@@ -95,7 +95,9 @@ class IC {
virtual ~IC() {} virtual ~IC() {}
// Get the call-site target; used for determining the state. // Get the call-site target; used for determining the state.
Code* target() const { return GetTargetAtAddress(address()); } Handle<Code> target() const { return target_; }
Code* raw_target() const { return GetTargetAtAddress(address()); }
inline Address address() const; inline Address address() const;
// Compute the current IC state based on the target stub, receiver and name. // Compute the current IC state based on the target stub, receiver and name.
...@@ -210,6 +212,9 @@ class IC { ...@@ -210,6 +212,9 @@ class IC {
Isolate* isolate_; Isolate* isolate_;
// The original code target that missed.
Handle<Code> target_;
DISALLOW_IMPLICIT_CONSTRUCTORS(IC); DISALLOW_IMPLICIT_CONSTRUCTORS(IC);
}; };
......
...@@ -1257,12 +1257,12 @@ static MaybeObject* ThrowReferenceError(Isolate* isolate, Name* name) { ...@@ -1257,12 +1257,12 @@ static MaybeObject* ThrowReferenceError(Isolate* isolate, Name* name) {
// If the load is non-contextual, just return the undefined result. // If the load is non-contextual, just return the undefined result.
// Note that both keyed and non-keyed loads may end up here, so we // Note that both keyed and non-keyed loads may end up here, so we
// can't use either LoadIC or KeyedLoadIC constructors. // can't use either LoadIC or KeyedLoadIC constructors.
HandleScope scope(isolate);
IC ic(IC::NO_EXTRA_FRAME, isolate); IC ic(IC::NO_EXTRA_FRAME, isolate);
ASSERT(ic.target()->is_load_stub() || ic.target()->is_keyed_load_stub()); ASSERT(ic.target()->is_load_stub() || ic.target()->is_keyed_load_stub());
if (!ic.SlowIsUndeclaredGlobal()) return isolate->heap()->undefined_value(); if (!ic.SlowIsUndeclaredGlobal()) return isolate->heap()->undefined_value();
// Throw a reference error. // Throw a reference error.
HandleScope scope(isolate);
Handle<Name> name_handle(name); Handle<Name> name_handle(name);
Handle<Object> error = Handle<Object> error =
isolate->factory()->NewReferenceError("not_defined", isolate->factory()->NewReferenceError("not_defined",
......
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