| 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 631 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 642 __ Subu(result_reg, zero_reg, input_high); | 642 __ Subu(result_reg, zero_reg, input_high); |
| 643 __ Movz(result_reg, input_high, scratch); | 643 __ Movz(result_reg, input_high, scratch); |
| 644 | 644 |
| 645 __ bind(&done); | 645 __ bind(&done); |
| 646 | 646 |
| 647 __ Pop(scratch, scratch2, scratch3); | 647 __ Pop(scratch, scratch2, scratch3); |
| 648 __ Ret(); | 648 __ Ret(); |
| 649 } | 649 } |
| 650 | 650 |
| 651 | 651 |
| 652 bool WriteInt32ToHeapNumberStub::IsPregenerated() { | 652 bool WriteInt32ToHeapNumberStub::IsPregenerated(Isolate* isolate) { |
| 653 // These variants are compiled ahead of time. See next method. | 653 // These variants are compiled ahead of time. See next method. |
| 654 if (the_int_.is(a1) && | 654 if (the_int_.is(a1) && |
| 655 the_heap_number_.is(v0) && | 655 the_heap_number_.is(v0) && |
| 656 scratch_.is(a2) && | 656 scratch_.is(a2) && |
| 657 sign_.is(a3)) { | 657 sign_.is(a3)) { |
| 658 return true; | 658 return true; |
| 659 } | 659 } |
| 660 if (the_int_.is(a2) && | 660 if (the_int_.is(a2) && |
| 661 the_heap_number_.is(v0) && | 661 the_heap_number_.is(v0) && |
| 662 scratch_.is(a3) && | 662 scratch_.is(a3) && |
| (...skipping 2053 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2716 __ Ret(); | 2716 __ Ret(); |
| 2717 } | 2717 } |
| 2718 } | 2718 } |
| 2719 | 2719 |
| 2720 | 2720 |
| 2721 bool CEntryStub::NeedsImmovableCode() { | 2721 bool CEntryStub::NeedsImmovableCode() { |
| 2722 return true; | 2722 return true; |
| 2723 } | 2723 } |
| 2724 | 2724 |
| 2725 | 2725 |
| 2726 bool CEntryStub::IsPregenerated() { | 2726 bool CEntryStub::IsPregenerated(Isolate* isolate) { |
| 2727 return (!save_doubles_ || ISOLATE->fp_stubs_generated()) && | 2727 return (!save_doubles_ || isolate->fp_stubs_generated()) && |
| 2728 result_size_ == 1; | 2728 result_size_ == 1; |
| 2729 } | 2729 } |
| 2730 | 2730 |
| 2731 | 2731 |
| 2732 void CodeStub::GenerateStubsAheadOfTime(Isolate* isolate) { | 2732 void CodeStub::GenerateStubsAheadOfTime(Isolate* isolate) { |
| 2733 CEntryStub::GenerateAheadOfTime(isolate); | 2733 CEntryStub::GenerateAheadOfTime(isolate); |
| 2734 WriteInt32ToHeapNumberStub::GenerateFixedRegStubsAheadOfTime(isolate); | 2734 WriteInt32ToHeapNumberStub::GenerateFixedRegStubsAheadOfTime(isolate); |
| 2735 StoreBufferOverflowStub::GenerateFixedRegStubsAheadOfTime(isolate); | 2735 StoreBufferOverflowStub::GenerateFixedRegStubsAheadOfTime(isolate); |
| 2736 StubFailureTrampolineStub::GenerateAheadOfTime(isolate); | 2736 StubFailureTrampolineStub::GenerateAheadOfTime(isolate); |
| 2737 RecordWriteStub::GenerateFixedRegStubsAheadOfTime(isolate); | 2737 RecordWriteStub::GenerateFixedRegStubsAheadOfTime(isolate); |
| (...skipping 3809 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6547 | 6547 |
| 6548 #define REG(Name) { kRegister_ ## Name ## _Code } | 6548 #define REG(Name) { kRegister_ ## Name ## _Code } |
| 6549 | 6549 |
| 6550 static const AheadOfTimeWriteBarrierStubList kAheadOfTime[] = { | 6550 static const AheadOfTimeWriteBarrierStubList kAheadOfTime[] = { |
| 6551 // Used in RegExpExecStub. | 6551 // Used in RegExpExecStub. |
| 6552 { REG(s2), REG(s0), REG(t3), EMIT_REMEMBERED_SET }, | 6552 { REG(s2), REG(s0), REG(t3), EMIT_REMEMBERED_SET }, |
| 6553 // Used in CompileArrayPushCall. | 6553 // Used in CompileArrayPushCall. |
| 6554 // Also used in StoreIC::GenerateNormal via GenerateDictionaryStore. | 6554 // Also used in StoreIC::GenerateNormal via GenerateDictionaryStore. |
| 6555 // Also used in KeyedStoreIC::GenerateGeneric. | 6555 // Also used in KeyedStoreIC::GenerateGeneric. |
| 6556 { REG(a3), REG(t0), REG(t1), EMIT_REMEMBERED_SET }, | 6556 { REG(a3), REG(t0), REG(t1), EMIT_REMEMBERED_SET }, |
| 6557 // Used in CompileStoreGlobal. | |
| 6558 { REG(t0), REG(a1), REG(a2), OMIT_REMEMBERED_SET }, | |
| 6559 // Used in StoreStubCompiler::CompileStoreField via GenerateStoreField. | 6557 // Used in StoreStubCompiler::CompileStoreField via GenerateStoreField. |
| 6560 { REG(a1), REG(a2), REG(a3), EMIT_REMEMBERED_SET }, | 6558 { REG(a1), REG(a2), REG(a3), EMIT_REMEMBERED_SET }, |
| 6561 { REG(a3), REG(a2), REG(a1), EMIT_REMEMBERED_SET }, | 6559 { REG(a3), REG(a2), REG(a1), EMIT_REMEMBERED_SET }, |
| 6562 // Used in KeyedStoreStubCompiler::CompileStoreField via GenerateStoreField. | 6560 // Used in KeyedStoreStubCompiler::CompileStoreField via GenerateStoreField. |
| 6563 { REG(a2), REG(a1), REG(a3), EMIT_REMEMBERED_SET }, | 6561 { REG(a2), REG(a1), REG(a3), EMIT_REMEMBERED_SET }, |
| 6564 { REG(a3), REG(a1), REG(a2), EMIT_REMEMBERED_SET }, | 6562 { REG(a3), REG(a1), REG(a2), EMIT_REMEMBERED_SET }, |
| 6565 // KeyedStoreStubCompiler::GenerateStoreFastElement. | 6563 // KeyedStoreStubCompiler::GenerateStoreFastElement. |
| 6566 { REG(a3), REG(a2), REG(t0), EMIT_REMEMBERED_SET }, | 6564 { REG(a3), REG(a2), REG(t0), EMIT_REMEMBERED_SET }, |
| 6567 { REG(a2), REG(a3), REG(t0), EMIT_REMEMBERED_SET }, | 6565 { REG(a2), REG(a3), REG(t0), EMIT_REMEMBERED_SET }, |
| 6568 // ElementsTransitionGenerator::GenerateMapChangeElementTransition | 6566 // ElementsTransitionGenerator::GenerateMapChangeElementTransition |
| (...skipping 11 matching lines...) Expand all Loading... |
| 6580 // StringAddStub::Generate | 6578 // StringAddStub::Generate |
| 6581 { REG(t3), REG(a1), REG(t0), EMIT_REMEMBERED_SET }, | 6579 { REG(t3), REG(a1), REG(t0), EMIT_REMEMBERED_SET }, |
| 6582 { REG(t3), REG(a0), REG(t0), EMIT_REMEMBERED_SET }, | 6580 { REG(t3), REG(a0), REG(t0), EMIT_REMEMBERED_SET }, |
| 6583 // Null termination. | 6581 // Null termination. |
| 6584 { REG(no_reg), REG(no_reg), REG(no_reg), EMIT_REMEMBERED_SET} | 6582 { REG(no_reg), REG(no_reg), REG(no_reg), EMIT_REMEMBERED_SET} |
| 6585 }; | 6583 }; |
| 6586 | 6584 |
| 6587 #undef REG | 6585 #undef REG |
| 6588 | 6586 |
| 6589 | 6587 |
| 6590 bool RecordWriteStub::IsPregenerated() { | 6588 bool RecordWriteStub::IsPregenerated(Isolate* isolate) { |
| 6591 for (const AheadOfTimeWriteBarrierStubList* entry = kAheadOfTime; | 6589 for (const AheadOfTimeWriteBarrierStubList* entry = kAheadOfTime; |
| 6592 !entry->object.is(no_reg); | 6590 !entry->object.is(no_reg); |
| 6593 entry++) { | 6591 entry++) { |
| 6594 if (object_.is(entry->object) && | 6592 if (object_.is(entry->object) && |
| 6595 value_.is(entry->value) && | 6593 value_.is(entry->value) && |
| 6596 address_.is(entry->address) && | 6594 address_.is(entry->address) && |
| 6597 remembered_set_action_ == entry->action && | 6595 remembered_set_action_ == entry->action && |
| 6598 save_fp_regs_mode_ == kDontSaveFPRegs) { | 6596 save_fp_regs_mode_ == kDontSaveFPRegs) { |
| 6599 return true; | 6597 return true; |
| 6600 } | 6598 } |
| (...skipping 355 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6956 __ And(sp, sp, Operand(-frame_alignment)); | 6954 __ And(sp, sp, Operand(-frame_alignment)); |
| 6957 } | 6955 } |
| 6958 | 6956 |
| 6959 #if defined(V8_HOST_ARCH_MIPS) | 6957 #if defined(V8_HOST_ARCH_MIPS) |
| 6960 int32_t entry_hook = | 6958 int32_t entry_hook = |
| 6961 reinterpret_cast<int32_t>(masm->isolate()->function_entry_hook()); | 6959 reinterpret_cast<int32_t>(masm->isolate()->function_entry_hook()); |
| 6962 __ li(at, Operand(entry_hook)); | 6960 __ li(at, Operand(entry_hook)); |
| 6963 #else | 6961 #else |
| 6964 // Under the simulator we need to indirect the entry hook through a | 6962 // Under the simulator we need to indirect the entry hook through a |
| 6965 // trampoline function at a known address. | 6963 // trampoline function at a known address. |
| 6964 // It additionally takes an isolate as a third parameter. |
| 6965 __ li(a2, Operand(ExternalReference::isolate_address(masm->isolate()))); |
| 6966 |
| 6966 ApiFunction dispatcher(FUNCTION_ADDR(EntryHookTrampoline)); | 6967 ApiFunction dispatcher(FUNCTION_ADDR(EntryHookTrampoline)); |
| 6967 __ li(at, Operand(ExternalReference(&dispatcher, | 6968 __ li(at, Operand(ExternalReference(&dispatcher, |
| 6968 ExternalReference::BUILTIN_CALL, | 6969 ExternalReference::BUILTIN_CALL, |
| 6969 masm->isolate()))); | 6970 masm->isolate()))); |
| 6970 #endif | 6971 #endif |
| 6971 __ Call(at); | 6972 __ Call(at); |
| 6972 | 6973 |
| 6973 // Restore the stack pointer if needed. | 6974 // Restore the stack pointer if needed. |
| 6974 if (frame_alignment > kPointerSize) { | 6975 if (frame_alignment > kPointerSize) { |
| 6975 __ mov(sp, s5); | 6976 __ mov(sp, s5); |
| (...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7255 __ bind(&fast_elements_case); | 7256 __ bind(&fast_elements_case); |
| 7256 GenerateCase(masm, FAST_ELEMENTS); | 7257 GenerateCase(masm, FAST_ELEMENTS); |
| 7257 } | 7258 } |
| 7258 | 7259 |
| 7259 | 7260 |
| 7260 #undef __ | 7261 #undef __ |
| 7261 | 7262 |
| 7262 } } // namespace v8::internal | 7263 } } // namespace v8::internal |
| 7263 | 7264 |
| 7264 #endif // V8_TARGET_ARCH_MIPS | 7265 #endif // V8_TARGET_ARCH_MIPS |
| OLD | NEW |