| 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 949 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 960 Object* V = args[1]; | 960 Object* V = args[1]; |
| 961 while (true) { | 961 while (true) { |
| 962 Object* prototype = V->GetPrototype(); | 962 Object* prototype = V->GetPrototype(); |
| 963 if (prototype->IsNull()) return isolate->heap()->false_value(); | 963 if (prototype->IsNull()) return isolate->heap()->false_value(); |
| 964 if (O == prototype) return isolate->heap()->true_value(); | 964 if (O == prototype) return isolate->heap()->true_value(); |
| 965 V = prototype; | 965 V = prototype; |
| 966 } | 966 } |
| 967 } | 967 } |
| 968 | 968 |
| 969 | 969 |
| 970 // Recursively traverses hidden prototypes if property is not found | |
| 971 static void GetOwnPropertyImplementation(JSObject* obj, | |
| 972 String* name, | |
| 973 LookupResult* result) { | |
| 974 obj->LocalLookupRealNamedProperty(name, result); | |
| 975 | |
| 976 if (result->IsFound()) return; | |
| 977 | |
| 978 Object* proto = obj->GetPrototype(); | |
| 979 if (proto->IsJSObject() && | |
| 980 JSObject::cast(proto)->map()->is_hidden_prototype()) { | |
| 981 GetOwnPropertyImplementation(JSObject::cast(proto), | |
| 982 name, result); | |
| 983 } | |
| 984 } | |
| 985 | |
| 986 | |
| 987 static bool CheckAccessException(Object* callback, | 970 static bool CheckAccessException(Object* callback, |
| 988 v8::AccessType access_type) { | 971 v8::AccessType access_type) { |
| 989 if (callback->IsAccessorInfo()) { | 972 if (callback->IsAccessorInfo()) { |
| 990 AccessorInfo* info = AccessorInfo::cast(callback); | 973 AccessorInfo* info = AccessorInfo::cast(callback); |
| 991 return | 974 return |
| 992 (access_type == v8::ACCESS_HAS && | 975 (access_type == v8::ACCESS_HAS && |
| 993 (info->all_can_read() || info->all_can_write())) || | 976 (info->all_can_read() || info->all_can_write())) || |
| 994 (access_type == v8::ACCESS_GET && info->all_can_read()) || | 977 (access_type == v8::ACCESS_GET && info->all_can_read()) || |
| 995 (access_type == v8::ACCESS_SET && info->all_can_write()); | 978 (access_type == v8::ACCESS_SET && info->all_can_write()); |
| 996 } | 979 } |
| (...skipping 12320 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 13317 // Handle last resort GC and make sure to allow future allocations | 13300 // Handle last resort GC and make sure to allow future allocations |
| 13318 // to grow the heap without causing GCs (if possible). | 13301 // to grow the heap without causing GCs (if possible). |
| 13319 isolate->counters()->gc_last_resort_from_js()->Increment(); | 13302 isolate->counters()->gc_last_resort_from_js()->Increment(); |
| 13320 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags, | 13303 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags, |
| 13321 "Runtime::PerformGC"); | 13304 "Runtime::PerformGC"); |
| 13322 } | 13305 } |
| 13323 } | 13306 } |
| 13324 | 13307 |
| 13325 | 13308 |
| 13326 } } // namespace v8::internal | 13309 } } // namespace v8::internal |
| OLD | NEW |