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

Side by Side Diff: src/ia32/stub-cache-ia32.cc

Issue 8372029: Handlify the remaining stub compiler functions for call ICs. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 9 years, 2 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/ic-ia32.cc ('k') | src/ic.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 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 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 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
158 } 158 }
159 159
160 160
161 void StubCache::GenerateProbe(MacroAssembler* masm, 161 void StubCache::GenerateProbe(MacroAssembler* masm,
162 Code::Flags flags, 162 Code::Flags flags,
163 Register receiver, 163 Register receiver,
164 Register name, 164 Register name,
165 Register scratch, 165 Register scratch,
166 Register extra, 166 Register extra,
167 Register extra2) { 167 Register extra2) {
168 Isolate* isolate = Isolate::Current();
169 Label miss; 168 Label miss;
170 USE(extra2); // The register extra2 is not used on the ia32 platform.
171 169
172 // Make sure that code is valid. The shifting code relies on the 170 // Assert that code is valid. The shifting code relies on the entry size
173 // entry size being 8. 171 // being 8.
174 ASSERT(sizeof(Entry) == 8); 172 ASSERT(sizeof(Entry) == 8);
175 173
176 // Make sure the flags does not name a specific type. 174 // Assert the flags do not name a specific type.
177 ASSERT(Code::ExtractTypeFromFlags(flags) == 0); 175 ASSERT(Code::ExtractTypeFromFlags(flags) == 0);
178 176
179 // Make sure that there are no register conflicts. 177 // Assert that there are no register conflicts.
180 ASSERT(!scratch.is(receiver)); 178 ASSERT(!scratch.is(receiver));
181 ASSERT(!scratch.is(name)); 179 ASSERT(!scratch.is(name));
182 ASSERT(!extra.is(receiver)); 180 ASSERT(!extra.is(receiver));
183 ASSERT(!extra.is(name)); 181 ASSERT(!extra.is(name));
184 ASSERT(!extra.is(scratch)); 182 ASSERT(!extra.is(scratch));
185 183
186 // Check scratch and extra registers are valid, and extra2 is unused. 184 // Assert scratch and extra registers are valid, and extra2 is unused.
187 ASSERT(!scratch.is(no_reg)); 185 ASSERT(!scratch.is(no_reg));
188 ASSERT(extra2.is(no_reg)); 186 ASSERT(extra2.is(no_reg));
189 187
190 // Check that the receiver isn't a smi. 188 // Check that the receiver isn't a smi.
191 __ JumpIfSmi(receiver, &miss); 189 __ JumpIfSmi(receiver, &miss);
192 190
193 // Get the map of the receiver and compute the hash. 191 // Get the map of the receiver and compute the hash.
194 __ mov(scratch, FieldOperand(name, String::kHashFieldOffset)); 192 __ mov(scratch, FieldOperand(name, String::kHashFieldOffset));
195 __ add(scratch, FieldOperand(receiver, HeapObject::kMapOffset)); 193 __ add(scratch, FieldOperand(receiver, HeapObject::kMapOffset));
196 __ xor_(scratch, flags); 194 __ xor_(scratch, flags);
197 __ and_(scratch, (kPrimaryTableSize - 1) << kHeapObjectTagSize); 195 __ and_(scratch, (kPrimaryTableSize - 1) << kHeapObjectTagSize);
198 196
199 // Probe the primary table. 197 // Probe the primary table.
200 ProbeTable(isolate, masm, flags, kPrimary, name, scratch, extra); 198 ProbeTable(isolate(), masm, flags, kPrimary, name, scratch, extra);
201 199
202 // Primary miss: Compute hash for secondary probe. 200 // Primary miss: Compute hash for secondary probe.
203 __ mov(scratch, FieldOperand(name, String::kHashFieldOffset)); 201 __ mov(scratch, FieldOperand(name, String::kHashFieldOffset));
204 __ add(scratch, FieldOperand(receiver, HeapObject::kMapOffset)); 202 __ add(scratch, FieldOperand(receiver, HeapObject::kMapOffset));
205 __ xor_(scratch, flags); 203 __ xor_(scratch, flags);
206 __ and_(scratch, (kPrimaryTableSize - 1) << kHeapObjectTagSize); 204 __ and_(scratch, (kPrimaryTableSize - 1) << kHeapObjectTagSize);
207 __ sub(scratch, name); 205 __ sub(scratch, name);
208 __ add(scratch, Immediate(flags)); 206 __ add(scratch, Immediate(flags));
209 __ and_(scratch, (kSecondaryTableSize - 1) << kHeapObjectTagSize); 207 __ and_(scratch, (kSecondaryTableSize - 1) << kHeapObjectTagSize);
210 208
211 // Probe the secondary table. 209 // Probe the secondary table.
212 ProbeTable(isolate, masm, flags, kSecondary, name, scratch, extra); 210 ProbeTable(isolate(), masm, flags, kSecondary, name, scratch, extra);
213 211
214 // Cache miss: Fall-through and let caller handle the miss by 212 // Cache miss: Fall-through and let caller handle the miss by
215 // entering the runtime system. 213 // entering the runtime system.
216 __ bind(&miss); 214 __ bind(&miss);
217 } 215 }
218 216
219 217
220 void StubCompiler::GenerateLoadGlobalFunctionPrototype(MacroAssembler* masm, 218 void StubCompiler::GenerateLoadGlobalFunctionPrototype(MacroAssembler* masm,
221 int index, 219 int index,
222 Register prototype) { 220 Register prototype) {
(...skipping 3795 matching lines...) Expand 10 before | Expand all | Expand 10 after
4018 Handle<Code> ic_miss = masm->isolate()->builtins()->KeyedStoreIC_Miss(); 4016 Handle<Code> ic_miss = masm->isolate()->builtins()->KeyedStoreIC_Miss();
4019 __ jmp(ic_miss, RelocInfo::CODE_TARGET); 4017 __ jmp(ic_miss, RelocInfo::CODE_TARGET);
4020 } 4018 }
4021 4019
4022 4020
4023 #undef __ 4021 #undef __
4024 4022
4025 } } // namespace v8::internal 4023 } } // namespace v8::internal
4026 4024
4027 #endif // V8_TARGET_ARCH_IA32 4025 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/ia32/ic-ia32.cc ('k') | src/ic.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698