Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(673)

Side by Side Diff: src/elements.cc

Issue 206073007: ArraySplice builtin handlified. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressing review notes Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/builtins.cc ('k') | src/factory.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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 779 matching lines...) Expand 10 before | Expand all | Expand 10 after
790 uint32_t from_start, 790 uint32_t from_start,
791 FixedArrayBase* to, 791 FixedArrayBase* to,
792 ElementsKind from_kind, 792 ElementsKind from_kind,
793 uint32_t to_start, 793 uint32_t to_start,
794 int packed_size, 794 int packed_size,
795 int copy_size) { 795 int copy_size) {
796 UNREACHABLE(); 796 UNREACHABLE();
797 return NULL; 797 return NULL;
798 } 798 }
799 799
800 // TODO(ishell): Temporary wrapper, remove when CopyElements handlified.
801 Handle<Object> CopyElementsHelper(
802 Handle<JSObject> from_holder,
803 uint32_t from_start,
804 ElementsKind from_kind,
805 Handle<FixedArrayBase> to,
806 uint32_t to_start,
807 int copy_size,
808 Handle<FixedArrayBase> from) {
809 CALL_HEAP_FUNCTION(to->GetIsolate(),
810 CopyElements(
811 from_holder.is_null() ? NULL : *from_holder,
812 from_start, from_kind, *to, to_start, copy_size,
813 from.is_null() ? NULL : *from),
814 Object);
815 }
816
800 virtual void CopyElements( 817 virtual void CopyElements(
801 Handle<JSObject> from_holder, 818 Handle<JSObject> from_holder,
802 uint32_t from_start, 819 uint32_t from_start,
803 ElementsKind from_kind, 820 ElementsKind from_kind,
804 Handle<FixedArrayBase> to, 821 Handle<FixedArrayBase> to,
805 uint32_t to_start, 822 uint32_t to_start,
806 int copy_size, 823 int copy_size,
807 Handle<FixedArrayBase> from) { 824 Handle<FixedArrayBase> from) {
808 CALL_HEAP_FUNCTION_VOID(from_holder->GetIsolate(), 825 Handle<Object> result = CopyElementsHelper(
809 CopyElements( 826 from_holder, from_start, from_kind, to, to_start, copy_size, from);
810 from_holder.is_null() ? NULL : *from_holder, 827 ASSERT(!result.is_null());
811 from_start, from_kind, *to, to_start, copy_size, 828 USE(result);
812 from.is_null() ? NULL : *from));
813 } 829 }
814 830
815 MUST_USE_RESULT virtual MaybeObject* CopyElements(JSObject* from_holder, 831 MUST_USE_RESULT virtual MaybeObject* CopyElements(JSObject* from_holder,
816 uint32_t from_start, 832 uint32_t from_start,
817 ElementsKind from_kind, 833 ElementsKind from_kind,
818 FixedArrayBase* to, 834 FixedArrayBase* to,
819 uint32_t to_start, 835 uint32_t to_start,
820 int copy_size, 836 int copy_size,
821 FixedArrayBase* from) { 837 FixedArrayBase* from) {
822 int packed_size = kPackedSizeNotKnown; 838 int packed_size = kPackedSizeNotKnown;
(...skipping 1248 matching lines...) Expand 10 before | Expand all | Expand 10 after
2071 UNREACHABLE(); 2087 UNREACHABLE();
2072 break; 2088 break;
2073 } 2089 }
2074 2090
2075 array->set_elements(*elms); 2091 array->set_elements(*elms);
2076 array->set_length(Smi::FromInt(number_of_elements)); 2092 array->set_length(Smi::FromInt(number_of_elements));
2077 return array; 2093 return array;
2078 } 2094 }
2079 2095
2080 } } // namespace v8::internal 2096 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/builtins.cc ('k') | src/factory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698