OLD | NEW |
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 5391 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5402 | 5402 |
5403 __ ret(0); | 5403 __ ret(0); |
5404 } | 5404 } |
5405 | 5405 |
5406 | 5406 |
5407 template<class T> | 5407 template<class T> |
5408 static void CreateArrayDispatch(MacroAssembler* masm, | 5408 static void CreateArrayDispatch(MacroAssembler* masm, |
5409 AllocationSiteOverrideMode mode) { | 5409 AllocationSiteOverrideMode mode) { |
5410 if (mode == DISABLE_ALLOCATION_SITES) { | 5410 if (mode == DISABLE_ALLOCATION_SITES) { |
5411 T stub(GetInitialFastElementsKind(), | 5411 T stub(GetInitialFastElementsKind(), |
5412 CONTEXT_CHECK_REQUIRED, | |
5413 mode); | 5412 mode); |
5414 __ TailCallStub(&stub); | 5413 __ TailCallStub(&stub); |
5415 } else if (mode == DONT_OVERRIDE) { | 5414 } else if (mode == DONT_OVERRIDE) { |
5416 int last_index = GetSequenceIndexFromFastElementsKind( | 5415 int last_index = GetSequenceIndexFromFastElementsKind( |
5417 TERMINAL_FAST_ELEMENTS_KIND); | 5416 TERMINAL_FAST_ELEMENTS_KIND); |
5418 for (int i = 0; i <= last_index; ++i) { | 5417 for (int i = 0; i <= last_index; ++i) { |
5419 Label next; | 5418 Label next; |
5420 ElementsKind kind = GetFastElementsKindFromSequenceIndex(i); | 5419 ElementsKind kind = GetFastElementsKindFromSequenceIndex(i); |
5421 __ cmp(edx, kind); | 5420 __ cmp(edx, kind); |
5422 __ j(not_equal, &next); | 5421 __ j(not_equal, &next); |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5458 // look at the first argument | 5457 // look at the first argument |
5459 __ mov(ecx, Operand(esp, kPointerSize)); | 5458 __ mov(ecx, Operand(esp, kPointerSize)); |
5460 __ test(ecx, ecx); | 5459 __ test(ecx, ecx); |
5461 __ j(zero, &normal_sequence); | 5460 __ j(zero, &normal_sequence); |
5462 | 5461 |
5463 if (mode == DISABLE_ALLOCATION_SITES) { | 5462 if (mode == DISABLE_ALLOCATION_SITES) { |
5464 ElementsKind initial = GetInitialFastElementsKind(); | 5463 ElementsKind initial = GetInitialFastElementsKind(); |
5465 ElementsKind holey_initial = GetHoleyElementsKind(initial); | 5464 ElementsKind holey_initial = GetHoleyElementsKind(initial); |
5466 | 5465 |
5467 ArraySingleArgumentConstructorStub stub_holey(holey_initial, | 5466 ArraySingleArgumentConstructorStub stub_holey(holey_initial, |
5468 CONTEXT_CHECK_REQUIRED, | |
5469 DISABLE_ALLOCATION_SITES); | 5467 DISABLE_ALLOCATION_SITES); |
5470 __ TailCallStub(&stub_holey); | 5468 __ TailCallStub(&stub_holey); |
5471 | 5469 |
5472 __ bind(&normal_sequence); | 5470 __ bind(&normal_sequence); |
5473 ArraySingleArgumentConstructorStub stub(initial, | 5471 ArraySingleArgumentConstructorStub stub(initial, |
5474 CONTEXT_CHECK_REQUIRED, | |
5475 DISABLE_ALLOCATION_SITES); | 5472 DISABLE_ALLOCATION_SITES); |
5476 __ TailCallStub(&stub); | 5473 __ TailCallStub(&stub); |
5477 } else if (mode == DONT_OVERRIDE) { | 5474 } else if (mode == DONT_OVERRIDE) { |
5478 // We are going to create a holey array, but our kind is non-holey. | 5475 // We are going to create a holey array, but our kind is non-holey. |
5479 // Fix kind and retry. | 5476 // Fix kind and retry. |
5480 __ inc(edx); | 5477 __ inc(edx); |
5481 __ mov(ecx, FieldOperand(ebx, Cell::kValueOffset)); | 5478 __ mov(ecx, FieldOperand(ebx, Cell::kValueOffset)); |
5482 if (FLAG_debug_code) { | 5479 if (FLAG_debug_code) { |
5483 Handle<Map> allocation_site_map = | 5480 Handle<Map> allocation_site_map = |
5484 masm->isolate()->factory()->allocation_site_map(); | 5481 masm->isolate()->factory()->allocation_site_map(); |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5516 | 5513 |
5517 template<class T> | 5514 template<class T> |
5518 static void ArrayConstructorStubAheadOfTimeHelper(Isolate* isolate) { | 5515 static void ArrayConstructorStubAheadOfTimeHelper(Isolate* isolate) { |
5519 int to_index = GetSequenceIndexFromFastElementsKind( | 5516 int to_index = GetSequenceIndexFromFastElementsKind( |
5520 TERMINAL_FAST_ELEMENTS_KIND); | 5517 TERMINAL_FAST_ELEMENTS_KIND); |
5521 for (int i = 0; i <= to_index; ++i) { | 5518 for (int i = 0; i <= to_index; ++i) { |
5522 ElementsKind kind = GetFastElementsKindFromSequenceIndex(i); | 5519 ElementsKind kind = GetFastElementsKindFromSequenceIndex(i); |
5523 T stub(kind); | 5520 T stub(kind); |
5524 stub.GetCode(isolate); | 5521 stub.GetCode(isolate); |
5525 if (AllocationSite::GetMode(kind) != DONT_TRACK_ALLOCATION_SITE) { | 5522 if (AllocationSite::GetMode(kind) != DONT_TRACK_ALLOCATION_SITE) { |
5526 T stub1(kind, CONTEXT_CHECK_REQUIRED, DISABLE_ALLOCATION_SITES); | 5523 T stub1(kind, DISABLE_ALLOCATION_SITES); |
5527 stub1.GetCode(isolate); | 5524 stub1.GetCode(isolate); |
5528 } | 5525 } |
5529 } | 5526 } |
5530 } | 5527 } |
5531 | 5528 |
5532 | 5529 |
5533 void ArrayConstructorStubBase::GenerateStubsAheadOfTime(Isolate* isolate) { | 5530 void ArrayConstructorStubBase::GenerateStubsAheadOfTime(Isolate* isolate) { |
5534 ArrayConstructorStubAheadOfTimeHelper<ArrayNoArgumentConstructorStub>( | 5531 ArrayConstructorStubAheadOfTimeHelper<ArrayNoArgumentConstructorStub>( |
5535 isolate); | 5532 isolate); |
5536 ArrayConstructorStubAheadOfTimeHelper<ArraySingleArgumentConstructorStub>( | 5533 ArrayConstructorStubAheadOfTimeHelper<ArraySingleArgumentConstructorStub>( |
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5725 __ bind(&fast_elements_case); | 5722 __ bind(&fast_elements_case); |
5726 GenerateCase(masm, FAST_ELEMENTS); | 5723 GenerateCase(masm, FAST_ELEMENTS); |
5727 } | 5724 } |
5728 | 5725 |
5729 | 5726 |
5730 #undef __ | 5727 #undef __ |
5731 | 5728 |
5732 } } // namespace v8::internal | 5729 } } // namespace v8::internal |
5733 | 5730 |
5734 #endif // V8_TARGET_ARCH_IA32 | 5731 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |