| OLD | NEW |
| 1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 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 4196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4207 } | 4207 } |
| 4208 | 4208 |
| 4209 | 4209 |
| 4210 static MaybeObject* Runtime_LocalKeys(Arguments args) { | 4210 static MaybeObject* Runtime_LocalKeys(Arguments args) { |
| 4211 ASSERT_EQ(args.length(), 1); | 4211 ASSERT_EQ(args.length(), 1); |
| 4212 CONVERT_CHECKED(JSObject, raw_object, args[0]); | 4212 CONVERT_CHECKED(JSObject, raw_object, args[0]); |
| 4213 HandleScope scope; | 4213 HandleScope scope; |
| 4214 Handle<JSObject> object(raw_object); | 4214 Handle<JSObject> object(raw_object); |
| 4215 | 4215 |
| 4216 if (object->IsJSGlobalProxy()) { | 4216 if (object->IsJSGlobalProxy()) { |
| 4217 // Do access checks before going to the global object. |
| 4218 if (object->IsAccessCheckNeeded() && |
| 4219 !Top::MayNamedAccess(*object, Heap::undefined_value(), |
| 4220 v8::ACCESS_KEYS)) { |
| 4221 Top::ReportFailedAccessCheck(*object, v8::ACCESS_KEYS); |
| 4222 return *Factory::NewJSArray(0); |
| 4223 } |
| 4224 |
| 4217 Handle<Object> proto(object->GetPrototype()); | 4225 Handle<Object> proto(object->GetPrototype()); |
| 4218 // If proxy is detached we simply return an empty array. | 4226 // If proxy is detached we simply return an empty array. |
| 4219 if (proto->IsNull()) return *Factory::NewJSArray(0); | 4227 if (proto->IsNull()) return *Factory::NewJSArray(0); |
| 4220 object = Handle<JSObject>::cast(proto); | 4228 object = Handle<JSObject>::cast(proto); |
| 4221 } | 4229 } |
| 4222 | 4230 |
| 4223 Handle<FixedArray> contents = GetKeysInFixedArrayFor(object, | 4231 Handle<FixedArray> contents = GetKeysInFixedArrayFor(object, |
| 4224 LOCAL_ONLY); | 4232 LOCAL_ONLY); |
| 4225 // Some fast paths through GetKeysInFixedArrayFor reuse a cached | 4233 // Some fast paths through GetKeysInFixedArrayFor reuse a cached |
| 4226 // property array and since the result is mutable we have to create | 4234 // property array and since the result is mutable we have to create |
| (...skipping 6879 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 11106 } else { | 11114 } else { |
| 11107 // Handle last resort GC and make sure to allow future allocations | 11115 // Handle last resort GC and make sure to allow future allocations |
| 11108 // to grow the heap without causing GCs (if possible). | 11116 // to grow the heap without causing GCs (if possible). |
| 11109 Counters::gc_last_resort_from_js.Increment(); | 11117 Counters::gc_last_resort_from_js.Increment(); |
| 11110 Heap::CollectAllGarbage(false); | 11118 Heap::CollectAllGarbage(false); |
| 11111 } | 11119 } |
| 11112 } | 11120 } |
| 11113 | 11121 |
| 11114 | 11122 |
| 11115 } } // namespace v8::internal | 11123 } } // namespace v8::internal |
| OLD | NEW |