| Index: src/ic.cc
|
| diff --git a/src/ic.cc b/src/ic.cc
|
| index 807bde0577278db92c7589ca4ab099bff0bb4d36..017a8fb894e1042630d414d2970246f3037df5fc 100644
|
| --- a/src/ic.cc
|
| +++ b/src/ic.cc
|
| @@ -185,6 +185,14 @@ Address IC::OriginalCodeAddress() const {
|
| #endif
|
|
|
|
|
| +bool IC::IsContextualLoad() const {
|
| + if (IsLoadStub()) {
|
| + return LoadIC::GetContextualMode(extra_ic_state()) == CONTEXTUAL;
|
| + }
|
| + return false;
|
| +}
|
| +
|
| +
|
| static bool HasInterceptorGetter(JSObject* object) {
|
| return !object->GetNamedInterceptor()->getter()->IsUndefined();
|
| }
|
| @@ -626,7 +634,7 @@ MaybeObject* CallICBase::LoadFunction(Handle<Object> object,
|
| if (!lookup.IsFound()) {
|
| // If the object does not have the requested property, check which
|
| // exception we need to throw.
|
| - return IsUndeclaredGlobal(object)
|
| + return object->IsGlobalObject()
|
| ? ReferenceError("not_defined", name)
|
| : TypeError("undefined_method", object, name);
|
| }
|
| @@ -643,7 +651,7 @@ MaybeObject* CallICBase::LoadFunction(Handle<Object> object,
|
| if (lookup.IsInterceptor() && attr == ABSENT) {
|
| // If the object does not have the requested property, check which
|
| // exception we need to throw.
|
| - return IsUndeclaredGlobal(object)
|
| + return object->IsGlobalObject()
|
| ? ReferenceError("not_defined", name)
|
| : TypeError("undefined_method", object, name);
|
| }
|
| @@ -1102,7 +1110,7 @@ void IC::PatchCache(Handle<Type> type,
|
|
|
| Handle<Code> LoadIC::initialize_stub(Isolate* isolate, ContextualMode mode) {
|
| Handle<Code> ic = isolate->stub_cache()->ComputeLoad(
|
| - UNINITIALIZED, IC::ComputeExtraICState(mode));
|
| + UNINITIALIZED, LoadIC::ComputeExtraICState(mode));
|
| return ic;
|
| }
|
|
|
| @@ -1110,7 +1118,7 @@ Handle<Code> LoadIC::initialize_stub(Isolate* isolate, ContextualMode mode) {
|
| Handle<Code> LoadIC::pre_monomorphic_stub(Isolate* isolate,
|
| ContextualMode mode) {
|
| return isolate->stub_cache()->ComputeLoad(
|
| - PREMONOMORPHIC, IC::ComputeExtraICState(mode));
|
| + PREMONOMORPHIC, LoadIC::ComputeExtraICState(mode));
|
| }
|
|
|
|
|
| @@ -1570,7 +1578,7 @@ MaybeObject* StoreIC::Store(Handle<Object> object,
|
| if (!can_store &&
|
| strict_mode() == kStrictMode &&
|
| !(lookup.IsProperty() && lookup.IsReadOnly()) &&
|
| - IsUndeclaredGlobal(object)) {
|
| + object->IsGlobalObject()) {
|
| // Strict mode doesn't allow setting non-existent global property.
|
| return ReferenceError("not_defined", name);
|
| }
|
| @@ -1598,9 +1606,8 @@ MaybeObject* StoreIC::Store(Handle<Object> object,
|
|
|
|
|
| Handle<Code> StoreIC::initialize_stub(Isolate* isolate,
|
| - StrictModeFlag strict_mode,
|
| - ContextualMode mode) {
|
| - ExtraICState extra_state = ComputeExtraICState(strict_mode, mode);
|
| + StrictModeFlag strict_mode) {
|
| + ExtraICState extra_state = ComputeExtraICState(strict_mode);
|
| Handle<Code> ic = isolate->stub_cache()->ComputeStore(
|
| UNINITIALIZED, extra_state);
|
| return ic;
|
| @@ -1618,10 +1625,8 @@ Handle<Code> StoreIC::generic_stub() const {
|
|
|
|
|
| Handle<Code> StoreIC::pre_monomorphic_stub(Isolate* isolate,
|
| - StrictModeFlag strict_mode,
|
| - ContextualMode contextual_mode) {
|
| - ExtraICState state = StoreIC::ComputeExtraICState(strict_mode,
|
| - contextual_mode);
|
| + StrictModeFlag strict_mode) {
|
| + ExtraICState state = StoreIC::ComputeExtraICState(strict_mode);
|
| return isolate->stub_cache()->ComputeStore(PREMONOMORPHIC, state);
|
| }
|
|
|
|
|