OLD | NEW |
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 1028 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1039 } else { | 1039 } else { |
1040 // Report the exception if it isn't caught by JavaScript code. | 1040 // Report the exception if it isn't caught by JavaScript code. |
1041 return handler == NULL; | 1041 return handler == NULL; |
1042 } | 1042 } |
1043 } | 1043 } |
1044 | 1044 |
1045 | 1045 |
1046 bool Isolate::IsErrorObject(Handle<Object> obj) { | 1046 bool Isolate::IsErrorObject(Handle<Object> obj) { |
1047 if (!obj->IsJSObject()) return false; | 1047 if (!obj->IsJSObject()) return false; |
1048 | 1048 |
1049 String* error_key = | 1049 Handle<String> error_key = |
1050 *(factory()->InternalizeOneByteString(STATIC_ASCII_VECTOR("$Error"))); | 1050 factory()->InternalizeOneByteString(STATIC_ASCII_VECTOR("$Error")); |
1051 Object* error_constructor = | 1051 Handle<Object> error_constructor = GlobalObject::GetPropertyNoExceptionThrown( |
1052 js_builtins_object()->GetPropertyNoExceptionThrown(error_key); | 1052 js_builtins_object(), error_key); |
1053 | 1053 |
| 1054 DisallowHeapAllocation no_gc; |
1054 for (Object* prototype = *obj; !prototype->IsNull(); | 1055 for (Object* prototype = *obj; !prototype->IsNull(); |
1055 prototype = prototype->GetPrototype(this)) { | 1056 prototype = prototype->GetPrototype(this)) { |
1056 if (!prototype->IsJSObject()) return false; | 1057 if (!prototype->IsJSObject()) return false; |
1057 if (JSObject::cast(prototype)->map()->constructor() == error_constructor) { | 1058 if (JSObject::cast(prototype)->map()->constructor() == |
| 1059 *error_constructor) { |
1058 return true; | 1060 return true; |
1059 } | 1061 } |
1060 } | 1062 } |
1061 return false; | 1063 return false; |
1062 } | 1064 } |
1063 | 1065 |
1064 static int fatal_exception_depth = 0; | 1066 static int fatal_exception_depth = 0; |
1065 | 1067 |
1066 void Isolate::DoThrow(Object* exception, MessageLocation* location) { | 1068 void Isolate::DoThrow(Object* exception, MessageLocation* location) { |
1067 ASSERT(!has_pending_exception()); | 1069 ASSERT(!has_pending_exception()); |
(...skipping 1216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2284 Handle<JSObject> obj = factory()->NewJSObjectFromMap(map); | 2286 Handle<JSObject> obj = factory()->NewJSObjectFromMap(map); |
2285 JSObject::NormalizeProperties(obj, KEEP_INOBJECT_PROPERTIES, 8); | 2287 JSObject::NormalizeProperties(obj, KEEP_INOBJECT_PROPERTIES, 8); |
2286 JSObject::SetProperty(registry, name, obj, NONE, STRICT).Assert(); | 2288 JSObject::SetProperty(registry, name, obj, NONE, STRICT).Assert(); |
2287 } | 2289 } |
2288 } | 2290 } |
2289 return Handle<JSObject>::cast(factory()->symbol_registry()); | 2291 return Handle<JSObject>::cast(factory()->symbol_registry()); |
2290 } | 2292 } |
2291 | 2293 |
2292 | 2294 |
2293 } } // namespace v8::internal | 2295 } } // namespace v8::internal |
OLD | NEW |