| OLD | NEW |
| 1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "src/runtime/runtime-utils.h" | 5 #include "src/runtime/runtime-utils.h" |
| 6 | 6 |
| 7 #include "src/arguments.h" | 7 #include "src/arguments.h" |
| 8 #include "src/code-stubs.h" | 8 #include "src/code-stubs.h" |
| 9 #include "src/conversions-inl.h" | 9 #include "src/conversions-inl.h" |
| 10 #include "src/elements.h" | 10 #include "src/elements.h" |
| (...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 242 Handle<FixedArray> keys = | 242 Handle<FixedArray> keys = |
| 243 accumulator.GetKeys(GetKeysConversion::kKeepNumbers); | 243 accumulator.GetKeys(GetKeysConversion::kKeepNumbers); |
| 244 int j = 0; | 244 int j = 0; |
| 245 for (int i = 0; i < keys->length(); i++) { | 245 for (int i = 0; i < keys->length(); i++) { |
| 246 if (NumberToUint32(keys->get(i)) >= length) continue; | 246 if (NumberToUint32(keys->get(i)) >= length) continue; |
| 247 if (i != j) keys->set(j, keys->get(i)); | 247 if (i != j) keys->set(j, keys->get(i)); |
| 248 j++; | 248 j++; |
| 249 } | 249 } |
| 250 | 250 |
| 251 if (j != keys->length()) { | 251 if (j != keys->length()) { |
| 252 isolate->heap()->RightTrimFixedArray<Heap::CONCURRENT_TO_SWEEPER>( | 252 isolate->heap()->RightTrimFixedArray(*keys, keys->length() - j); |
| 253 *keys, keys->length() - j); | |
| 254 } | 253 } |
| 255 | 254 |
| 256 return *isolate->factory()->NewJSArrayWithElements(keys); | 255 return *isolate->factory()->NewJSArrayWithElements(keys); |
| 257 } | 256 } |
| 258 | 257 |
| 259 | 258 |
| 260 namespace { | 259 namespace { |
| 261 | 260 |
| 262 Object* ArrayConstructorCommon(Isolate* isolate, Handle<JSFunction> constructor, | 261 Object* ArrayConstructorCommon(Isolate* isolate, Handle<JSFunction> constructor, |
| 263 Handle<JSReceiver> new_target, | 262 Handle<JSReceiver> new_target, |
| (...skipping 410 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 674 ASSIGN_RETURN_FAILURE_ON_EXCEPTION( | 673 ASSIGN_RETURN_FAILURE_ON_EXCEPTION( |
| 675 isolate, spreaded, | 674 isolate, spreaded, |
| 676 Execution::Call(isolate, spread_iterable_function, | 675 Execution::Call(isolate, spread_iterable_function, |
| 677 isolate->factory()->undefined_value(), 1, &spread)); | 676 isolate->factory()->undefined_value(), 1, &spread)); |
| 678 | 677 |
| 679 return *spreaded; | 678 return *spreaded; |
| 680 } | 679 } |
| 681 | 680 |
| 682 } // namespace internal | 681 } // namespace internal |
| 683 } // namespace v8 | 682 } // namespace v8 |
| OLD | NEW |