OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 <stdlib.h> | 5 #include <stdlib.h> |
6 #include <limits> | 6 #include <limits> |
7 | 7 |
8 #include "src/v8.h" | 8 #include "src/v8.h" |
9 | 9 |
10 #include "src/accessors.h" | 10 #include "src/accessors.h" |
(...skipping 10316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10327 // and avoid duplicates. | 10327 // and avoid duplicates. |
10328 indices->Clear(); | 10328 indices->Clear(); |
10329 } | 10329 } |
10330 for (uint32_t i = 0; i < length; i++) { | 10330 for (uint32_t i = 0; i < length; i++) { |
10331 indices->Add(i); | 10331 indices->Add(i); |
10332 } | 10332 } |
10333 if (length == range) return; // All indices accounted for already. | 10333 if (length == range) return; // All indices accounted for already. |
10334 break; | 10334 break; |
10335 } | 10335 } |
10336 case SLOPPY_ARGUMENTS_ELEMENTS: { | 10336 case SLOPPY_ARGUMENTS_ELEMENTS: { |
10337 uint32_t length = static_cast<uint32_t>( | 10337 MaybeHandle<Object> length_obj = |
10338 Handle<JSArray>::cast(object)->length()->Number()); | 10338 Object::GetProperty(object, isolate->factory()->length_string()); |
| 10339 double length_num = length_obj.ToHandleChecked()->Number(); |
| 10340 uint32_t length = static_cast<uint32_t>(DoubleToInt32(length_num)); |
10339 ElementsAccessor* accessor = object->GetElementsAccessor(); | 10341 ElementsAccessor* accessor = object->GetElementsAccessor(); |
10340 for (uint32_t i = 0; i < length; i++) { | 10342 for (uint32_t i = 0; i < length; i++) { |
10341 if (accessor->HasElement(object, object, i)) { | 10343 if (accessor->HasElement(object, object, i)) { |
10342 indices->Add(i); | 10344 indices->Add(i); |
10343 } | 10345 } |
10344 } | 10346 } |
10345 break; | 10347 break; |
10346 } | 10348 } |
10347 } | 10349 } |
10348 | 10350 |
(...skipping 5327 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
15676 } | 15678 } |
15677 return NULL; | 15679 return NULL; |
15678 } | 15680 } |
15679 | 15681 |
15680 | 15682 |
15681 const Runtime::Function* Runtime::FunctionForId(Runtime::FunctionId id) { | 15683 const Runtime::Function* Runtime::FunctionForId(Runtime::FunctionId id) { |
15682 return &(kIntrinsicFunctions[static_cast<int>(id)]); | 15684 return &(kIntrinsicFunctions[static_cast<int>(id)]); |
15683 } | 15685 } |
15684 | 15686 |
15685 } } // namespace v8::internal | 15687 } } // namespace v8::internal |
OLD | NEW |