if (!lookup.IsValid()) {
// If the object does not have the requested property, check which
// exception we need to throw.
- if (is_contextual()) {
+ if (IsContextual(object)) {
return ReferenceError("not_defined", name);
}
return TypeError("undefined_method", object, name);
// If the object does not have the requested property, check which
// exception we need to throw.
if (attr == ABSENT) {
- if (is_contextual()) {
+ if (IsContextual(object)) {
return ReferenceError("not_defined", name);
}
return TypeError("undefined_method", object, name);
// If lookup is invalid, check if we need to throw an exception.
if (!lookup.IsValid()) {
- if (FLAG_strict || is_contextual()) {
+ if (FLAG_strict || IsContextual(object)) {
return ReferenceError("not_defined", name);
}
LOG(SuspectReadEvent(*name, *object));
if (result->IsFailure()) return result;
// If the property is not present, check if we need to throw an
// exception.
- if (attr == ABSENT && is_contextual()) {
+ if (attr == ABSENT && IsContextual(object)) {
return ReferenceError("not_defined", name);
}
return result;
// If lookup is invalid, check if we need to throw an exception.
if (!lookup.IsValid()) {
- if (FLAG_strict || is_contextual()) {
+ if (FLAG_strict || IsContextual(object)) {
return ReferenceError("not_defined", name);
}
}
if (result->IsFailure()) return result;
// If the property is not present, check if we need to throw an
// exception.
- if (attr == ABSENT && is_contextual()) {
+ if (attr == ABSENT && IsContextual(object)) {
return ReferenceError("not_defined", name);
}
return result;
// Returns if this IC is for contextual (no explicit receiver)
// access to properties.
- bool is_contextual() {
+ bool IsContextual(Handle<Object> receiver) {
+ if (receiver->IsGlobalObject()) {
+ return SlowIsContextual();
+ } else {
+ ASSERT(!SlowIsContextual());
+ return false;
+ }
+ }
+
+ bool SlowIsContextual() {
return ComputeMode() == RelocInfo::CODE_TARGET_CONTEXT;
}