1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are
6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided
11 // with the distribution.
12 // * Neither the name of Google Inc. nor the names of its
13 // contributors may be used to endorse or promote products derived
14 // from this software without specific prior written permission.
16 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
17 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
18 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
19 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
20 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
21 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 #include "bootstrapper.h"
31 #include "code-stubs.h"
32 #include "cpu-profiler.h"
33 #include "stub-cache.h"
36 #include "macro-assembler.h"
42 CodeStubInterfaceDescriptor::CodeStubInterfaceDescriptor()
43 : register_param_count_(-1),
44 stack_parameter_count_(no_reg),
45 hint_stack_parameter_count_(-1),
46 function_mode_(NOT_JS_FUNCTION_STUB_MODE),
47 register_params_(NULL),
48 deoptimization_handler_(NULL),
49 handler_arguments_mode_(DONT_PASS_ARGUMENTS),
51 has_miss_handler_(false) { }
54 bool CodeStub::FindCodeInCache(Code** code_out, Isolate* isolate) {
55 UnseededNumberDictionary* stubs = isolate->heap()->code_stubs();
56 int index = stubs->FindEntry(GetKey());
57 if (index != UnseededNumberDictionary::kNotFound) {
58 *code_out = Code::cast(stubs->ValueAt(index));
65 SmartArrayPointer<const char> CodeStub::GetName() {
67 NoAllocationStringAllocator allocator(buffer,
68 static_cast<unsigned>(sizeof(buffer)));
69 StringStream stream(&allocator);
71 return stream.ToCString();
75 void CodeStub::RecordCodeGeneration(Code* code, Isolate* isolate) {
76 SmartArrayPointer<const char> name = GetName();
77 PROFILE(isolate, CodeCreateEvent(Logger::STUB_TAG, code, name.get()));
78 GDBJIT(AddCode(GDBJITInterface::STUB, name.get(), code));
79 Counters* counters = isolate->counters();
80 counters->total_stubs_code_size()->Increment(code->instruction_size());
84 Code::Kind CodeStub::GetCodeKind() const {
89 Handle<Code> CodeStub::GetCodeCopy(Isolate* isolate,
90 const Code::FindAndReplacePattern& pattern) {
91 Handle<Code> ic = GetCode(isolate);
92 ic = isolate->factory()->CopyCode(ic);
93 ic->FindAndReplace(pattern);
94 RecordCodeGeneration(*ic, isolate);
99 Handle<Code> PlatformCodeStub::GenerateCode(Isolate* isolate) {
100 Factory* factory = isolate->factory();
102 // Generate the new code.
103 MacroAssembler masm(isolate, NULL, 256);
106 // Update the static counter each time a new code stub is generated.
107 isolate->counters()->code_stubs()->Increment();
109 // Generate the code for the stub.
110 masm.set_generating_stub(true);
111 NoCurrentFrameScope scope(&masm);
115 // Create the code object.
119 // Copy the generated code into a heap object.
120 Code::Flags flags = Code::ComputeFlags(
125 Handle<Code> new_object = factory->NewCode(
126 desc, flags, masm.CodeObject(), NeedsImmovableCode());
131 void CodeStub::VerifyPlatformFeatures(Isolate* isolate) {
132 ASSERT(CpuFeatures::VerifyCrossCompiling());
136 Handle<Code> CodeStub::GetCode(Isolate* isolate) {
137 Factory* factory = isolate->factory();
138 Heap* heap = isolate->heap();
140 if (UseSpecialCache()
141 ? FindCodeInSpecialCache(&code, isolate)
142 : FindCodeInCache(&code, isolate)) {
143 ASSERT(GetCodeKind() == code->kind());
144 return Handle<Code>(code);
148 VerifyPlatformFeatures(isolate);
152 HandleScope scope(isolate);
154 Handle<Code> new_object = GenerateCode(isolate);
155 new_object->set_major_key(MajorKey());
156 FinishCode(new_object);
157 RecordCodeGeneration(*new_object, isolate);
159 #ifdef ENABLE_DISASSEMBLER
160 if (FLAG_print_code_stubs) {
161 CodeTracer::Scope trace_scope(isolate->GetCodeTracer());
162 new_object->Disassemble(GetName().get(), trace_scope.file());
163 PrintF(trace_scope.file(), "\n");
167 if (UseSpecialCache()) {
168 AddToSpecialCache(new_object);
170 // Update the dictionary and the root in Heap.
171 Handle<UnseededNumberDictionary> dict =
172 factory->DictionaryAtNumberPut(
173 Handle<UnseededNumberDictionary>(heap->code_stubs()),
176 heap->public_set_code_stubs(*dict);
182 ASSERT(!NeedsImmovableCode() ||
183 heap->lo_space()->Contains(code) ||
184 heap->code_space()->FirstPage()->Contains(code->address()));
185 return Handle<Code>(code, isolate);
189 const char* CodeStub::MajorName(CodeStub::Major major_key,
190 bool allow_unknown_keys) {
192 #define DEF_CASE(name) case name: return #name "Stub";
193 CODE_STUB_LIST(DEF_CASE)
195 case UninitializedMajorKey: return "<UninitializedMajorKey>Stub";
197 if (!allow_unknown_keys) {
205 void CodeStub::PrintBaseName(StringStream* stream) {
206 stream->Add("%s", MajorName(MajorKey(), false));
210 void CodeStub::PrintName(StringStream* stream) {
211 PrintBaseName(stream);
217 void BinaryOpICStub::GenerateAheadOfTime(Isolate* isolate) {
218 // Generate the uninitialized versions of the stub.
219 for (int op = Token::BIT_OR; op <= Token::MOD; ++op) {
220 for (int mode = NO_OVERWRITE; mode <= OVERWRITE_RIGHT; ++mode) {
221 BinaryOpICStub stub(static_cast<Token::Value>(op),
222 static_cast<OverwriteMode>(mode));
223 stub.GetCode(isolate);
227 // Generate special versions of the stub.
228 BinaryOpIC::State::GenerateAheadOfTime(isolate, &GenerateAheadOfTime);
232 void BinaryOpICStub::PrintState(StringStream* stream) {
233 state_.Print(stream);
238 void BinaryOpICStub::GenerateAheadOfTime(Isolate* isolate,
239 const BinaryOpIC::State& state) {
240 BinaryOpICStub stub(state);
241 stub.GetCode(isolate);
246 void BinaryOpICWithAllocationSiteStub::GenerateAheadOfTime(Isolate* isolate) {
247 // Generate special versions of the stub.
248 BinaryOpIC::State::GenerateAheadOfTime(isolate, &GenerateAheadOfTime);
252 void BinaryOpICWithAllocationSiteStub::PrintState(StringStream* stream) {
253 state_.Print(stream);
258 void BinaryOpICWithAllocationSiteStub::GenerateAheadOfTime(
259 Isolate* isolate, const BinaryOpIC::State& state) {
260 if (state.CouldCreateAllocationMementos()) {
261 BinaryOpICWithAllocationSiteStub stub(state);
262 stub.GetCode(isolate);
267 void StringAddStub::PrintBaseName(StringStream* stream) {
268 stream->Add("StringAddStub");
269 if ((flags() & STRING_ADD_CHECK_BOTH) == STRING_ADD_CHECK_BOTH) {
270 stream->Add("_CheckBoth");
271 } else if ((flags() & STRING_ADD_CHECK_LEFT) == STRING_ADD_CHECK_LEFT) {
272 stream->Add("_CheckLeft");
273 } else if ((flags() & STRING_ADD_CHECK_RIGHT) == STRING_ADD_CHECK_RIGHT) {
274 stream->Add("_CheckRight");
276 if (pretenure_flag() == TENURED) {
277 stream->Add("_Tenured");
282 InlineCacheState ICCompareStub::GetICState() {
283 CompareIC::State state = Max(left_, right_);
285 case CompareIC::UNINITIALIZED:
286 return ::v8::internal::UNINITIALIZED;
288 case CompareIC::NUMBER:
289 case CompareIC::INTERNALIZED_STRING:
290 case CompareIC::STRING:
291 case CompareIC::UNIQUE_NAME:
292 case CompareIC::OBJECT:
293 case CompareIC::KNOWN_OBJECT:
295 case CompareIC::GENERIC:
296 return ::v8::internal::GENERIC;
299 return ::v8::internal::UNINITIALIZED;
303 void ICCompareStub::AddToSpecialCache(Handle<Code> new_object) {
304 ASSERT(*known_map_ != NULL);
305 Isolate* isolate = new_object->GetIsolate();
306 Factory* factory = isolate->factory();
307 return Map::UpdateCodeCache(known_map_,
309 factory->strict_compare_ic_string() :
310 factory->compare_ic_string(),
315 bool ICCompareStub::FindCodeInSpecialCache(Code** code_out, Isolate* isolate) {
316 Factory* factory = isolate->factory();
317 Code::Flags flags = Code::ComputeFlags(
320 ASSERT(op_ == Token::EQ || op_ == Token::EQ_STRICT);
321 Handle<Object> probe(
322 known_map_->FindInCodeCache(
324 *factory->strict_compare_ic_string() :
325 *factory->compare_ic_string(),
328 if (probe->IsCode()) {
329 *code_out = Code::cast(*probe);
331 Token::Value cached_op;
332 ICCompareStub::DecodeMinorKey((*code_out)->stub_info(), NULL, NULL, NULL,
334 ASSERT(op_ == cached_op);
342 int ICCompareStub::MinorKey() {
343 return OpField::encode(op_ - Token::EQ) |
344 LeftStateField::encode(left_) |
345 RightStateField::encode(right_) |
346 HandlerStateField::encode(state_);
350 void ICCompareStub::DecodeMinorKey(int minor_key,
351 CompareIC::State* left_state,
352 CompareIC::State* right_state,
353 CompareIC::State* handler_state,
357 static_cast<CompareIC::State>(LeftStateField::decode(minor_key));
361 static_cast<CompareIC::State>(RightStateField::decode(minor_key));
365 static_cast<CompareIC::State>(HandlerStateField::decode(minor_key));
368 *op = static_cast<Token::Value>(OpField::decode(minor_key) + Token::EQ);
373 void ICCompareStub::Generate(MacroAssembler* masm) {
375 case CompareIC::UNINITIALIZED:
381 case CompareIC::NUMBER:
382 GenerateNumbers(masm);
384 case CompareIC::STRING:
385 GenerateStrings(masm);
387 case CompareIC::INTERNALIZED_STRING:
388 GenerateInternalizedStrings(masm);
390 case CompareIC::UNIQUE_NAME:
391 GenerateUniqueNames(masm);
393 case CompareIC::OBJECT:
394 GenerateObjects(masm);
396 case CompareIC::KNOWN_OBJECT:
397 ASSERT(*known_map_ != NULL);
398 GenerateKnownObjects(masm);
400 case CompareIC::GENERIC:
401 GenerateGeneric(masm);
407 void CompareNilICStub::UpdateStatus(Handle<Object> object) {
408 ASSERT(!state_.Contains(GENERIC));
409 State old_state(state_);
410 if (object->IsNull()) {
411 state_.Add(NULL_TYPE);
412 } else if (object->IsUndefined()) {
413 state_.Add(UNDEFINED);
414 } else if (object->IsUndetectableObject() ||
415 object->IsOddball() ||
416 !object->IsHeapObject()) {
419 } else if (IsMonomorphic()) {
423 state_.Add(MONOMORPHIC_MAP);
425 TraceTransition(old_state, state_);
429 template<class StateType>
430 void HydrogenCodeStub::TraceTransition(StateType from, StateType to) {
431 // Note: Although a no-op transition is semantically OK, it is hinting at a
432 // bug somewhere in our state transition machinery.
434 if (!FLAG_trace_ic) return;
436 NoAllocationStringAllocator allocator(buffer,
437 static_cast<unsigned>(sizeof(buffer)));
438 StringStream stream(&allocator);
440 PrintBaseName(&stream);
446 stream.OutputToStdOut();
450 void CompareNilICStub::PrintBaseName(StringStream* stream) {
451 CodeStub::PrintBaseName(stream);
452 stream->Add((nil_value_ == kNullValue) ? "(NullValue)":
457 void CompareNilICStub::PrintState(StringStream* stream) {
458 state_.Print(stream);
462 void CompareNilICStub::State::Print(StringStream* stream) const {
464 SimpleListPrinter printer(stream);
465 if (IsEmpty()) printer.Add("None");
466 if (Contains(UNDEFINED)) printer.Add("Undefined");
467 if (Contains(NULL_TYPE)) printer.Add("Null");
468 if (Contains(MONOMORPHIC_MAP)) printer.Add("MonomorphicMap");
469 if (Contains(GENERIC)) printer.Add("Generic");
474 Type* CompareNilICStub::GetType(Zone* zone, Handle<Map> map) {
475 if (state_.Contains(CompareNilICStub::GENERIC)) {
476 return Type::Any(zone);
479 Type* result = Type::None(zone);
480 if (state_.Contains(CompareNilICStub::UNDEFINED)) {
481 result = Type::Union(result, Type::Undefined(zone), zone);
483 if (state_.Contains(CompareNilICStub::NULL_TYPE)) {
484 result = Type::Union(result, Type::Null(zone), zone);
486 if (state_.Contains(CompareNilICStub::MONOMORPHIC_MAP)) {
488 map.is_null() ? Type::Detectable(zone) : Type::Class(map, zone);
489 result = Type::Union(result, type, zone);
496 Type* CompareNilICStub::GetInputType(Zone* zone, Handle<Map> map) {
497 Type* output_type = GetType(zone, map);
499 nil_value_ == kNullValue ? Type::Null(zone) : Type::Undefined(zone);
500 return Type::Union(output_type, nil_type, zone);
504 void InstanceofStub::PrintName(StringStream* stream) {
505 const char* args = "";
506 if (HasArgsInRegisters()) {
510 const char* inline_check = "";
511 if (HasCallSiteInlineCheck()) {
512 inline_check = "_INLINE";
515 const char* return_true_false_object = "";
516 if (ReturnTrueFalseObject()) {
517 return_true_false_object = "_TRUEFALSE";
520 stream->Add("InstanceofStub%s%s%s",
523 return_true_false_object);
527 void JSEntryStub::FinishCode(Handle<Code> code) {
528 Handle<FixedArray> handler_table =
529 code->GetIsolate()->factory()->NewFixedArray(1, TENURED);
530 handler_table->set(0, Smi::FromInt(handler_offset_));
531 code->set_handler_table(*handler_table);
535 void KeyedLoadDictionaryElementPlatformStub::Generate(
536 MacroAssembler* masm) {
537 KeyedLoadStubCompiler::GenerateLoadDictionaryElement(masm);
541 void CreateAllocationSiteStub::GenerateAheadOfTime(Isolate* isolate) {
542 CreateAllocationSiteStub stub;
543 stub.GetCode(isolate);
547 void KeyedStoreElementStub::Generate(MacroAssembler* masm) {
548 switch (elements_kind_) {
550 case FAST_HOLEY_ELEMENTS:
551 case FAST_SMI_ELEMENTS:
552 case FAST_HOLEY_SMI_ELEMENTS:
553 case FAST_DOUBLE_ELEMENTS:
554 case FAST_HOLEY_DOUBLE_ELEMENTS:
555 #define TYPED_ARRAY_CASE(Type, type, TYPE, ctype, size) \
556 case EXTERNAL_##TYPE##_ELEMENTS: \
557 case TYPE##_ELEMENTS:
559 TYPED_ARRAYS(TYPED_ARRAY_CASE)
560 #undef TYPED_ARRAY_CASE
563 case DICTIONARY_ELEMENTS:
564 KeyedStoreStubCompiler::GenerateStoreDictionaryElement(masm);
566 case SLOPPY_ARGUMENTS_ELEMENTS:
573 void ArgumentsAccessStub::PrintName(StringStream* stream) {
574 stream->Add("ArgumentsAccessStub_");
576 case READ_ELEMENT: stream->Add("ReadElement"); break;
577 case NEW_SLOPPY_FAST: stream->Add("NewSloppyFast"); break;
578 case NEW_SLOPPY_SLOW: stream->Add("NewSloppySlow"); break;
579 case NEW_STRICT: stream->Add("NewStrict"); break;
584 void CallFunctionStub::PrintName(StringStream* stream) {
585 stream->Add("CallFunctionStub_Args%d", argc_);
586 if (RecordCallTarget()) stream->Add("_Recording");
590 void CallConstructStub::PrintName(StringStream* stream) {
591 stream->Add("CallConstructStub");
592 if (RecordCallTarget()) stream->Add("_Recording");
596 void ArrayConstructorStub::PrintName(StringStream* stream) {
597 stream->Add("ArrayConstructorStub");
598 switch (argument_count_) {
599 case ANY: stream->Add("_Any"); break;
600 case NONE: stream->Add("_None"); break;
601 case ONE: stream->Add("_One"); break;
602 case MORE_THAN_ONE: stream->Add("_More_Than_One"); break;
607 void ArrayConstructorStubBase::BasePrintName(const char* name,
608 StringStream* stream) {
611 stream->Add(ElementsKindToString(elements_kind()));
612 if (override_mode() == DISABLE_ALLOCATION_SITES) {
613 stream->Add("_DISABLE_ALLOCATION_SITES");
618 bool ToBooleanStub::UpdateStatus(Handle<Object> object) {
619 Types old_types(types_);
620 bool to_boolean_value = types_.UpdateStatus(object);
621 TraceTransition(old_types, types_);
622 return to_boolean_value;
626 void ToBooleanStub::PrintState(StringStream* stream) {
627 types_.Print(stream);
631 void ToBooleanStub::Types::Print(StringStream* stream) const {
633 SimpleListPrinter printer(stream);
634 if (IsEmpty()) printer.Add("None");
635 if (Contains(UNDEFINED)) printer.Add("Undefined");
636 if (Contains(BOOLEAN)) printer.Add("Bool");
637 if (Contains(NULL_TYPE)) printer.Add("Null");
638 if (Contains(SMI)) printer.Add("Smi");
639 if (Contains(SPEC_OBJECT)) printer.Add("SpecObject");
640 if (Contains(STRING)) printer.Add("String");
641 if (Contains(SYMBOL)) printer.Add("Symbol");
642 if (Contains(HEAP_NUMBER)) printer.Add("HeapNumber");
647 bool ToBooleanStub::Types::UpdateStatus(Handle<Object> object) {
648 if (object->IsUndefined()) {
651 } else if (object->IsBoolean()) {
653 return object->IsTrue();
654 } else if (object->IsNull()) {
657 } else if (object->IsSmi()) {
659 return Smi::cast(*object)->value() != 0;
660 } else if (object->IsSpecObject()) {
662 return !object->IsUndetectableObject();
663 } else if (object->IsString()) {
665 return !object->IsUndetectableObject() &&
666 String::cast(*object)->length() != 0;
667 } else if (object->IsSymbol()) {
670 } else if (object->IsHeapNumber()) {
671 ASSERT(!object->IsUndetectableObject());
673 double value = HeapNumber::cast(*object)->value();
674 return value != 0 && !std::isnan(value);
676 // We should never see an internal object at runtime here!
683 bool ToBooleanStub::Types::NeedsMap() const {
684 return Contains(ToBooleanStub::SPEC_OBJECT)
685 || Contains(ToBooleanStub::STRING)
686 || Contains(ToBooleanStub::SYMBOL)
687 || Contains(ToBooleanStub::HEAP_NUMBER);
691 bool ToBooleanStub::Types::CanBeUndetectable() const {
692 return Contains(ToBooleanStub::SPEC_OBJECT)
693 || Contains(ToBooleanStub::STRING);
697 void StubFailureTrampolineStub::GenerateAheadOfTime(Isolate* isolate) {
698 StubFailureTrampolineStub stub1(NOT_JS_FUNCTION_STUB_MODE);
699 StubFailureTrampolineStub stub2(JS_FUNCTION_STUB_MODE);
700 stub1.GetCode(isolate);
701 stub2.GetCode(isolate);
705 void ProfileEntryHookStub::EntryHookTrampoline(intptr_t function,
706 intptr_t stack_pointer,
708 FunctionEntryHook entry_hook = isolate->function_entry_hook();
709 ASSERT(entry_hook != NULL);
710 entry_hook(function, stack_pointer);
714 static void InstallDescriptor(Isolate* isolate, HydrogenCodeStub* stub) {
715 int major_key = stub->MajorKey();
716 CodeStubInterfaceDescriptor* descriptor =
717 isolate->code_stub_interface_descriptor(major_key);
718 if (!descriptor->initialized()) {
719 stub->InitializeInterfaceDescriptor(isolate, descriptor);
724 void ArrayConstructorStubBase::InstallDescriptors(Isolate* isolate) {
725 ArrayNoArgumentConstructorStub stub1(GetInitialFastElementsKind());
726 InstallDescriptor(isolate, &stub1);
727 ArraySingleArgumentConstructorStub stub2(GetInitialFastElementsKind());
728 InstallDescriptor(isolate, &stub2);
729 ArrayNArgumentsConstructorStub stub3(GetInitialFastElementsKind());
730 InstallDescriptor(isolate, &stub3);
734 void NumberToStringStub::InstallDescriptors(Isolate* isolate) {
735 NumberToStringStub stub;
736 InstallDescriptor(isolate, &stub);
740 void FastNewClosureStub::InstallDescriptors(Isolate* isolate) {
741 FastNewClosureStub stub(STRICT, false);
742 InstallDescriptor(isolate, &stub);
746 void FastNewContextStub::InstallDescriptors(Isolate* isolate) {
747 FastNewContextStub stub(FastNewContextStub::kMaximumSlots);
748 InstallDescriptor(isolate, &stub);
753 void FastCloneShallowArrayStub::InstallDescriptors(Isolate* isolate) {
754 FastCloneShallowArrayStub stub(FastCloneShallowArrayStub::CLONE_ELEMENTS,
755 DONT_TRACK_ALLOCATION_SITE, 0);
756 InstallDescriptor(isolate, &stub);
761 void BinaryOpICStub::InstallDescriptors(Isolate* isolate) {
762 BinaryOpICStub stub(Token::ADD, NO_OVERWRITE);
763 InstallDescriptor(isolate, &stub);
768 void BinaryOpWithAllocationSiteStub::InstallDescriptors(Isolate* isolate) {
769 BinaryOpWithAllocationSiteStub stub(Token::ADD, NO_OVERWRITE);
770 InstallDescriptor(isolate, &stub);
775 void StringAddStub::InstallDescriptors(Isolate* isolate) {
776 StringAddStub stub(STRING_ADD_CHECK_NONE, NOT_TENURED);
777 InstallDescriptor(isolate, &stub);
782 void RegExpConstructResultStub::InstallDescriptors(Isolate* isolate) {
783 RegExpConstructResultStub stub;
784 InstallDescriptor(isolate, &stub);
788 ArrayConstructorStub::ArrayConstructorStub(Isolate* isolate)
789 : argument_count_(ANY) {
790 ArrayConstructorStubBase::GenerateStubsAheadOfTime(isolate);
794 ArrayConstructorStub::ArrayConstructorStub(Isolate* isolate,
795 int argument_count) {
796 if (argument_count == 0) {
797 argument_count_ = NONE;
798 } else if (argument_count == 1) {
799 argument_count_ = ONE;
800 } else if (argument_count >= 2) {
801 argument_count_ = MORE_THAN_ONE;
805 ArrayConstructorStubBase::GenerateStubsAheadOfTime(isolate);
809 void InternalArrayConstructorStubBase::InstallDescriptors(Isolate* isolate) {
810 InternalArrayNoArgumentConstructorStub stub1(FAST_ELEMENTS);
811 InstallDescriptor(isolate, &stub1);
812 InternalArraySingleArgumentConstructorStub stub2(FAST_ELEMENTS);
813 InstallDescriptor(isolate, &stub2);
814 InternalArrayNArgumentsConstructorStub stub3(FAST_ELEMENTS);
815 InstallDescriptor(isolate, &stub3);
818 InternalArrayConstructorStub::InternalArrayConstructorStub(
820 InternalArrayConstructorStubBase::GenerateStubsAheadOfTime(isolate);
824 } } // namespace v8::internal