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 9544 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
9555 } else { | 9555 } else { |
9556 return Smi::FromInt(FixedArray::cast(elements)->length()); | 9556 return Smi::FromInt(FixedArray::cast(elements)->length()); |
9557 } | 9557 } |
9558 } | 9558 } |
9559 | 9559 |
9560 | 9560 |
9561 static Handle<Object> NewSingleInterval(Isolate* isolate, uint32_t length) { | 9561 static Handle<Object> NewSingleInterval(Isolate* isolate, uint32_t length) { |
9562 Handle<FixedArray> single_interval = isolate->factory()->NewFixedArray(2); | 9562 Handle<FixedArray> single_interval = isolate->factory()->NewFixedArray(2); |
9563 // -1 means start of array. | 9563 // -1 means start of array. |
9564 single_interval->set(0, Smi::FromInt(-1)); | 9564 single_interval->set(0, Smi::FromInt(-1)); |
9565 single_interval->set(1, *isolate->factory()->NewNumberFromUint(length)); | 9565 Handle<Object> number = isolate->factory()->NewNumberFromUint(length); |
| 9566 single_interval->set(1, *number); |
9566 return isolate->factory()->NewJSArrayWithElements(single_interval); | 9567 return isolate->factory()->NewJSArrayWithElements(single_interval); |
9567 } | 9568 } |
9568 | 9569 |
9569 | 9570 |
9570 // Returns an array that tells you where in the [0, length) interval an array | 9571 // Returns an array that tells you where in the [0, length) interval an array |
9571 // might have elements. Can either return keys (positive integers) or | 9572 // might have elements. Can either return keys (positive integers) or |
9572 // intervals (pair of a negative integer (-start-1) followed by a | 9573 // intervals (pair of a negative integer (-start-1) followed by a |
9573 // positive (length)) or undefined values. | 9574 // positive (length)) or undefined values. |
9574 // Intervals can span over some keys that are not in the object. | 9575 // Intervals can span over some keys that are not in the object. |
9575 RUNTIME_FUNCTION(MaybeObject*, Runtime_GetArrayKeys) { | 9576 RUNTIME_FUNCTION(MaybeObject*, Runtime_GetArrayKeys) { |
(...skipping 3425 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
13001 // Handle last resort GC and make sure to allow future allocations | 13002 // Handle last resort GC and make sure to allow future allocations |
13002 // to grow the heap without causing GCs (if possible). | 13003 // to grow the heap without causing GCs (if possible). |
13003 isolate->counters()->gc_last_resort_from_js()->Increment(); | 13004 isolate->counters()->gc_last_resort_from_js()->Increment(); |
13004 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags, | 13005 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags, |
13005 "Runtime::PerformGC"); | 13006 "Runtime::PerformGC"); |
13006 } | 13007 } |
13007 } | 13008 } |
13008 | 13009 |
13009 | 13010 |
13010 } } // namespace v8::internal | 13011 } } // namespace v8::internal |
OLD | NEW |