| 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/v8.h" | 5 #include "src/v8.h" |
| 6 | 6 |
| 7 #include "src/arguments.h" | 7 #include "src/arguments.h" |
| 8 #include "src/elements.h" | 8 #include "src/elements.h" |
| 9 #include "src/messages.h" | 9 #include "src/messages.h" |
| 10 #include "src/runtime/runtime-utils.h" | 10 #include "src/runtime/runtime-utils.h" |
| (...skipping 454 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 465 | 465 |
| 466 | 466 |
| 467 static bool IterateElementsSlow(Isolate* isolate, Handle<JSObject> receiver, | 467 static bool IterateElementsSlow(Isolate* isolate, Handle<JSObject> receiver, |
| 468 uint32_t length, ArrayConcatVisitor* visitor) { | 468 uint32_t length, ArrayConcatVisitor* visitor) { |
| 469 for (uint32_t i = 0; i < length; ++i) { | 469 for (uint32_t i = 0; i < length; ++i) { |
| 470 HandleScope loop_scope(isolate); | 470 HandleScope loop_scope(isolate); |
| 471 Maybe<bool> maybe = JSReceiver::HasElement(receiver, i); | 471 Maybe<bool> maybe = JSReceiver::HasElement(receiver, i); |
| 472 if (!maybe.IsJust()) return false; | 472 if (!maybe.IsJust()) return false; |
| 473 if (maybe.FromJust()) { | 473 if (maybe.FromJust()) { |
| 474 Handle<Object> element_value; | 474 Handle<Object> element_value; |
| 475 ASSIGN_RETURN_ON_EXCEPTION_VALUE( | 475 ASSIGN_RETURN_ON_EXCEPTION_VALUE(isolate, element_value, |
| 476 isolate, element_value, | 476 Object::GetElement(isolate, receiver, i), |
| 477 Runtime::GetElementOrCharAt(isolate, receiver, i), false); | 477 false); |
| 478 visitor->visit(i, element_value); | 478 visitor->visit(i, element_value); |
| 479 } | 479 } |
| 480 } | 480 } |
| 481 visitor->increase_index_offset(length); | 481 visitor->increase_index_offset(length); |
| 482 return true; | 482 return true; |
| 483 } | 483 } |
| 484 | 484 |
| 485 | 485 |
| 486 /** | 486 /** |
| 487 * A helper function that visits elements of a JSObject in numerical | 487 * A helper function that visits elements of a JSObject in numerical |
| (...skipping 832 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1320 | 1320 |
| 1321 RUNTIME_FUNCTION(Runtime_FastOneByteArrayJoin) { | 1321 RUNTIME_FUNCTION(Runtime_FastOneByteArrayJoin) { |
| 1322 SealHandleScope shs(isolate); | 1322 SealHandleScope shs(isolate); |
| 1323 DCHECK(args.length() == 2); | 1323 DCHECK(args.length() == 2); |
| 1324 // Returning undefined means that this fast path fails and one has to resort | 1324 // Returning undefined means that this fast path fails and one has to resort |
| 1325 // to a slow path. | 1325 // to a slow path. |
| 1326 return isolate->heap()->undefined_value(); | 1326 return isolate->heap()->undefined_value(); |
| 1327 } | 1327 } |
| 1328 } // namespace internal | 1328 } // namespace internal |
| 1329 } // namespace v8 | 1329 } // namespace v8 |
| OLD | NEW |