Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(508)

Unified Diff: src/ic.cc

Issue 12040042: Merged r13480, r13481 into trunk branch. (Closed) Base URL: https://v8.googlecode.com/svn/trunk
Patch Set: Created 7 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/ic.h ('k') | src/mark-compact.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ic.cc
diff --git a/src/ic.cc b/src/ic.cc
index b90436ae42c5f38feed72cf4d44be0d6f6b8b04f..17d2bb45ee5ce661cd516532ce18c8cbf273f8eb 100644
--- a/src/ic.cc
+++ b/src/ic.cc
@@ -542,7 +542,7 @@ MaybeObject* CallICBase::LoadFunction(State state,
if (!lookup.IsFound()) {
// If the object does not have the requested property, check which
// exception we need to throw.
- return IsContextual(object)
+ return IsUndeclaredGlobal(object)
? ReferenceError("not_defined", name)
: TypeError("undefined_method", object, name);
}
@@ -561,7 +561,7 @@ MaybeObject* CallICBase::LoadFunction(State state,
if (lookup.IsInterceptor() && attr == ABSENT) {
// If the object does not have the requested property, check which
// exception we need to throw.
- return IsContextual(object)
+ return IsUndeclaredGlobal(object)
? ReferenceError("not_defined", name)
: TypeError("undefined_method", object, name);
}
@@ -933,7 +933,7 @@ MaybeObject* IC::Load(State state,
// If we did not find a property, check if we need to throw an exception.
if (!lookup.IsFound()) {
- if (IsContextual(object)) {
+ if (IsUndeclaredGlobal(object)) {
return ReferenceError("not_defined", name);
}
LOG(isolate(), SuspectReadEvent(*name, *object));
@@ -952,7 +952,7 @@ MaybeObject* IC::Load(State state,
RETURN_IF_EMPTY_HANDLE(isolate(), result);
// If the property is not present, check if we need to throw an
// exception.
- if (attr == ABSENT && IsContextual(object)) {
+ if (attr == ABSENT && IsUndeclaredGlobal(object)) {
return ReferenceError("not_defined", name);
}
return *result;
@@ -1390,11 +1390,8 @@ MaybeObject* IC::Store(State state,
if (FLAG_use_ic) {
UpdateStoreCaches(&lookup, state, strict_mode, receiver, name, value);
}
- } else if (strict_mode == kStrictMode &&
- !lookup.IsFound() &&
- IsContextual(object)) {
- // Strict mode doesn't allow setting non-existent global property
- // or an assignment to a read only property.
+ } else if (strict_mode == kStrictMode && IsUndeclaredGlobal(object)) {
+ // Strict mode doesn't allow setting non-existent global property.
return ReferenceError("not_defined", name);
}
« no previous file with comments | « src/ic.h ('k') | src/mark-compact.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698