Index: src/builtins.cc |
diff --git a/src/builtins.cc b/src/builtins.cc |
index 9290852dc95e697d7761961a78cf9698a9dba3bd..454cf46685b9663ab0b57b3b6070dde80a09007e 100644 |
--- a/src/builtins.cc |
+++ b/src/builtins.cc |
@@ -195,79 +195,6 @@ BUILTIN(EmptyFunction) { |
} |
-static MaybeObject* ArrayCodeGenericCommon(Arguments* args, |
- Isolate* isolate, |
- JSFunction* constructor) { |
- ASSERT(args->length() >= 1); |
- Heap* heap = isolate->heap(); |
- isolate->counters()->array_function_runtime()->Increment(); |
- |
- JSArray* array; |
- if (CalledAsConstructor(isolate)) { |
- array = JSArray::cast((*args)[0]); |
- // Initialize elements and length in case later allocations fail so that the |
- // array object is initialized in a valid state. |
- MaybeObject* maybe_array = array->Initialize(0); |
- if (maybe_array->IsFailure()) return maybe_array; |
- |
- AllocationMemento* memento = AllocationMemento::FindForJSObject(array); |
- if (memento != NULL && memento->IsValid()) { |
- AllocationSite* site = memento->GetAllocationSite(); |
- ElementsKind to_kind = site->GetElementsKind(); |
- if (IsMoreGeneralElementsKindTransition(array->GetElementsKind(), |
- to_kind)) { |
- // We have advice that we should change the elements kind |
- if (FLAG_trace_track_allocation_sites) { |
- PrintF("AllocationSite: pre-transitioning array %p(%s->%s)\n", |
- reinterpret_cast<void*>(array), |
- ElementsKindToString(array->GetElementsKind()), |
- ElementsKindToString(to_kind)); |
- } |
- |
- maybe_array = array->TransitionElementsKind(to_kind); |
- if (maybe_array->IsFailure()) return maybe_array; |
- } |
- } |
- |
- if (!FLAG_smi_only_arrays) { |
- Context* native_context = isolate->context()->native_context(); |
- if (array->GetElementsKind() == GetInitialFastElementsKind() && |
- !native_context->js_array_maps()->IsUndefined()) { |
- FixedArray* map_array = |
- FixedArray::cast(native_context->js_array_maps()); |
- array->set_map(Map::cast(map_array-> |
- get(TERMINAL_FAST_ELEMENTS_KIND))); |
- } |
- } |
- } else { |
- // Allocate the JS Array |
- MaybeObject* maybe_obj = heap->AllocateJSObject(constructor); |
- if (!maybe_obj->To(&array)) return maybe_obj; |
- } |
- |
- Arguments adjusted_arguments(args->length() - 1, args->arguments() - 1); |
- ASSERT(adjusted_arguments.length() < 1 || |
- adjusted_arguments[0] == (*args)[1]); |
- return ArrayConstructInitializeElements(array, &adjusted_arguments); |
-} |
- |
- |
-BUILTIN(InternalArrayCodeGeneric) { |
- return ArrayCodeGenericCommon( |
- &args, |
- isolate, |
- isolate->context()->native_context()->internal_array_function()); |
-} |
- |
- |
-BUILTIN(ArrayCodeGeneric) { |
- return ArrayCodeGenericCommon( |
- &args, |
- isolate, |
- isolate->context()->native_context()->array_function()); |
-} |
- |
- |
static void MoveDoubleElements(FixedDoubleArray* dst, |
int dst_index, |
FixedDoubleArray* src, |