Remove obsolete AssertNoContextChangeWithHandleScope.

R=yangguo@chromium.org

Review URL: https://codereview.chromium.org/25513002

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@17050 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 3d92dc27
......@@ -1419,9 +1419,9 @@ class SaveContext BASE_EMBEDDED {
class AssertNoContextChange BASE_EMBEDDED {
#ifdef DEBUG
public:
AssertNoContextChange()
: isolate_(Isolate::Current()),
context_(isolate_->context()) { }
explicit AssertNoContextChange(Isolate* isolate)
: isolate_(isolate),
context_(isolate->context(), isolate) { }
~AssertNoContextChange() {
ASSERT(isolate_->context() == *context_);
}
......@@ -1431,32 +1431,7 @@ class AssertNoContextChange BASE_EMBEDDED {
Handle<Context> context_;
#else
public:
AssertNoContextChange() { }
#endif
};
// TODO(mstarzinger): Depracate as soon as everything is handlified.
class AssertNoContextChangeWithHandleScope BASE_EMBEDDED {
#ifdef DEBUG
public:
AssertNoContextChangeWithHandleScope() :
isolate_(Isolate::Current()),
scope_(isolate_),
context_(isolate_->context(), isolate_) {
}
~AssertNoContextChangeWithHandleScope() {
ASSERT(isolate_->context() == *context_);
}
private:
Isolate* isolate_;
HandleScope scope_;
Handle<Context> context_;
#else
public:
AssertNoContextChangeWithHandleScope() { }
explicit AssertNoContextChange(Isolate* isolate) { }
#endif
};
......
......@@ -807,13 +807,19 @@ MaybeObject* Object::GetProperty(Object* receiver,
LookupResult* result,
Name* name,
PropertyAttributes* attributes) {
// Make sure that the top context does not change when doing
// callbacks or interceptor calls.
AssertNoContextChangeWithHandleScope ncc;
Isolate* isolate = name->GetIsolate();
Heap* heap = isolate->heap();
#ifdef DEBUG
// TODO(mstarzinger): Only because of the AssertNoContextChange, drop as soon
// as this method has been fully handlified.
HandleScope scope(isolate);
#endif
// Make sure that the top context does not change when doing
// callbacks or interceptor calls.
AssertNoContextChange ncc(isolate);
// Traverse the prototype chain from the current object (this) to
// the holder and check for access rights. This avoids traversing the
// objects more than once in case of interceptors, because the
......@@ -3910,7 +3916,7 @@ Handle<Object> JSObject::SetPropertyForResult(Handle<JSObject> object,
// Make sure that the top context does not change when doing callbacks or
// interceptor calls.
AssertNoContextChange ncc;
AssertNoContextChange ncc(isolate);
// Optimization for 2-byte strings often used as keys in a decompression
// dictionary. We internalize these short keys to avoid constantly
......@@ -4068,7 +4074,7 @@ Handle<Object> JSObject::SetLocalPropertyIgnoreAttributes(
// Make sure that the top context does not change when doing callbacks or
// interceptor calls.
AssertNoContextChange ncc;
AssertNoContextChange ncc(isolate);
LookupResult lookup(isolate);
object->LocalLookup(*name, &lookup, true);
......@@ -4202,7 +4208,7 @@ PropertyAttributes JSObject::GetPropertyAttributeWithInterceptor(
// Make sure that the top context does not change when doing
// callbacks or interceptor calls.
AssertNoContextChange ncc;
AssertNoContextChange ncc(isolate);
Handle<InterceptorInfo> interceptor(GetNamedInterceptor());
Handle<JSObject> receiver_handle(receiver);
......@@ -4337,7 +4343,7 @@ PropertyAttributes JSObject::GetElementAttributeWithInterceptor(
// Make sure that the top context does not change when doing
// callbacks or interceptor calls.
AssertNoContextChange ncc;
AssertNoContextChange ncc(isolate);
Handle<InterceptorInfo> interceptor(GetIndexedInterceptor());
Handle<JSReceiver> hreceiver(receiver);
......@@ -5037,7 +5043,7 @@ Handle<Object> JSObject::DeleteElementWithInterceptor(Handle<JSObject> object,
// Make sure that the top context does not change when doing
// callbacks or interceptor calls.
AssertNoContextChange ncc;
AssertNoContextChange ncc(isolate);
Handle<InterceptorInfo> interceptor(object->GetIndexedInterceptor());
if (interceptor->deleter()->IsUndefined()) return factory->false_value();
......@@ -6167,7 +6173,7 @@ void JSObject::DefineAccessor(Handle<JSObject> object,
// Make sure that the top context does not change when doing callbacks or
// interceptor calls.
AssertNoContextChange ncc;
AssertNoContextChange ncc(isolate);
// Try to flatten before operating on the string.
if (name->IsString()) String::cast(*name)->TryFlatten();
......@@ -6353,7 +6359,7 @@ Handle<Object> JSObject::SetAccessor(Handle<JSObject> object,
// Make sure that the top context does not change when doing callbacks or
// interceptor calls.
AssertNoContextChange ncc;
AssertNoContextChange ncc(isolate);
// Try to flatten before operating on the string.
if (name->IsString()) FlattenString(Handle<String>::cast(name));
......@@ -6419,7 +6425,7 @@ Handle<Object> JSObject::GetAccessor(Handle<JSObject> object,
// Make sure that the top context does not change when doing callbacks or
// interceptor calls.
AssertNoContextChange ncc;
AssertNoContextChange ncc(isolate);
// Check access rights if needed.
if (object->IsAccessCheckNeeded() &&
......@@ -11666,7 +11672,7 @@ MaybeObject* JSObject::SetElementWithInterceptor(uint32_t index,
// Make sure that the top context does not change when doing
// callbacks or interceptor calls.
AssertNoContextChange ncc;
AssertNoContextChange ncc(isolate);
Handle<InterceptorInfo> interceptor(GetIndexedInterceptor());
Handle<JSObject> this_handle(this);
......@@ -12678,7 +12684,7 @@ MaybeObject* JSObject::GetElementWithInterceptor(Object* receiver,
// Make sure that the top context does not change when doing
// callbacks or interceptor calls.
AssertNoContextChange ncc;
AssertNoContextChange ncc(isolate);
Handle<InterceptorInfo> interceptor(GetIndexedInterceptor(), isolate);
Handle<Object> this_handle(receiver, isolate);
......
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