| 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 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 186 static Register registers[] = { r0 }; | 186 static Register registers[] = { r0 }; |
| 187 descriptor->register_param_count_ = 1; | 187 descriptor->register_param_count_ = 1; |
| 188 descriptor->register_params_ = registers; | 188 descriptor->register_params_ = registers; |
| 189 descriptor->deoptimization_handler_ = | 189 descriptor->deoptimization_handler_ = |
| 190 FUNCTION_ADDR(CompareNilIC_Miss); | 190 FUNCTION_ADDR(CompareNilIC_Miss); |
| 191 descriptor->SetMissHandler( | 191 descriptor->SetMissHandler( |
| 192 ExternalReference(IC_Utility(IC::kCompareNilIC_Miss), isolate)); | 192 ExternalReference(IC_Utility(IC::kCompareNilIC_Miss), isolate)); |
| 193 } | 193 } |
| 194 | 194 |
| 195 | 195 |
| 196 void BinaryOpStub::InitializeInterfaceDescriptor( | 196 void BinaryOpICStub::InitializeInterfaceDescriptor( |
| 197 Isolate* isolate, | 197 Isolate* isolate, |
| 198 CodeStubInterfaceDescriptor* descriptor) { | 198 CodeStubInterfaceDescriptor* descriptor) { |
| 199 static Register registers[] = { r1, r0 }; | 199 static Register registers[] = { r1, r0 }; |
| 200 descriptor->register_param_count_ = 2; | 200 descriptor->register_param_count_ = 2; |
| 201 descriptor->register_params_ = registers; | 201 descriptor->register_params_ = registers; |
| 202 descriptor->deoptimization_handler_ = FUNCTION_ADDR(BinaryOpIC_Miss); | 202 descriptor->deoptimization_handler_ = FUNCTION_ADDR(BinaryOpIC_Miss); |
| 203 descriptor->SetMissHandler( | 203 descriptor->SetMissHandler( |
| 204 ExternalReference(IC_Utility(IC::kBinaryOpIC_Miss), isolate)); | 204 ExternalReference(IC_Utility(IC::kBinaryOpIC_Miss), isolate)); |
| 205 } | 205 } |
| 206 | 206 |
| (...skipping 479 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 686 __ eor(result_reg, result_reg, Operand(scratch_high, ASR, 31)); | 686 __ eor(result_reg, result_reg, Operand(scratch_high, ASR, 31)); |
| 687 __ add(result_reg, result_reg, Operand(scratch_high, LSR, 31)); | 687 __ add(result_reg, result_reg, Operand(scratch_high, LSR, 31)); |
| 688 | 688 |
| 689 __ bind(&done); | 689 __ bind(&done); |
| 690 | 690 |
| 691 __ Pop(scratch_high, scratch_low); | 691 __ Pop(scratch_high, scratch_low); |
| 692 __ Ret(); | 692 __ Ret(); |
| 693 } | 693 } |
| 694 | 694 |
| 695 | 695 |
| 696 bool WriteInt32ToHeapNumberStub::IsPregenerated(Isolate* isolate) { | |
| 697 // These variants are compiled ahead of time. See next method. | |
| 698 if (the_int_.is(r1) && the_heap_number_.is(r0) && scratch_.is(r2)) { | |
| 699 return true; | |
| 700 } | |
| 701 if (the_int_.is(r2) && the_heap_number_.is(r0) && scratch_.is(r3)) { | |
| 702 return true; | |
| 703 } | |
| 704 // Other register combinations are generated as and when they are needed, | |
| 705 // so it is unsafe to call them from stubs (we can't generate a stub while | |
| 706 // we are generating a stub). | |
| 707 return false; | |
| 708 } | |
| 709 | |
| 710 | |
| 711 void WriteInt32ToHeapNumberStub::GenerateFixedRegStubsAheadOfTime( | 696 void WriteInt32ToHeapNumberStub::GenerateFixedRegStubsAheadOfTime( |
| 712 Isolate* isolate) { | 697 Isolate* isolate) { |
| 713 WriteInt32ToHeapNumberStub stub1(r1, r0, r2); | 698 WriteInt32ToHeapNumberStub stub1(r1, r0, r2); |
| 714 WriteInt32ToHeapNumberStub stub2(r2, r0, r3); | 699 WriteInt32ToHeapNumberStub stub2(r2, r0, r3); |
| 715 stub1.GetCode(isolate)->set_is_pregenerated(true); | 700 stub1.GetCode(isolate); |
| 716 stub2.GetCode(isolate)->set_is_pregenerated(true); | 701 stub2.GetCode(isolate); |
| 717 } | 702 } |
| 718 | 703 |
| 719 | 704 |
| 720 // See comment for class. | 705 // See comment for class. |
| 721 void WriteInt32ToHeapNumberStub::Generate(MacroAssembler* masm) { | 706 void WriteInt32ToHeapNumberStub::Generate(MacroAssembler* masm) { |
| 722 Label max_negative_int; | 707 Label max_negative_int; |
| 723 // the_int_ has the answer which is a signed int32 but not a Smi. | 708 // the_int_ has the answer which is a signed int32 but not a Smi. |
| 724 // We test for the special value that has a different exponent. This test | 709 // We test for the special value that has a different exponent. This test |
| 725 // has the neat side effect of setting the flags according to the sign. | 710 // has the neat side effect of setting the flags according to the sign. |
| 726 STATIC_ASSERT(HeapNumber::kSignMask == 0x80000000u); | 711 STATIC_ASSERT(HeapNumber::kSignMask == 0x80000000u); |
| (...skipping 699 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1426 | 1411 |
| 1427 __ push(lr); | 1412 __ push(lr); |
| 1428 __ PrepareCallCFunction(0, 1, scratch); | 1413 __ PrepareCallCFunction(0, 1, scratch); |
| 1429 if (masm->use_eabi_hardfloat()) { | 1414 if (masm->use_eabi_hardfloat()) { |
| 1430 __ vmov(d0, d2); | 1415 __ vmov(d0, d2); |
| 1431 } else { | 1416 } else { |
| 1432 __ vmov(r0, r1, d2); | 1417 __ vmov(r0, r1, d2); |
| 1433 } | 1418 } |
| 1434 AllowExternalCallThatCantCauseGC scope(masm); | 1419 AllowExternalCallThatCantCauseGC scope(masm); |
| 1435 switch (type_) { | 1420 switch (type_) { |
| 1436 case TranscendentalCache::SIN: | |
| 1437 __ CallCFunction(ExternalReference::math_sin_double_function(isolate), | |
| 1438 0, 1); | |
| 1439 break; | |
| 1440 case TranscendentalCache::COS: | |
| 1441 __ CallCFunction(ExternalReference::math_cos_double_function(isolate), | |
| 1442 0, 1); | |
| 1443 break; | |
| 1444 case TranscendentalCache::TAN: | |
| 1445 __ CallCFunction(ExternalReference::math_tan_double_function(isolate), | |
| 1446 0, 1); | |
| 1447 break; | |
| 1448 case TranscendentalCache::LOG: | 1421 case TranscendentalCache::LOG: |
| 1449 __ CallCFunction(ExternalReference::math_log_double_function(isolate), | 1422 __ CallCFunction(ExternalReference::math_log_double_function(isolate), |
| 1450 0, 1); | 1423 0, 1); |
| 1451 break; | 1424 break; |
| 1452 default: | 1425 default: |
| 1453 UNIMPLEMENTED(); | 1426 UNIMPLEMENTED(); |
| 1454 break; | 1427 break; |
| 1455 } | 1428 } |
| 1456 __ pop(lr); | 1429 __ pop(lr); |
| 1457 } | 1430 } |
| 1458 | 1431 |
| 1459 | 1432 |
| 1460 Runtime::FunctionId TranscendentalCacheStub::RuntimeFunction() { | 1433 Runtime::FunctionId TranscendentalCacheStub::RuntimeFunction() { |
| 1461 switch (type_) { | 1434 switch (type_) { |
| 1462 // Add more cases when necessary. | 1435 // Add more cases when necessary. |
| 1463 case TranscendentalCache::SIN: return Runtime::kMath_sin; | |
| 1464 case TranscendentalCache::COS: return Runtime::kMath_cos; | |
| 1465 case TranscendentalCache::TAN: return Runtime::kMath_tan; | |
| 1466 case TranscendentalCache::LOG: return Runtime::kMath_log; | 1436 case TranscendentalCache::LOG: return Runtime::kMath_log; |
| 1467 default: | 1437 default: |
| 1468 UNIMPLEMENTED(); | 1438 UNIMPLEMENTED(); |
| 1469 return Runtime::kAbort; | 1439 return Runtime::kAbort; |
| 1470 } | 1440 } |
| 1471 } | 1441 } |
| 1472 | 1442 |
| 1473 | 1443 |
| 1474 void MathPowStub::Generate(MacroAssembler* masm) { | 1444 void MathPowStub::Generate(MacroAssembler* masm) { |
| 1475 const Register base = r1; | 1445 const Register base = r1; |
| (...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1667 __ Ret(); | 1637 __ Ret(); |
| 1668 } | 1638 } |
| 1669 } | 1639 } |
| 1670 | 1640 |
| 1671 | 1641 |
| 1672 bool CEntryStub::NeedsImmovableCode() { | 1642 bool CEntryStub::NeedsImmovableCode() { |
| 1673 return true; | 1643 return true; |
| 1674 } | 1644 } |
| 1675 | 1645 |
| 1676 | 1646 |
| 1677 bool CEntryStub::IsPregenerated(Isolate* isolate) { | |
| 1678 return (!save_doubles_ || isolate->fp_stubs_generated()) && | |
| 1679 result_size_ == 1; | |
| 1680 } | |
| 1681 | |
| 1682 | |
| 1683 void CodeStub::GenerateStubsAheadOfTime(Isolate* isolate) { | 1647 void CodeStub::GenerateStubsAheadOfTime(Isolate* isolate) { |
| 1684 CEntryStub::GenerateAheadOfTime(isolate); | 1648 CEntryStub::GenerateAheadOfTime(isolate); |
| 1685 WriteInt32ToHeapNumberStub::GenerateFixedRegStubsAheadOfTime(isolate); | 1649 WriteInt32ToHeapNumberStub::GenerateFixedRegStubsAheadOfTime(isolate); |
| 1686 StoreBufferOverflowStub::GenerateFixedRegStubsAheadOfTime(isolate); | 1650 StoreBufferOverflowStub::GenerateFixedRegStubsAheadOfTime(isolate); |
| 1687 StubFailureTrampolineStub::GenerateAheadOfTime(isolate); | 1651 StubFailureTrampolineStub::GenerateAheadOfTime(isolate); |
| 1688 RecordWriteStub::GenerateFixedRegStubsAheadOfTime(isolate); | |
| 1689 ArrayConstructorStubBase::GenerateStubsAheadOfTime(isolate); | 1652 ArrayConstructorStubBase::GenerateStubsAheadOfTime(isolate); |
| 1690 CreateAllocationSiteStub::GenerateAheadOfTime(isolate); | 1653 CreateAllocationSiteStub::GenerateAheadOfTime(isolate); |
| 1691 BinaryOpStub::GenerateAheadOfTime(isolate); | 1654 BinaryOpICStub::GenerateAheadOfTime(isolate); |
| 1692 } | 1655 } |
| 1693 | 1656 |
| 1694 | 1657 |
| 1695 void CodeStub::GenerateFPStubs(Isolate* isolate) { | 1658 void CodeStub::GenerateFPStubs(Isolate* isolate) { |
| 1696 SaveFPRegsMode mode = kSaveFPRegs; | 1659 SaveFPRegsMode mode = kSaveFPRegs; |
| 1697 CEntryStub save_doubles(1, mode); | 1660 CEntryStub save_doubles(1, mode); |
| 1698 StoreBufferOverflowStub stub(mode); | 1661 StoreBufferOverflowStub stub(mode); |
| 1699 // These stubs might already be in the snapshot, detect that and don't | 1662 // These stubs might already be in the snapshot, detect that and don't |
| 1700 // regenerate, which would lead to code stub initialization state being messed | 1663 // regenerate, which would lead to code stub initialization state being messed |
| 1701 // up. | 1664 // up. |
| 1702 Code* save_doubles_code; | 1665 Code* save_doubles_code; |
| 1703 if (!save_doubles.FindCodeInCache(&save_doubles_code, isolate)) { | 1666 if (!save_doubles.FindCodeInCache(&save_doubles_code, isolate)) { |
| 1704 save_doubles_code = *save_doubles.GetCode(isolate); | 1667 save_doubles_code = *save_doubles.GetCode(isolate); |
| 1705 } | 1668 } |
| 1706 Code* store_buffer_overflow_code; | 1669 Code* store_buffer_overflow_code; |
| 1707 if (!stub.FindCodeInCache(&store_buffer_overflow_code, isolate)) { | 1670 if (!stub.FindCodeInCache(&store_buffer_overflow_code, isolate)) { |
| 1708 store_buffer_overflow_code = *stub.GetCode(isolate); | 1671 store_buffer_overflow_code = *stub.GetCode(isolate); |
| 1709 } | 1672 } |
| 1710 save_doubles_code->set_is_pregenerated(true); | |
| 1711 store_buffer_overflow_code->set_is_pregenerated(true); | |
| 1712 isolate->set_fp_stubs_generated(true); | 1673 isolate->set_fp_stubs_generated(true); |
| 1713 } | 1674 } |
| 1714 | 1675 |
| 1715 | 1676 |
| 1716 void CEntryStub::GenerateAheadOfTime(Isolate* isolate) { | 1677 void CEntryStub::GenerateAheadOfTime(Isolate* isolate) { |
| 1717 CEntryStub stub(1, kDontSaveFPRegs); | 1678 CEntryStub stub(1, kDontSaveFPRegs); |
| 1718 Handle<Code> code = stub.GetCode(isolate); | 1679 stub.GetCode(isolate); |
| 1719 code->set_is_pregenerated(true); | |
| 1720 } | 1680 } |
| 1721 | 1681 |
| 1722 | 1682 |
| 1723 static void JumpIfOOM(MacroAssembler* masm, | 1683 static void JumpIfOOM(MacroAssembler* masm, |
| 1724 Register value, | 1684 Register value, |
| 1725 Register scratch, | 1685 Register scratch, |
| 1726 Label* oom_label) { | 1686 Label* oom_label) { |
| 1727 STATIC_ASSERT(Failure::OUT_OF_MEMORY_EXCEPTION == 3); | 1687 STATIC_ASSERT(Failure::OUT_OF_MEMORY_EXCEPTION == 3); |
| 1728 STATIC_ASSERT(kFailureTag == 3); | 1688 STATIC_ASSERT(kFailureTag == 3); |
| 1729 __ and_(scratch, value, Operand(0xf)); | 1689 __ and_(scratch, value, Operand(0xf)); |
| (...skipping 3610 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5340 __ bind(&in_dictionary); | 5300 __ bind(&in_dictionary); |
| 5341 __ mov(result, Operand(1)); | 5301 __ mov(result, Operand(1)); |
| 5342 __ Ret(); | 5302 __ Ret(); |
| 5343 | 5303 |
| 5344 __ bind(¬_in_dictionary); | 5304 __ bind(¬_in_dictionary); |
| 5345 __ mov(result, Operand::Zero()); | 5305 __ mov(result, Operand::Zero()); |
| 5346 __ Ret(); | 5306 __ Ret(); |
| 5347 } | 5307 } |
| 5348 | 5308 |
| 5349 | 5309 |
| 5350 struct AheadOfTimeWriteBarrierStubList { | |
| 5351 Register object, value, address; | |
| 5352 RememberedSetAction action; | |
| 5353 }; | |
| 5354 | |
| 5355 | |
| 5356 #define REG(Name) { kRegister_ ## Name ## _Code } | |
| 5357 | |
| 5358 static const AheadOfTimeWriteBarrierStubList kAheadOfTime[] = { | |
| 5359 // Used in RegExpExecStub. | |
| 5360 { REG(r6), REG(r4), REG(r3), EMIT_REMEMBERED_SET }, | |
| 5361 // Used in CompileArrayPushCall. | |
| 5362 // Also used in StoreIC::GenerateNormal via GenerateDictionaryStore. | |
| 5363 // Also used in KeyedStoreIC::GenerateGeneric. | |
| 5364 { REG(r3), REG(r4), REG(r5), EMIT_REMEMBERED_SET }, | |
| 5365 // Used in StoreStubCompiler::CompileStoreField via GenerateStoreField. | |
| 5366 { REG(r1), REG(r2), REG(r3), EMIT_REMEMBERED_SET }, | |
| 5367 { REG(r3), REG(r2), REG(r1), EMIT_REMEMBERED_SET }, | |
| 5368 // Used in KeyedStoreStubCompiler::CompileStoreField via GenerateStoreField. | |
| 5369 { REG(r2), REG(r1), REG(r3), EMIT_REMEMBERED_SET }, | |
| 5370 { REG(r3), REG(r1), REG(r2), EMIT_REMEMBERED_SET }, | |
| 5371 // KeyedStoreStubCompiler::GenerateStoreFastElement. | |
| 5372 { REG(r3), REG(r2), REG(r4), EMIT_REMEMBERED_SET }, | |
| 5373 { REG(r2), REG(r3), REG(r4), EMIT_REMEMBERED_SET }, | |
| 5374 // ElementsTransitionGenerator::GenerateMapChangeElementTransition | |
| 5375 // and ElementsTransitionGenerator::GenerateSmiToDouble | |
| 5376 // and ElementsTransitionGenerator::GenerateDoubleToObject | |
| 5377 { REG(r2), REG(r3), REG(r9), EMIT_REMEMBERED_SET }, | |
| 5378 { REG(r2), REG(r3), REG(r9), OMIT_REMEMBERED_SET }, | |
| 5379 // ElementsTransitionGenerator::GenerateDoubleToObject | |
| 5380 { REG(r6), REG(r2), REG(r0), EMIT_REMEMBERED_SET }, | |
| 5381 { REG(r2), REG(r6), REG(r9), EMIT_REMEMBERED_SET }, | |
| 5382 // StoreArrayLiteralElementStub::Generate | |
| 5383 { REG(r5), REG(r0), REG(r6), EMIT_REMEMBERED_SET }, | |
| 5384 // FastNewClosureStub::Generate | |
| 5385 { REG(r2), REG(r4), REG(r1), EMIT_REMEMBERED_SET }, | |
| 5386 // StringAddStub::Generate | |
| 5387 { REG(r3), REG(r1), REG(r4), EMIT_REMEMBERED_SET }, | |
| 5388 { REG(r3), REG(r0), REG(r4), EMIT_REMEMBERED_SET }, | |
| 5389 // Null termination. | |
| 5390 { REG(no_reg), REG(no_reg), REG(no_reg), EMIT_REMEMBERED_SET} | |
| 5391 }; | |
| 5392 | |
| 5393 #undef REG | |
| 5394 | |
| 5395 | |
| 5396 bool RecordWriteStub::IsPregenerated(Isolate* isolate) { | |
| 5397 for (const AheadOfTimeWriteBarrierStubList* entry = kAheadOfTime; | |
| 5398 !entry->object.is(no_reg); | |
| 5399 entry++) { | |
| 5400 if (object_.is(entry->object) && | |
| 5401 value_.is(entry->value) && | |
| 5402 address_.is(entry->address) && | |
| 5403 remembered_set_action_ == entry->action && | |
| 5404 save_fp_regs_mode_ == kDontSaveFPRegs) { | |
| 5405 return true; | |
| 5406 } | |
| 5407 } | |
| 5408 return false; | |
| 5409 } | |
| 5410 | |
| 5411 | |
| 5412 void StoreBufferOverflowStub::GenerateFixedRegStubsAheadOfTime( | 5310 void StoreBufferOverflowStub::GenerateFixedRegStubsAheadOfTime( |
| 5413 Isolate* isolate) { | 5311 Isolate* isolate) { |
| 5414 StoreBufferOverflowStub stub1(kDontSaveFPRegs); | 5312 StoreBufferOverflowStub stub1(kDontSaveFPRegs); |
| 5415 stub1.GetCode(isolate)->set_is_pregenerated(true); | 5313 stub1.GetCode(isolate); |
| 5416 // Hydrogen code stubs need stub2 at snapshot time. | 5314 // Hydrogen code stubs need stub2 at snapshot time. |
| 5417 StoreBufferOverflowStub stub2(kSaveFPRegs); | 5315 StoreBufferOverflowStub stub2(kSaveFPRegs); |
| 5418 stub2.GetCode(isolate)->set_is_pregenerated(true); | 5316 stub2.GetCode(isolate); |
| 5419 } | 5317 } |
| 5420 | 5318 |
| 5421 | 5319 |
| 5422 void RecordWriteStub::GenerateFixedRegStubsAheadOfTime(Isolate* isolate) { | |
| 5423 for (const AheadOfTimeWriteBarrierStubList* entry = kAheadOfTime; | |
| 5424 !entry->object.is(no_reg); | |
| 5425 entry++) { | |
| 5426 RecordWriteStub stub(entry->object, | |
| 5427 entry->value, | |
| 5428 entry->address, | |
| 5429 entry->action, | |
| 5430 kDontSaveFPRegs); | |
| 5431 stub.GetCode(isolate)->set_is_pregenerated(true); | |
| 5432 } | |
| 5433 } | |
| 5434 | |
| 5435 | |
| 5436 bool CodeStub::CanUseFPRegisters() { | 5320 bool CodeStub::CanUseFPRegisters() { |
| 5437 return true; // VFP2 is a base requirement for V8 | 5321 return true; // VFP2 is a base requirement for V8 |
| 5438 } | 5322 } |
| 5439 | 5323 |
| 5440 | 5324 |
| 5441 // Takes the input in 3 registers: address_ value_ and object_. A pointer to | 5325 // Takes the input in 3 registers: address_ value_ and object_. A pointer to |
| 5442 // the value has just been written into the object, now this stub makes sure | 5326 // the value has just been written into the object, now this stub makes sure |
| 5443 // we keep the GC informed. The word in the object where the value has been | 5327 // we keep the GC informed. The word in the object where the value has been |
| 5444 // written is in the address register. | 5328 // written is in the address register. |
| 5445 void RecordWriteStub::Generate(MacroAssembler* masm) { | 5329 void RecordWriteStub::Generate(MacroAssembler* masm) { |
| (...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5731 masm->LeaveFrame(StackFrame::STUB_FAILURE_TRAMPOLINE); | 5615 masm->LeaveFrame(StackFrame::STUB_FAILURE_TRAMPOLINE); |
| 5732 ParameterCount argument_count(r0); | 5616 ParameterCount argument_count(r0); |
| 5733 __ InvokeFunction( | 5617 __ InvokeFunction( |
| 5734 r1, argument_count, JUMP_FUNCTION, NullCallWrapper(), CALL_AS_METHOD); | 5618 r1, argument_count, JUMP_FUNCTION, NullCallWrapper(), CALL_AS_METHOD); |
| 5735 } | 5619 } |
| 5736 | 5620 |
| 5737 | 5621 |
| 5738 void ProfileEntryHookStub::MaybeCallEntryHook(MacroAssembler* masm) { | 5622 void ProfileEntryHookStub::MaybeCallEntryHook(MacroAssembler* masm) { |
| 5739 if (masm->isolate()->function_entry_hook() != NULL) { | 5623 if (masm->isolate()->function_entry_hook() != NULL) { |
| 5740 PredictableCodeSizeScope predictable(masm, 4 * Assembler::kInstrSize); | 5624 PredictableCodeSizeScope predictable(masm, 4 * Assembler::kInstrSize); |
| 5741 AllowStubCallsScope allow_stub_calls(masm, true); | |
| 5742 ProfileEntryHookStub stub; | 5625 ProfileEntryHookStub stub; |
| 5743 __ push(lr); | 5626 __ push(lr); |
| 5744 __ CallStub(&stub); | 5627 __ CallStub(&stub); |
| 5745 __ pop(lr); | 5628 __ pop(lr); |
| 5746 } | 5629 } |
| 5747 } | 5630 } |
| 5748 | 5631 |
| 5749 | 5632 |
| 5750 void ProfileEntryHookStub::Generate(MacroAssembler* masm) { | 5633 void ProfileEntryHookStub::Generate(MacroAssembler* masm) { |
| 5751 // The entry hook is a "push lr" instruction, followed by a call. | 5634 // The entry hook is a "push lr" instruction, followed by a call. |
| (...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5924 template<class T> | 5807 template<class T> |
| 5925 static void ArrayConstructorStubAheadOfTimeHelper(Isolate* isolate) { | 5808 static void ArrayConstructorStubAheadOfTimeHelper(Isolate* isolate) { |
| 5926 ElementsKind initial_kind = GetInitialFastElementsKind(); | 5809 ElementsKind initial_kind = GetInitialFastElementsKind(); |
| 5927 ElementsKind initial_holey_kind = GetHoleyElementsKind(initial_kind); | 5810 ElementsKind initial_holey_kind = GetHoleyElementsKind(initial_kind); |
| 5928 | 5811 |
| 5929 int to_index = GetSequenceIndexFromFastElementsKind( | 5812 int to_index = GetSequenceIndexFromFastElementsKind( |
| 5930 TERMINAL_FAST_ELEMENTS_KIND); | 5813 TERMINAL_FAST_ELEMENTS_KIND); |
| 5931 for (int i = 0; i <= to_index; ++i) { | 5814 for (int i = 0; i <= to_index; ++i) { |
| 5932 ElementsKind kind = GetFastElementsKindFromSequenceIndex(i); | 5815 ElementsKind kind = GetFastElementsKindFromSequenceIndex(i); |
| 5933 T stub(kind); | 5816 T stub(kind); |
| 5934 stub.GetCode(isolate)->set_is_pregenerated(true); | 5817 stub.GetCode(isolate); |
| 5935 if (AllocationSite::GetMode(kind) != DONT_TRACK_ALLOCATION_SITE || | 5818 if (AllocationSite::GetMode(kind) != DONT_TRACK_ALLOCATION_SITE || |
| 5936 (!FLAG_track_allocation_sites && | 5819 (!FLAG_track_allocation_sites && |
| 5937 (kind == initial_kind || kind == initial_holey_kind))) { | 5820 (kind == initial_kind || kind == initial_holey_kind))) { |
| 5938 T stub1(kind, CONTEXT_CHECK_REQUIRED, DISABLE_ALLOCATION_SITES); | 5821 T stub1(kind, CONTEXT_CHECK_REQUIRED, DISABLE_ALLOCATION_SITES); |
| 5939 stub1.GetCode(isolate)->set_is_pregenerated(true); | 5822 stub1.GetCode(isolate); |
| 5940 } | 5823 } |
| 5941 } | 5824 } |
| 5942 } | 5825 } |
| 5943 | 5826 |
| 5944 | 5827 |
| 5945 void ArrayConstructorStubBase::GenerateStubsAheadOfTime(Isolate* isolate) { | 5828 void ArrayConstructorStubBase::GenerateStubsAheadOfTime(Isolate* isolate) { |
| 5946 ArrayConstructorStubAheadOfTimeHelper<ArrayNoArgumentConstructorStub>( | 5829 ArrayConstructorStubAheadOfTimeHelper<ArrayNoArgumentConstructorStub>( |
| 5947 isolate); | 5830 isolate); |
| 5948 ArrayConstructorStubAheadOfTimeHelper<ArraySingleArgumentConstructorStub>( | 5831 ArrayConstructorStubAheadOfTimeHelper<ArraySingleArgumentConstructorStub>( |
| 5949 isolate); | 5832 isolate); |
| 5950 ArrayConstructorStubAheadOfTimeHelper<ArrayNArgumentsConstructorStub>( | 5833 ArrayConstructorStubAheadOfTimeHelper<ArrayNArgumentsConstructorStub>( |
| 5951 isolate); | 5834 isolate); |
| 5952 } | 5835 } |
| 5953 | 5836 |
| 5954 | 5837 |
| 5955 void InternalArrayConstructorStubBase::GenerateStubsAheadOfTime( | 5838 void InternalArrayConstructorStubBase::GenerateStubsAheadOfTime( |
| 5956 Isolate* isolate) { | 5839 Isolate* isolate) { |
| 5957 ElementsKind kinds[2] = { FAST_ELEMENTS, FAST_HOLEY_ELEMENTS }; | 5840 ElementsKind kinds[2] = { FAST_ELEMENTS, FAST_HOLEY_ELEMENTS }; |
| 5958 for (int i = 0; i < 2; i++) { | 5841 for (int i = 0; i < 2; i++) { |
| 5959 // For internal arrays we only need a few things | 5842 // For internal arrays we only need a few things |
| 5960 InternalArrayNoArgumentConstructorStub stubh1(kinds[i]); | 5843 InternalArrayNoArgumentConstructorStub stubh1(kinds[i]); |
| 5961 stubh1.GetCode(isolate)->set_is_pregenerated(true); | 5844 stubh1.GetCode(isolate); |
| 5962 InternalArraySingleArgumentConstructorStub stubh2(kinds[i]); | 5845 InternalArraySingleArgumentConstructorStub stubh2(kinds[i]); |
| 5963 stubh2.GetCode(isolate)->set_is_pregenerated(true); | 5846 stubh2.GetCode(isolate); |
| 5964 InternalArrayNArgumentsConstructorStub stubh3(kinds[i]); | 5847 InternalArrayNArgumentsConstructorStub stubh3(kinds[i]); |
| 5965 stubh3.GetCode(isolate)->set_is_pregenerated(true); | 5848 stubh3.GetCode(isolate); |
| 5966 } | 5849 } |
| 5967 } | 5850 } |
| 5968 | 5851 |
| 5969 | 5852 |
| 5970 void ArrayConstructorStub::GenerateDispatchToArrayStub( | 5853 void ArrayConstructorStub::GenerateDispatchToArrayStub( |
| 5971 MacroAssembler* masm, | 5854 MacroAssembler* masm, |
| 5972 AllocationSiteOverrideMode mode) { | 5855 AllocationSiteOverrideMode mode) { |
| 5973 if (argument_count_ == ANY) { | 5856 if (argument_count_ == ANY) { |
| 5974 Label not_zero_case, not_one_case; | 5857 Label not_zero_case, not_one_case; |
| 5975 __ tst(r0, r0); | 5858 __ tst(r0, r0); |
| (...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6132 __ bind(&fast_elements_case); | 6015 __ bind(&fast_elements_case); |
| 6133 GenerateCase(masm, FAST_ELEMENTS); | 6016 GenerateCase(masm, FAST_ELEMENTS); |
| 6134 } | 6017 } |
| 6135 | 6018 |
| 6136 | 6019 |
| 6137 #undef __ | 6020 #undef __ |
| 6138 | 6021 |
| 6139 } } // namespace v8::internal | 6022 } } // namespace v8::internal |
| 6140 | 6023 |
| 6141 #endif // V8_TARGET_ARCH_ARM | 6024 #endif // V8_TARGET_ARCH_ARM |
| OLD | NEW |