| 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 604 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 615 __ eor(result_reg, result_reg, Operand(scratch_high, ASR, 31)); | 615 __ eor(result_reg, result_reg, Operand(scratch_high, ASR, 31)); |
| 616 __ add(result_reg, result_reg, Operand(scratch_high, LSR, 31)); | 616 __ add(result_reg, result_reg, Operand(scratch_high, LSR, 31)); |
| 617 | 617 |
| 618 __ bind(&done); | 618 __ bind(&done); |
| 619 | 619 |
| 620 __ Pop(scratch_high, scratch_low); | 620 __ Pop(scratch_high, scratch_low); |
| 621 __ Ret(); | 621 __ Ret(); |
| 622 } | 622 } |
| 623 | 623 |
| 624 | 624 |
| 625 bool WriteInt32ToHeapNumberStub::IsPregenerated() { | 625 bool WriteInt32ToHeapNumberStub::IsPregenerated(Isolate* isolate) { |
| 626 // These variants are compiled ahead of time. See next method. | 626 // These variants are compiled ahead of time. See next method. |
| 627 if (the_int_.is(r1) && the_heap_number_.is(r0) && scratch_.is(r2)) { | 627 if (the_int_.is(r1) && the_heap_number_.is(r0) && scratch_.is(r2)) { |
| 628 return true; | 628 return true; |
| 629 } | 629 } |
| 630 if (the_int_.is(r2) && the_heap_number_.is(r0) && scratch_.is(r3)) { | 630 if (the_int_.is(r2) && the_heap_number_.is(r0) && scratch_.is(r3)) { |
| 631 return true; | 631 return true; |
| 632 } | 632 } |
| 633 // Other register combinations are generated as and when they are needed, | 633 // Other register combinations are generated as and when they are needed, |
| 634 // so it is unsafe to call them from stubs (we can't generate a stub while | 634 // so it is unsafe to call them from stubs (we can't generate a stub while |
| 635 // we are generating a stub). | 635 // we are generating a stub). |
| (...skipping 2051 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2687 __ Ret(); | 2687 __ Ret(); |
| 2688 } | 2688 } |
| 2689 } | 2689 } |
| 2690 | 2690 |
| 2691 | 2691 |
| 2692 bool CEntryStub::NeedsImmovableCode() { | 2692 bool CEntryStub::NeedsImmovableCode() { |
| 2693 return true; | 2693 return true; |
| 2694 } | 2694 } |
| 2695 | 2695 |
| 2696 | 2696 |
| 2697 bool CEntryStub::IsPregenerated() { | 2697 bool CEntryStub::IsPregenerated(Isolate* isolate) { |
| 2698 return (!save_doubles_ || ISOLATE->fp_stubs_generated()) && | 2698 return (!save_doubles_ || isolate->fp_stubs_generated()) && |
| 2699 result_size_ == 1; | 2699 result_size_ == 1; |
| 2700 } | 2700 } |
| 2701 | 2701 |
| 2702 | 2702 |
| 2703 void CodeStub::GenerateStubsAheadOfTime(Isolate* isolate) { | 2703 void CodeStub::GenerateStubsAheadOfTime(Isolate* isolate) { |
| 2704 CEntryStub::GenerateAheadOfTime(isolate); | 2704 CEntryStub::GenerateAheadOfTime(isolate); |
| 2705 WriteInt32ToHeapNumberStub::GenerateFixedRegStubsAheadOfTime(isolate); | 2705 WriteInt32ToHeapNumberStub::GenerateFixedRegStubsAheadOfTime(isolate); |
| 2706 StoreBufferOverflowStub::GenerateFixedRegStubsAheadOfTime(isolate); | 2706 StoreBufferOverflowStub::GenerateFixedRegStubsAheadOfTime(isolate); |
| 2707 StubFailureTrampolineStub::GenerateAheadOfTime(isolate); | 2707 StubFailureTrampolineStub::GenerateAheadOfTime(isolate); |
| 2708 RecordWriteStub::GenerateFixedRegStubsAheadOfTime(isolate); | 2708 RecordWriteStub::GenerateFixedRegStubsAheadOfTime(isolate); |
| (...skipping 3427 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6136 __ pop(lr); | 6136 __ pop(lr); |
| 6137 __ pop(r0); | 6137 __ pop(r0); |
| 6138 __ pop(r1); | 6138 __ pop(r1); |
| 6139 } | 6139 } |
| 6140 | 6140 |
| 6141 __ Jump(r2); | 6141 __ Jump(r2); |
| 6142 } | 6142 } |
| 6143 | 6143 |
| 6144 | 6144 |
| 6145 void DirectCEntryStub::Generate(MacroAssembler* masm) { | 6145 void DirectCEntryStub::Generate(MacroAssembler* masm) { |
| 6146 // Place the return address on the stack, making the call |
| 6147 // GC safe. The RegExp backend also relies on this. |
| 6148 __ str(lr, MemOperand(sp, 0)); |
| 6149 __ blx(ip); // Call the C++ function. |
| 6150 __ VFPEnsureFPSCRState(r2); |
| 6146 __ ldr(pc, MemOperand(sp, 0)); | 6151 __ ldr(pc, MemOperand(sp, 0)); |
| 6147 } | 6152 } |
| 6148 | 6153 |
| 6149 | 6154 |
| 6150 void DirectCEntryStub::GenerateCall(MacroAssembler* masm, | 6155 void DirectCEntryStub::GenerateCall(MacroAssembler* masm, |
| 6151 Register target) { | 6156 Register target) { |
| 6152 intptr_t code = | 6157 intptr_t code = |
| 6153 reinterpret_cast<intptr_t>(GetCode(masm->isolate()).location()); | 6158 reinterpret_cast<intptr_t>(GetCode(masm->isolate()).location()); |
| 6159 __ Move(ip, target); |
| 6154 __ mov(lr, Operand(code, RelocInfo::CODE_TARGET)); | 6160 __ mov(lr, Operand(code, RelocInfo::CODE_TARGET)); |
| 6155 | 6161 __ blx(lr); // Call the stub. |
| 6156 // Prevent literal pool emission during calculation of return address. | |
| 6157 Assembler::BlockConstPoolScope block_const_pool(masm); | |
| 6158 | |
| 6159 // Push return address (accessible to GC through exit frame pc). | |
| 6160 // Note that using pc with str is deprecated. | |
| 6161 Label start; | |
| 6162 __ bind(&start); | |
| 6163 __ add(ip, pc, Operand(Assembler::kInstrSize)); | |
| 6164 __ str(ip, MemOperand(sp, 0)); | |
| 6165 __ Jump(target); // Call the C++ function. | |
| 6166 ASSERT_EQ(Assembler::kInstrSize + Assembler::kPcLoadDelta, | |
| 6167 masm->SizeOfCodeGeneratedSince(&start)); | |
| 6168 __ VFPEnsureFPSCRState(r2); | |
| 6169 } | 6162 } |
| 6170 | 6163 |
| 6171 | 6164 |
| 6172 void NameDictionaryLookupStub::GenerateNegativeLookup(MacroAssembler* masm, | 6165 void NameDictionaryLookupStub::GenerateNegativeLookup(MacroAssembler* masm, |
| 6173 Label* miss, | 6166 Label* miss, |
| 6174 Label* done, | 6167 Label* done, |
| 6175 Register receiver, | 6168 Register receiver, |
| 6176 Register properties, | 6169 Register properties, |
| 6177 Handle<Name> name, | 6170 Handle<Name> name, |
| 6178 Register scratch0) { | 6171 Register scratch0) { |
| (...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6424 | 6417 |
| 6425 #define REG(Name) { kRegister_ ## Name ## _Code } | 6418 #define REG(Name) { kRegister_ ## Name ## _Code } |
| 6426 | 6419 |
| 6427 static const AheadOfTimeWriteBarrierStubList kAheadOfTime[] = { | 6420 static const AheadOfTimeWriteBarrierStubList kAheadOfTime[] = { |
| 6428 // Used in RegExpExecStub. | 6421 // Used in RegExpExecStub. |
| 6429 { REG(r6), REG(r4), REG(r7), EMIT_REMEMBERED_SET }, | 6422 { REG(r6), REG(r4), REG(r7), EMIT_REMEMBERED_SET }, |
| 6430 // Used in CompileArrayPushCall. | 6423 // Used in CompileArrayPushCall. |
| 6431 // Also used in StoreIC::GenerateNormal via GenerateDictionaryStore. | 6424 // Also used in StoreIC::GenerateNormal via GenerateDictionaryStore. |
| 6432 // Also used in KeyedStoreIC::GenerateGeneric. | 6425 // Also used in KeyedStoreIC::GenerateGeneric. |
| 6433 { REG(r3), REG(r4), REG(r5), EMIT_REMEMBERED_SET }, | 6426 { REG(r3), REG(r4), REG(r5), EMIT_REMEMBERED_SET }, |
| 6434 // Used in CompileStoreGlobal. | |
| 6435 { REG(r4), REG(r1), REG(r2), OMIT_REMEMBERED_SET }, | |
| 6436 // Used in StoreStubCompiler::CompileStoreField via GenerateStoreField. | 6427 // Used in StoreStubCompiler::CompileStoreField via GenerateStoreField. |
| 6437 { REG(r1), REG(r2), REG(r3), EMIT_REMEMBERED_SET }, | 6428 { REG(r1), REG(r2), REG(r3), EMIT_REMEMBERED_SET }, |
| 6438 { REG(r3), REG(r2), REG(r1), EMIT_REMEMBERED_SET }, | 6429 { REG(r3), REG(r2), REG(r1), EMIT_REMEMBERED_SET }, |
| 6439 // Used in KeyedStoreStubCompiler::CompileStoreField via GenerateStoreField. | 6430 // Used in KeyedStoreStubCompiler::CompileStoreField via GenerateStoreField. |
| 6440 { REG(r2), REG(r1), REG(r3), EMIT_REMEMBERED_SET }, | 6431 { REG(r2), REG(r1), REG(r3), EMIT_REMEMBERED_SET }, |
| 6441 { REG(r3), REG(r1), REG(r2), EMIT_REMEMBERED_SET }, | 6432 { REG(r3), REG(r1), REG(r2), EMIT_REMEMBERED_SET }, |
| 6442 // KeyedStoreStubCompiler::GenerateStoreFastElement. | 6433 // KeyedStoreStubCompiler::GenerateStoreFastElement. |
| 6443 { REG(r3), REG(r2), REG(r4), EMIT_REMEMBERED_SET }, | 6434 { REG(r3), REG(r2), REG(r4), EMIT_REMEMBERED_SET }, |
| 6444 { REG(r2), REG(r3), REG(r4), EMIT_REMEMBERED_SET }, | 6435 { REG(r2), REG(r3), REG(r4), EMIT_REMEMBERED_SET }, |
| 6445 // ElementsTransitionGenerator::GenerateMapChangeElementTransition | 6436 // ElementsTransitionGenerator::GenerateMapChangeElementTransition |
| (...skipping 11 matching lines...) Expand all Loading... |
| 6457 // StringAddStub::Generate | 6448 // StringAddStub::Generate |
| 6458 { REG(r7), REG(r1), REG(r4), EMIT_REMEMBERED_SET }, | 6449 { REG(r7), REG(r1), REG(r4), EMIT_REMEMBERED_SET }, |
| 6459 { REG(r7), REG(r0), REG(r4), EMIT_REMEMBERED_SET }, | 6450 { REG(r7), REG(r0), REG(r4), EMIT_REMEMBERED_SET }, |
| 6460 // Null termination. | 6451 // Null termination. |
| 6461 { REG(no_reg), REG(no_reg), REG(no_reg), EMIT_REMEMBERED_SET} | 6452 { REG(no_reg), REG(no_reg), REG(no_reg), EMIT_REMEMBERED_SET} |
| 6462 }; | 6453 }; |
| 6463 | 6454 |
| 6464 #undef REG | 6455 #undef REG |
| 6465 | 6456 |
| 6466 | 6457 |
| 6467 bool RecordWriteStub::IsPregenerated() { | 6458 bool RecordWriteStub::IsPregenerated(Isolate* isolate) { |
| 6468 for (const AheadOfTimeWriteBarrierStubList* entry = kAheadOfTime; | 6459 for (const AheadOfTimeWriteBarrierStubList* entry = kAheadOfTime; |
| 6469 !entry->object.is(no_reg); | 6460 !entry->object.is(no_reg); |
| 6470 entry++) { | 6461 entry++) { |
| 6471 if (object_.is(entry->object) && | 6462 if (object_.is(entry->object) && |
| 6472 value_.is(entry->value) && | 6463 value_.is(entry->value) && |
| 6473 address_.is(entry->address) && | 6464 address_.is(entry->address) && |
| 6474 remembered_set_action_ == entry->action && | 6465 remembered_set_action_ == entry->action && |
| 6475 save_fp_regs_mode_ == kDontSaveFPRegs) { | 6466 save_fp_regs_mode_ == kDontSaveFPRegs) { |
| 6476 return true; | 6467 return true; |
| 6477 } | 6468 } |
| (...skipping 358 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6836 __ and_(sp, sp, Operand(-frame_alignment)); | 6827 __ and_(sp, sp, Operand(-frame_alignment)); |
| 6837 } | 6828 } |
| 6838 | 6829 |
| 6839 #if V8_HOST_ARCH_ARM | 6830 #if V8_HOST_ARCH_ARM |
| 6840 int32_t entry_hook = | 6831 int32_t entry_hook = |
| 6841 reinterpret_cast<int32_t>(masm->isolate()->function_entry_hook()); | 6832 reinterpret_cast<int32_t>(masm->isolate()->function_entry_hook()); |
| 6842 __ mov(ip, Operand(entry_hook)); | 6833 __ mov(ip, Operand(entry_hook)); |
| 6843 #else | 6834 #else |
| 6844 // Under the simulator we need to indirect the entry hook through a | 6835 // Under the simulator we need to indirect the entry hook through a |
| 6845 // trampoline function at a known address. | 6836 // trampoline function at a known address. |
| 6837 // It additionally takes an isolate as a third parameter |
| 6838 __ mov(r2, Operand(ExternalReference::isolate_address(masm->isolate()))); |
| 6839 |
| 6846 ApiFunction dispatcher(FUNCTION_ADDR(EntryHookTrampoline)); | 6840 ApiFunction dispatcher(FUNCTION_ADDR(EntryHookTrampoline)); |
| 6847 __ mov(ip, Operand(ExternalReference(&dispatcher, | 6841 __ mov(ip, Operand(ExternalReference(&dispatcher, |
| 6848 ExternalReference::BUILTIN_CALL, | 6842 ExternalReference::BUILTIN_CALL, |
| 6849 masm->isolate()))); | 6843 masm->isolate()))); |
| 6850 #endif | 6844 #endif |
| 6851 __ Call(ip); | 6845 __ Call(ip); |
| 6852 | 6846 |
| 6853 // Restore the stack pointer if needed. | 6847 // Restore the stack pointer if needed. |
| 6854 if (frame_alignment > kPointerSize) { | 6848 if (frame_alignment > kPointerSize) { |
| 6855 __ mov(sp, r5); | 6849 __ mov(sp, r5); |
| (...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7138 __ bind(&fast_elements_case); | 7132 __ bind(&fast_elements_case); |
| 7139 GenerateCase(masm, FAST_ELEMENTS); | 7133 GenerateCase(masm, FAST_ELEMENTS); |
| 7140 } | 7134 } |
| 7141 | 7135 |
| 7142 | 7136 |
| 7143 #undef __ | 7137 #undef __ |
| 7144 | 7138 |
| 7145 } } // namespace v8::internal | 7139 } } // namespace v8::internal |
| 7146 | 7140 |
| 7147 #endif // V8_TARGET_ARCH_ARM | 7141 #endif // V8_TARGET_ARCH_ARM |
| OLD | NEW |