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 7015 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7026 __ ret(2 * kPointerSize); | 7026 __ ret(2 * kPointerSize); |
7027 } | 7027 } |
7028 | 7028 |
7029 | 7029 |
7030 struct AheadOfTimeWriteBarrierStubList { | 7030 struct AheadOfTimeWriteBarrierStubList { |
7031 Register object, value, address; | 7031 Register object, value, address; |
7032 RememberedSetAction action; | 7032 RememberedSetAction action; |
7033 }; | 7033 }; |
7034 | 7034 |
7035 | 7035 |
7036 struct AheadOfTimeWriteBarrierStubList kAheadOfTime[] = { | 7036 #define REG(Name) { kRegister_ ## Name ## _Code } |
| 7037 |
| 7038 static const AheadOfTimeWriteBarrierStubList kAheadOfTime[] = { |
7037 // Used in RegExpExecStub. | 7039 // Used in RegExpExecStub. |
7038 { ebx, eax, edi, EMIT_REMEMBERED_SET }, | 7040 { REG(ebx), REG(eax), REG(edi), EMIT_REMEMBERED_SET }, |
7039 // Used in CompileArrayPushCall. | 7041 // Used in CompileArrayPushCall. |
7040 { ebx, ecx, edx, EMIT_REMEMBERED_SET }, | 7042 { REG(ebx), REG(ecx), REG(edx), EMIT_REMEMBERED_SET }, |
7041 { ebx, edi, edx, OMIT_REMEMBERED_SET }, | 7043 { REG(ebx), REG(edi), REG(edx), OMIT_REMEMBERED_SET }, |
7042 // Used in CompileStoreGlobal and CallFunctionStub. | 7044 // Used in CompileStoreGlobal and CallFunctionStub. |
7043 { ebx, ecx, edx, OMIT_REMEMBERED_SET }, | 7045 { REG(ebx), REG(ecx), REG(edx), OMIT_REMEMBERED_SET }, |
7044 // Used in StoreStubCompiler::CompileStoreField and | 7046 // Used in StoreStubCompiler::CompileStoreField and |
7045 // KeyedStoreStubCompiler::CompileStoreField via GenerateStoreField. | 7047 // KeyedStoreStubCompiler::CompileStoreField via GenerateStoreField. |
7046 { edx, ecx, ebx, EMIT_REMEMBERED_SET }, | 7048 { REG(edx), REG(ecx), REG(ebx), EMIT_REMEMBERED_SET }, |
7047 // GenerateStoreField calls the stub with two different permutations of | 7049 // GenerateStoreField calls the stub with two different permutations of |
7048 // registers. This is the second. | 7050 // registers. This is the second. |
7049 { ebx, ecx, edx, EMIT_REMEMBERED_SET }, | 7051 { REG(ebx), REG(ecx), REG(edx), EMIT_REMEMBERED_SET }, |
7050 // StoreIC::GenerateNormal via GenerateDictionaryStore | 7052 // StoreIC::GenerateNormal via GenerateDictionaryStore |
7051 { ebx, edi, edx, EMIT_REMEMBERED_SET }, | 7053 { REG(ebx), REG(edi), REG(edx), EMIT_REMEMBERED_SET }, |
7052 // KeyedStoreIC::GenerateGeneric. | 7054 // KeyedStoreIC::GenerateGeneric. |
7053 { ebx, edx, ecx, EMIT_REMEMBERED_SET}, | 7055 { REG(ebx), REG(edx), REG(ecx), EMIT_REMEMBERED_SET}, |
7054 // KeyedStoreStubCompiler::GenerateStoreFastElement. | 7056 // KeyedStoreStubCompiler::GenerateStoreFastElement. |
7055 { edi, ebx, ecx, EMIT_REMEMBERED_SET}, | 7057 { REG(edi), REG(ebx), REG(ecx), EMIT_REMEMBERED_SET}, |
7056 { edx, edi, ebx, EMIT_REMEMBERED_SET}, | 7058 { REG(edx), REG(edi), REG(ebx), EMIT_REMEMBERED_SET}, |
7057 // ElementsTransitionGenerator::GenerateSmiOnlyToObject | 7059 // ElementsTransitionGenerator::GenerateSmiOnlyToObject |
7058 // and ElementsTransitionGenerator::GenerateSmiOnlyToDouble | 7060 // and ElementsTransitionGenerator::GenerateSmiOnlyToDouble |
7059 // and ElementsTransitionGenerator::GenerateDoubleToObject | 7061 // and ElementsTransitionGenerator::GenerateDoubleToObject |
7060 { edx, ebx, edi, EMIT_REMEMBERED_SET}, | 7062 { REG(edx), REG(ebx), REG(edi), EMIT_REMEMBERED_SET}, |
7061 { edx, ebx, edi, OMIT_REMEMBERED_SET}, | 7063 { REG(edx), REG(ebx), REG(edi), OMIT_REMEMBERED_SET}, |
7062 // ElementsTransitionGenerator::GenerateDoubleToObject | 7064 // ElementsTransitionGenerator::GenerateDoubleToObject |
7063 { eax, edx, esi, EMIT_REMEMBERED_SET}, | 7065 { REG(eax), REG(edx), REG(esi), EMIT_REMEMBERED_SET}, |
7064 { edx, eax, edi, EMIT_REMEMBERED_SET}, | 7066 { REG(edx), REG(eax), REG(edi), EMIT_REMEMBERED_SET}, |
7065 // StoreArrayLiteralElementStub::Generate | 7067 // StoreArrayLiteralElementStub::Generate |
7066 { ebx, eax, ecx, EMIT_REMEMBERED_SET}, | 7068 { REG(ebx), REG(eax), REG(ecx), EMIT_REMEMBERED_SET}, |
7067 // Null termination. | 7069 // Null termination. |
7068 { no_reg, no_reg, no_reg, EMIT_REMEMBERED_SET} | 7070 { REG(no_reg), REG(no_reg), REG(no_reg), EMIT_REMEMBERED_SET} |
7069 }; | 7071 }; |
7070 | 7072 |
| 7073 #undef REG |
7071 | 7074 |
7072 bool RecordWriteStub::IsPregenerated() { | 7075 bool RecordWriteStub::IsPregenerated() { |
7073 for (AheadOfTimeWriteBarrierStubList* entry = kAheadOfTime; | 7076 for (const AheadOfTimeWriteBarrierStubList* entry = kAheadOfTime; |
7074 !entry->object.is(no_reg); | 7077 !entry->object.is(no_reg); |
7075 entry++) { | 7078 entry++) { |
7076 if (object_.is(entry->object) && | 7079 if (object_.is(entry->object) && |
7077 value_.is(entry->value) && | 7080 value_.is(entry->value) && |
7078 address_.is(entry->address) && | 7081 address_.is(entry->address) && |
7079 remembered_set_action_ == entry->action && | 7082 remembered_set_action_ == entry->action && |
7080 save_fp_regs_mode_ == kDontSaveFPRegs) { | 7083 save_fp_regs_mode_ == kDontSaveFPRegs) { |
7081 return true; | 7084 return true; |
7082 } | 7085 } |
7083 } | 7086 } |
7084 return false; | 7087 return false; |
7085 } | 7088 } |
7086 | 7089 |
7087 | 7090 |
7088 void StoreBufferOverflowStub::GenerateFixedRegStubsAheadOfTime() { | 7091 void StoreBufferOverflowStub::GenerateFixedRegStubsAheadOfTime() { |
7089 StoreBufferOverflowStub stub1(kDontSaveFPRegs); | 7092 StoreBufferOverflowStub stub1(kDontSaveFPRegs); |
7090 stub1.GetCode()->set_is_pregenerated(true); | 7093 stub1.GetCode()->set_is_pregenerated(true); |
7091 | 7094 |
7092 CpuFeatures::TryForceFeatureScope scope(SSE2); | 7095 CpuFeatures::TryForceFeatureScope scope(SSE2); |
7093 if (CpuFeatures::IsSupported(SSE2)) { | 7096 if (CpuFeatures::IsSupported(SSE2)) { |
7094 StoreBufferOverflowStub stub2(kSaveFPRegs); | 7097 StoreBufferOverflowStub stub2(kSaveFPRegs); |
7095 stub2.GetCode()->set_is_pregenerated(true); | 7098 stub2.GetCode()->set_is_pregenerated(true); |
7096 } | 7099 } |
7097 } | 7100 } |
7098 | 7101 |
7099 | 7102 |
7100 void RecordWriteStub::GenerateFixedRegStubsAheadOfTime() { | 7103 void RecordWriteStub::GenerateFixedRegStubsAheadOfTime() { |
7101 for (AheadOfTimeWriteBarrierStubList* entry = kAheadOfTime; | 7104 for (const AheadOfTimeWriteBarrierStubList* entry = kAheadOfTime; |
7102 !entry->object.is(no_reg); | 7105 !entry->object.is(no_reg); |
7103 entry++) { | 7106 entry++) { |
7104 RecordWriteStub stub(entry->object, | 7107 RecordWriteStub stub(entry->object, |
7105 entry->value, | 7108 entry->value, |
7106 entry->address, | 7109 entry->address, |
7107 entry->action, | 7110 entry->action, |
7108 kDontSaveFPRegs); | 7111 kDontSaveFPRegs); |
7109 stub.GetCode()->set_is_pregenerated(true); | 7112 stub.GetCode()->set_is_pregenerated(true); |
7110 } | 7113 } |
7111 } | 7114 } |
(...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7385 false); | 7388 false); |
7386 __ pop(edx); | 7389 __ pop(edx); |
7387 __ ret(0); | 7390 __ ret(0); |
7388 } | 7391 } |
7389 | 7392 |
7390 #undef __ | 7393 #undef __ |
7391 | 7394 |
7392 } } // namespace v8::internal | 7395 } } // namespace v8::internal |
7393 | 7396 |
7394 #endif // V8_TARGET_ARCH_IA32 | 7397 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |