Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(902)

Side by Side Diff: src/ia32/code-stubs-ia32.cc

Issue 9666052: Landing for pliard@chromium.org: Remove static initializers in v8. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 8 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/ia32/assembler-ia32.h ('k') | src/isolate.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 7006 matching lines...) Expand 10 before | Expand all | Expand 10 after
7017 __ ret(2 * kPointerSize); 7017 __ ret(2 * kPointerSize);
7018 } 7018 }
7019 7019
7020 7020
7021 struct AheadOfTimeWriteBarrierStubList { 7021 struct AheadOfTimeWriteBarrierStubList {
7022 Register object, value, address; 7022 Register object, value, address;
7023 RememberedSetAction action; 7023 RememberedSetAction action;
7024 }; 7024 };
7025 7025
7026 7026
7027 struct AheadOfTimeWriteBarrierStubList kAheadOfTime[] = { 7027 #define REG(Name) { kRegister_ ## Name ## _Code }
7028
7029 static const AheadOfTimeWriteBarrierStubList kAheadOfTime[] = {
7028 // Used in RegExpExecStub. 7030 // Used in RegExpExecStub.
7029 { ebx, eax, edi, EMIT_REMEMBERED_SET }, 7031 { REG(ebx), REG(eax), REG(edi), EMIT_REMEMBERED_SET },
7030 // Used in CompileArrayPushCall. 7032 // Used in CompileArrayPushCall.
7031 { ebx, ecx, edx, EMIT_REMEMBERED_SET }, 7033 { REG(ebx), REG(ecx), REG(edx), EMIT_REMEMBERED_SET },
7032 { ebx, edi, edx, OMIT_REMEMBERED_SET }, 7034 { REG(ebx), REG(edi), REG(edx), OMIT_REMEMBERED_SET },
7033 // Used in CompileStoreGlobal and CallFunctionStub. 7035 // Used in CompileStoreGlobal and CallFunctionStub.
7034 { ebx, ecx, edx, OMIT_REMEMBERED_SET }, 7036 { REG(ebx), REG(ecx), REG(edx), OMIT_REMEMBERED_SET },
7035 // Used in StoreStubCompiler::CompileStoreField and 7037 // Used in StoreStubCompiler::CompileStoreField and
7036 // KeyedStoreStubCompiler::CompileStoreField via GenerateStoreField. 7038 // KeyedStoreStubCompiler::CompileStoreField via GenerateStoreField.
7037 { edx, ecx, ebx, EMIT_REMEMBERED_SET }, 7039 { REG(edx), REG(ecx), REG(ebx), EMIT_REMEMBERED_SET },
7038 // GenerateStoreField calls the stub with two different permutations of 7040 // GenerateStoreField calls the stub with two different permutations of
7039 // registers. This is the second. 7041 // registers. This is the second.
7040 { ebx, ecx, edx, EMIT_REMEMBERED_SET }, 7042 { REG(ebx), REG(ecx), REG(edx), EMIT_REMEMBERED_SET },
7041 // StoreIC::GenerateNormal via GenerateDictionaryStore 7043 // StoreIC::GenerateNormal via GenerateDictionaryStore
7042 { ebx, edi, edx, EMIT_REMEMBERED_SET }, 7044 { REG(ebx), REG(edi), REG(edx), EMIT_REMEMBERED_SET },
7043 // KeyedStoreIC::GenerateGeneric. 7045 // KeyedStoreIC::GenerateGeneric.
7044 { ebx, edx, ecx, EMIT_REMEMBERED_SET}, 7046 { REG(ebx), REG(edx), REG(ecx), EMIT_REMEMBERED_SET},
7045 // KeyedStoreStubCompiler::GenerateStoreFastElement. 7047 // KeyedStoreStubCompiler::GenerateStoreFastElement.
7046 { edi, ebx, ecx, EMIT_REMEMBERED_SET}, 7048 { REG(edi), REG(ebx), REG(ecx), EMIT_REMEMBERED_SET},
7047 { edx, edi, ebx, EMIT_REMEMBERED_SET}, 7049 { REG(edx), REG(edi), REG(ebx), EMIT_REMEMBERED_SET},
7048 // ElementsTransitionGenerator::GenerateSmiOnlyToObject 7050 // ElementsTransitionGenerator::GenerateSmiOnlyToObject
7049 // and ElementsTransitionGenerator::GenerateSmiOnlyToDouble 7051 // and ElementsTransitionGenerator::GenerateSmiOnlyToDouble
7050 // and ElementsTransitionGenerator::GenerateDoubleToObject 7052 // and ElementsTransitionGenerator::GenerateDoubleToObject
7051 { edx, ebx, edi, EMIT_REMEMBERED_SET}, 7053 { REG(edx), REG(ebx), REG(edi), EMIT_REMEMBERED_SET},
7052 { edx, ebx, edi, OMIT_REMEMBERED_SET}, 7054 { REG(edx), REG(ebx), REG(edi), OMIT_REMEMBERED_SET},
7053 // ElementsTransitionGenerator::GenerateDoubleToObject 7055 // ElementsTransitionGenerator::GenerateDoubleToObject
7054 { eax, edx, esi, EMIT_REMEMBERED_SET}, 7056 { REG(eax), REG(edx), REG(esi), EMIT_REMEMBERED_SET},
7055 { edx, eax, edi, EMIT_REMEMBERED_SET}, 7057 { REG(edx), REG(eax), REG(edi), EMIT_REMEMBERED_SET},
7056 // StoreArrayLiteralElementStub::Generate 7058 // StoreArrayLiteralElementStub::Generate
7057 { ebx, eax, ecx, EMIT_REMEMBERED_SET}, 7059 { REG(ebx), REG(eax), REG(ecx), EMIT_REMEMBERED_SET},
7058 // Null termination. 7060 // Null termination.
7059 { no_reg, no_reg, no_reg, EMIT_REMEMBERED_SET} 7061 { REG(no_reg), REG(no_reg), REG(no_reg), EMIT_REMEMBERED_SET}
7060 }; 7062 };
7061 7063
7064 #undef REG
7062 7065
7063 bool RecordWriteStub::IsPregenerated() { 7066 bool RecordWriteStub::IsPregenerated() {
7064 for (AheadOfTimeWriteBarrierStubList* entry = kAheadOfTime; 7067 for (const AheadOfTimeWriteBarrierStubList* entry = kAheadOfTime;
7065 !entry->object.is(no_reg); 7068 !entry->object.is(no_reg);
7066 entry++) { 7069 entry++) {
7067 if (object_.is(entry->object) && 7070 if (object_.is(entry->object) &&
7068 value_.is(entry->value) && 7071 value_.is(entry->value) &&
7069 address_.is(entry->address) && 7072 address_.is(entry->address) &&
7070 remembered_set_action_ == entry->action && 7073 remembered_set_action_ == entry->action &&
7071 save_fp_regs_mode_ == kDontSaveFPRegs) { 7074 save_fp_regs_mode_ == kDontSaveFPRegs) {
7072 return true; 7075 return true;
7073 } 7076 }
7074 } 7077 }
7075 return false; 7078 return false;
7076 } 7079 }
7077 7080
7078 7081
7079 void StoreBufferOverflowStub::GenerateFixedRegStubsAheadOfTime() { 7082 void StoreBufferOverflowStub::GenerateFixedRegStubsAheadOfTime() {
7080 StoreBufferOverflowStub stub1(kDontSaveFPRegs); 7083 StoreBufferOverflowStub stub1(kDontSaveFPRegs);
7081 stub1.GetCode()->set_is_pregenerated(true); 7084 stub1.GetCode()->set_is_pregenerated(true);
7082 7085
7083 CpuFeatures::TryForceFeatureScope scope(SSE2); 7086 CpuFeatures::TryForceFeatureScope scope(SSE2);
7084 if (CpuFeatures::IsSupported(SSE2)) { 7087 if (CpuFeatures::IsSupported(SSE2)) {
7085 StoreBufferOverflowStub stub2(kSaveFPRegs); 7088 StoreBufferOverflowStub stub2(kSaveFPRegs);
7086 stub2.GetCode()->set_is_pregenerated(true); 7089 stub2.GetCode()->set_is_pregenerated(true);
7087 } 7090 }
7088 } 7091 }
7089 7092
7090 7093
7091 void RecordWriteStub::GenerateFixedRegStubsAheadOfTime() { 7094 void RecordWriteStub::GenerateFixedRegStubsAheadOfTime() {
7092 for (AheadOfTimeWriteBarrierStubList* entry = kAheadOfTime; 7095 for (const AheadOfTimeWriteBarrierStubList* entry = kAheadOfTime;
7093 !entry->object.is(no_reg); 7096 !entry->object.is(no_reg);
7094 entry++) { 7097 entry++) {
7095 RecordWriteStub stub(entry->object, 7098 RecordWriteStub stub(entry->object,
7096 entry->value, 7099 entry->value,
7097 entry->address, 7100 entry->address,
7098 entry->action, 7101 entry->action,
7099 kDontSaveFPRegs); 7102 kDontSaveFPRegs);
7100 stub.GetCode()->set_is_pregenerated(true); 7103 stub.GetCode()->set_is_pregenerated(true);
7101 } 7104 }
7102 } 7105 }
(...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after
7376 false); 7379 false);
7377 __ pop(edx); 7380 __ pop(edx);
7378 __ ret(0); 7381 __ ret(0);
7379 } 7382 }
7380 7383
7381 #undef __ 7384 #undef __
7382 7385
7383 } } // namespace v8::internal 7386 } } // namespace v8::internal
7384 7387
7385 #endif // V8_TARGET_ARCH_IA32 7388 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/ia32/assembler-ia32.h ('k') | src/isolate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698