Chromium Code Reviews| Index: src/string-stream.cc |
| diff --git a/src/string-stream.cc b/src/string-stream.cc |
| index 93eb2229e58db1b817ab187537fe3608c979d86d..1f7ede7e67b377b580d948354798eae0b8fad916 100644 |
| --- a/src/string-stream.cc |
| +++ b/src/string-stream.cc |
| @@ -502,14 +502,17 @@ void StringStream::PrintFunction(Object* f, Object* receiver, Code** code) { |
| void StringStream::PrintPrototype(JSFunction* fun, Object* receiver) { |
| + Isolate* isolate = fun->GetIsolate(); |
| + DisallowHeapAllocation no_alloc; |
| + HandleScope scope(isolate); |
| + |
| Object* name = fun->shared()->name(); |
| bool print_name = false; |
| - Isolate* isolate = fun->GetIsolate(); |
| - for (Object* p = receiver; |
| - p != isolate->heap()->null_value(); |
| - p = p->GetPrototype(isolate)) { |
| + for (Handle<Object> p(receiver, isolate); |
| + !p->IsNull(); |
| + p = Object::GetPrototype(isolate, p)) { |
|
Yang
2014/04/15 13:10:48
Please don't handlify here.
|
| if (p->IsJSObject()) { |
| - Object* key = JSObject::cast(p)->SlowReverseLookup(fun); |
| + Object* key = JSObject::cast(*p)->SlowReverseLookup(fun); |
| if (key != isolate->heap()->undefined_value()) { |
| if (!name->IsString() || |
| !key->IsString() || |