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

Side by Side Diff: src/ic/mips/ic-mips.cc

Issue 546733003: MIPS: To aid vector-based load ic work, we need to be able to handle the megamorphic load case in h… (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 3 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 | « no previous file | src/ic/mips/stub-cache-mips.cc » ('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 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 5
6 #include "src/v8.h" 6 #include "src/v8.h"
7 7
8 #if V8_TARGET_ARCH_MIPS 8 #if V8_TARGET_ARCH_MIPS
9 9
10 #include "src/codegen.h" 10 #include "src/codegen.h"
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after
242 // map: key map 242 // map: key map
243 __ lbu(hash, FieldMemOperand(map, Map::kInstanceTypeOffset)); 243 __ lbu(hash, FieldMemOperand(map, Map::kInstanceTypeOffset));
244 STATIC_ASSERT(kInternalizedTag == 0); 244 STATIC_ASSERT(kInternalizedTag == 0);
245 __ And(at, hash, Operand(kIsNotInternalizedMask)); 245 __ And(at, hash, Operand(kIsNotInternalizedMask));
246 __ Branch(not_unique, ne, at, Operand(zero_reg)); 246 __ Branch(not_unique, ne, at, Operand(zero_reg));
247 247
248 __ bind(&unique); 248 __ bind(&unique);
249 } 249 }
250 250
251 251
252 void LoadIC::GenerateMegamorphic(MacroAssembler* masm) {
253 // The return address is in lr.
254 Register receiver = LoadDescriptor::ReceiverRegister();
255 Register name = LoadDescriptor::NameRegister();
256 DCHECK(receiver.is(a1));
257 DCHECK(name.is(a2));
258
259 // Probe the stub cache.
260 Code::Flags flags = Code::RemoveTypeAndHolderFromFlags(
261 Code::ComputeHandlerFlags(Code::LOAD_IC));
262 masm->isolate()->stub_cache()->GenerateProbe(masm, flags, receiver, name, a3,
263 t0, t1, t2);
264
265 // Cache miss: Jump to runtime.
266 GenerateMiss(masm);
267 }
268
269
270 void LoadIC::GenerateNormal(MacroAssembler* masm) { 252 void LoadIC::GenerateNormal(MacroAssembler* masm) {
271 Register dictionary = a0; 253 Register dictionary = a0;
272 DCHECK(!dictionary.is(LoadDescriptor::ReceiverRegister())); 254 DCHECK(!dictionary.is(LoadDescriptor::ReceiverRegister()));
273 DCHECK(!dictionary.is(LoadDescriptor::NameRegister())); 255 DCHECK(!dictionary.is(LoadDescriptor::NameRegister()));
274 256
275 Label slow; 257 Label slow;
276 258
277 __ lw(dictionary, FieldMemOperand(LoadDescriptor::ReceiverRegister(), 259 __ lw(dictionary, FieldMemOperand(LoadDescriptor::ReceiverRegister(),
278 JSObject::kPropertiesOffset)); 260 JSObject::kPropertiesOffset));
279 GenerateDictionaryLoad(masm, &slow, dictionary, 261 GenerateDictionaryLoad(masm, &slow, dictionary,
(...skipping 679 matching lines...) Expand 10 before | Expand all | Expand 10 after
959 void StoreIC::GenerateMegamorphic(MacroAssembler* masm) { 941 void StoreIC::GenerateMegamorphic(MacroAssembler* masm) {
960 Register receiver = StoreDescriptor::ReceiverRegister(); 942 Register receiver = StoreDescriptor::ReceiverRegister();
961 Register name = StoreDescriptor::NameRegister(); 943 Register name = StoreDescriptor::NameRegister();
962 DCHECK(receiver.is(a1)); 944 DCHECK(receiver.is(a1));
963 DCHECK(name.is(a2)); 945 DCHECK(name.is(a2));
964 DCHECK(StoreDescriptor::ValueRegister().is(a0)); 946 DCHECK(StoreDescriptor::ValueRegister().is(a0));
965 947
966 // Get the receiver from the stack and probe the stub cache. 948 // Get the receiver from the stack and probe the stub cache.
967 Code::Flags flags = Code::RemoveTypeAndHolderFromFlags( 949 Code::Flags flags = Code::RemoveTypeAndHolderFromFlags(
968 Code::ComputeHandlerFlags(Code::STORE_IC)); 950 Code::ComputeHandlerFlags(Code::STORE_IC));
969 masm->isolate()->stub_cache()->GenerateProbe(masm, flags, receiver, name, a3, 951 masm->isolate()->stub_cache()->GenerateProbe(masm, flags, false, receiver,
970 t0, t1, t2); 952 name, a3, t0, t1, t2);
971 953
972 // Cache miss: Jump to runtime. 954 // Cache miss: Jump to runtime.
973 GenerateMiss(masm); 955 GenerateMiss(masm);
974 } 956 }
975 957
976 958
977 void StoreIC::GenerateMiss(MacroAssembler* masm) { 959 void StoreIC::GenerateMiss(MacroAssembler* masm) {
978 __ Push(StoreDescriptor::ReceiverRegister(), StoreDescriptor::NameRegister(), 960 __ Push(StoreDescriptor::ReceiverRegister(), StoreDescriptor::NameRegister(),
979 StoreDescriptor::ValueRegister()); 961 StoreDescriptor::ValueRegister());
980 // Perform tail call to the entry. 962 // Perform tail call to the entry.
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
1099 patcher.ChangeBranchCondition(ne); 1081 patcher.ChangeBranchCondition(ne);
1100 } else { 1082 } else {
1101 DCHECK(Assembler::IsBne(branch_instr)); 1083 DCHECK(Assembler::IsBne(branch_instr));
1102 patcher.ChangeBranchCondition(eq); 1084 patcher.ChangeBranchCondition(eq);
1103 } 1085 }
1104 } 1086 }
1105 } 1087 }
1106 } // namespace v8::internal 1088 } // namespace v8::internal
1107 1089
1108 #endif // V8_TARGET_ARCH_MIPS 1090 #endif // V8_TARGET_ARCH_MIPS
OLDNEW
« no previous file with comments | « no previous file | src/ic/mips/stub-cache-mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698