OLD | NEW |
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 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 647 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
658 FixedArray* elms = FixedArray::cast(elms_obj); | 658 FixedArray* elms = FixedArray::cast(elms_obj); |
659 JSArray* array = JSArray::cast(receiver); | 659 JSArray* array = JSArray::cast(receiver); |
660 ASSERT(array->HasFastElements()); | 660 ASSERT(array->HasFastElements()); |
661 | 661 |
662 int len = Smi::cast(array->length())->value(); | 662 int len = Smi::cast(array->length())->value(); |
663 | 663 |
664 int n_arguments = args.length() - 1; | 664 int n_arguments = args.length() - 1; |
665 | 665 |
666 // Return empty array when no arguments are supplied. | 666 // Return empty array when no arguments are supplied. |
667 if (n_arguments == 0) { | 667 if (n_arguments == 0) { |
668 // No handle scope needed since we return directly. | 668 Object* result = AllocateEmptyJSArray(); |
669 return *Factory::NewJSArray(0); | 669 if (result->IsFailure()) return result; |
| 670 return JSArray::cast(result); |
670 } | 671 } |
671 | 672 |
672 int relative_start = 0; | 673 int relative_start = 0; |
673 Object* arg1 = args[1]; | 674 Object* arg1 = args[1]; |
674 if (arg1->IsSmi()) { | 675 if (arg1->IsSmi()) { |
675 relative_start = Smi::cast(arg1)->value(); | 676 relative_start = Smi::cast(arg1)->value(); |
676 } else if (!arg1->IsUndefined()) { | 677 } else if (!arg1->IsUndefined()) { |
677 return CallJsBuiltin("ArraySplice", args); | 678 return CallJsBuiltin("ArraySplice", args); |
678 } | 679 } |
679 int actual_start = (relative_start < 0) ? Max(len + relative_start, 0) | 680 int actual_start = (relative_start < 0) ? Max(len + relative_start, 0) |
(...skipping 852 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1532 if (entry->contains(pc)) { | 1533 if (entry->contains(pc)) { |
1533 return names_[i]; | 1534 return names_[i]; |
1534 } | 1535 } |
1535 } | 1536 } |
1536 } | 1537 } |
1537 return NULL; | 1538 return NULL; |
1538 } | 1539 } |
1539 | 1540 |
1540 | 1541 |
1541 } } // namespace v8::internal | 1542 } } // namespace v8::internal |
OLD | NEW |