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

Side by Side Diff: src/isolate.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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 1015 matching lines...) Expand 10 before | Expand all | Expand 10 after
1026 1026
1027 bool Isolate::IsErrorObject(Handle<Object> obj) { 1027 bool Isolate::IsErrorObject(Handle<Object> obj) {
1028 if (!obj->IsJSObject()) return false; 1028 if (!obj->IsJSObject()) return false;
1029 1029
1030 Handle<String> error_key = 1030 Handle<String> error_key =
1031 factory()->InternalizeOneByteString(STATIC_ASCII_VECTOR("$Error")); 1031 factory()->InternalizeOneByteString(STATIC_ASCII_VECTOR("$Error"));
1032 Handle<Object> error_constructor = Object::GetProperty( 1032 Handle<Object> error_constructor = Object::GetProperty(
1033 js_builtins_object(), error_key).ToHandleChecked(); 1033 js_builtins_object(), error_key).ToHandleChecked();
1034 1034
1035 DisallowHeapAllocation no_gc; 1035 DisallowHeapAllocation no_gc;
1036 for (Object* prototype = *obj; !prototype->IsNull(); 1036 for (Handle<Object> prototype = obj; !prototype->IsNull();
1037 prototype = prototype->GetPrototype(this)) { 1037 prototype = Object::GetPrototype(this, prototype)) {
Yang 2014/04/15 13:10:48 The DisallowHeapAllocation scope should already ma
1038 if (!prototype->IsJSObject()) return false; 1038 if (!prototype->IsJSObject()) return false;
1039 if (JSObject::cast(prototype)->map()->constructor() == 1039 if (JSObject::cast(*prototype)->map()->constructor() ==
1040 *error_constructor) { 1040 *error_constructor) {
1041 return true; 1041 return true;
1042 } 1042 }
1043 } 1043 }
1044 return false; 1044 return false;
1045 } 1045 }
1046 1046
1047 static int fatal_exception_depth = 0; 1047 static int fatal_exception_depth = 0;
1048 1048
1049 void Isolate::DoThrow(Object* exception, MessageLocation* location) { 1049 void Isolate::DoThrow(Object* exception, MessageLocation* location) {
(...skipping 1216 matching lines...) Expand 10 before | Expand all | Expand 10 after
2266 Handle<JSObject> obj = factory()->NewJSObjectFromMap(map); 2266 Handle<JSObject> obj = factory()->NewJSObjectFromMap(map);
2267 JSObject::NormalizeProperties(obj, KEEP_INOBJECT_PROPERTIES, 8); 2267 JSObject::NormalizeProperties(obj, KEEP_INOBJECT_PROPERTIES, 8);
2268 JSObject::SetProperty(registry, name, obj, NONE, STRICT).Assert(); 2268 JSObject::SetProperty(registry, name, obj, NONE, STRICT).Assert();
2269 } 2269 }
2270 } 2270 }
2271 return Handle<JSObject>::cast(factory()->symbol_registry()); 2271 return Handle<JSObject>::cast(factory()->symbol_registry());
2272 } 2272 }
2273 2273
2274 2274
2275 } } // namespace v8::internal 2275 } } // namespace v8::internal
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698