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 10698 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10709 if (p->IsJSProxy() || JSObject::cast(*p)->HasIndexedInterceptor()) { | 10709 if (p->IsJSProxy() || JSObject::cast(*p)->HasIndexedInterceptor()) { |
10710 // Bail out if we find a proxy or interceptor, likely not worth | 10710 // Bail out if we find a proxy or interceptor, likely not worth |
10711 // collecting keys in that case. | 10711 // collecting keys in that case. |
10712 return *isolate->factory()->NewNumberFromUint(length); | 10712 return *isolate->factory()->NewNumberFromUint(length); |
10713 } | 10713 } |
10714 Handle<JSObject> current = Handle<JSObject>::cast(p); | 10714 Handle<JSObject> current = Handle<JSObject>::cast(p); |
10715 Handle<FixedArray> current_keys = | 10715 Handle<FixedArray> current_keys = |
10716 isolate->factory()->NewFixedArray( | 10716 isolate->factory()->NewFixedArray( |
10717 current->NumberOfLocalElements(NONE)); | 10717 current->NumberOfLocalElements(NONE)); |
10718 current->GetLocalElementKeys(*current_keys, NONE); | 10718 current->GetLocalElementKeys(*current_keys, NONE); |
10719 keys = UnionOfKeys(keys, current_keys); | 10719 keys = FixedArray::UnionOfKeys(keys, current_keys); |
10720 } | 10720 } |
10721 // Erase any keys >= length. | 10721 // Erase any keys >= length. |
10722 // TODO(adamk): Remove this step when the contract of %GetArrayKeys | 10722 // TODO(adamk): Remove this step when the contract of %GetArrayKeys |
10723 // is changed to let this happen on the JS side. | 10723 // is changed to let this happen on the JS side. |
10724 for (int i = 0; i < keys->length(); i++) { | 10724 for (int i = 0; i < keys->length(); i++) { |
10725 if (NumberToUint32(keys->get(i)) >= length) keys->set_undefined(i); | 10725 if (NumberToUint32(keys->get(i)) >= length) keys->set_undefined(i); |
10726 } | 10726 } |
10727 return *isolate->factory()->NewJSArrayWithElements(keys); | 10727 return *isolate->factory()->NewJSArrayWithElements(keys); |
10728 } else { | 10728 } else { |
10729 ASSERT(array->HasFastSmiOrObjectElements() || | 10729 ASSERT(array->HasFastSmiOrObjectElements() || |
(...skipping 4528 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
15258 } | 15258 } |
15259 } | 15259 } |
15260 | 15260 |
15261 | 15261 |
15262 void Runtime::OutOfMemory() { | 15262 void Runtime::OutOfMemory() { |
15263 Heap::FatalProcessOutOfMemory("CALL_AND_RETRY_LAST", true); | 15263 Heap::FatalProcessOutOfMemory("CALL_AND_RETRY_LAST", true); |
15264 UNREACHABLE(); | 15264 UNREACHABLE(); |
15265 } | 15265 } |
15266 | 15266 |
15267 } } // namespace v8::internal | 15267 } } // namespace v8::internal |
OLD | NEW |