| 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/messages.h" |
| 8 #include "src/runtime/runtime-utils.h" | 9 #include "src/runtime/runtime-utils.h" |
| 9 | 10 |
| 10 namespace v8 { | 11 namespace v8 { |
| 11 namespace internal { | 12 namespace internal { |
| 12 | 13 |
| 13 RUNTIME_FUNCTION(Runtime_FinishArrayPrototypeSetup) { | 14 RUNTIME_FUNCTION(Runtime_FinishArrayPrototypeSetup) { |
| 14 HandleScope scope(isolate); | 15 HandleScope scope(isolate); |
| 15 DCHECK(args.length() == 1); | 16 DCHECK(args.length() == 1); |
| 16 CONVERT_ARG_HANDLE_CHECKED(JSArray, prototype, 0); | 17 CONVERT_ARG_HANDLE_CHECKED(JSArray, prototype, 0); |
| 17 Object* length = prototype->length(); | 18 Object* length = prototype->length(); |
| (...skipping 881 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 899 return isolate->heap()->exception(); | 900 return isolate->heap()->exception(); |
| 900 } | 901 } |
| 901 } else { | 902 } else { |
| 902 visitor.visit(0, obj); | 903 visitor.visit(0, obj); |
| 903 visitor.increase_index_offset(1); | 904 visitor.increase_index_offset(1); |
| 904 } | 905 } |
| 905 } | 906 } |
| 906 | 907 |
| 907 if (visitor.exceeds_array_limit()) { | 908 if (visitor.exceeds_array_limit()) { |
| 908 THROW_NEW_ERROR_RETURN_FAILURE( | 909 THROW_NEW_ERROR_RETURN_FAILURE( |
| 909 isolate, | 910 isolate, NewRangeError(MessageTemplate::kInvalidArrayLength)); |
| 910 NewRangeError("invalid_array_length", HandleVector<Object>(NULL, 0))); | |
| 911 } | 911 } |
| 912 return *visitor.ToArray(); | 912 return *visitor.ToArray(); |
| 913 } | 913 } |
| 914 | 914 |
| 915 | 915 |
| 916 // Moves all own elements of an object, that are below a limit, to positions | 916 // Moves all own elements of an object, that are below a limit, to positions |
| 917 // starting at zero. All undefined values are placed after non-undefined values, | 917 // starting at zero. All undefined values are placed after non-undefined values, |
| 918 // and are followed by non-existing element. Does not change the length | 918 // and are followed by non-existing element. Does not change the length |
| 919 // property. | 919 // property. |
| 920 // Returns the number of non-undefined elements collected. | 920 // Returns the number of non-undefined elements collected. |
| (...skipping 471 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1392 | 1392 |
| 1393 RUNTIME_FUNCTION(Runtime_FastOneByteArrayJoin) { | 1393 RUNTIME_FUNCTION(Runtime_FastOneByteArrayJoin) { |
| 1394 SealHandleScope shs(isolate); | 1394 SealHandleScope shs(isolate); |
| 1395 DCHECK(args.length() == 2); | 1395 DCHECK(args.length() == 2); |
| 1396 // Returning undefined means that this fast path fails and one has to resort | 1396 // Returning undefined means that this fast path fails and one has to resort |
| 1397 // to a slow path. | 1397 // to a slow path. |
| 1398 return isolate->heap()->undefined_value(); | 1398 return isolate->heap()->undefined_value(); |
| 1399 } | 1399 } |
| 1400 } | 1400 } |
| 1401 } // namespace v8::internal | 1401 } // namespace v8::internal |
| OLD | NEW |