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

Unified Diff: src/string-stream.cc

Issue 238973003: Handlify Object::GetPrototype and (most) callers. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Minor Created 6 years, 8 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
« src/runtime.cc ('K') | « src/runtime.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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() ||
« src/runtime.cc ('K') | « src/runtime.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698