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

Side by Side Diff: src/mips/lithium-codegen-mips.cc

Issue 12702012: MIPS: Implement many KeyedStoreStubs using Crankshaft (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 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/mips/lithium-codegen-mips.h ('k') | no next file » | 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 219 matching lines...) Expand 10 before | Expand all | Expand 10 after
230 if (var->IsContextSlot()) { 230 if (var->IsContextSlot()) {
231 int parameter_offset = StandardFrameConstants::kCallerSPOffset + 231 int parameter_offset = StandardFrameConstants::kCallerSPOffset +
232 (num_parameters - 1 - i) * kPointerSize; 232 (num_parameters - 1 - i) * kPointerSize;
233 // Load parameter from stack. 233 // Load parameter from stack.
234 __ lw(a0, MemOperand(fp, parameter_offset)); 234 __ lw(a0, MemOperand(fp, parameter_offset));
235 // Store it in the context. 235 // Store it in the context.
236 MemOperand target = ContextOperand(cp, var->index()); 236 MemOperand target = ContextOperand(cp, var->index());
237 __ sw(a0, target); 237 __ sw(a0, target);
238 // Update the write barrier. This clobbers a3 and a0. 238 // Update the write barrier. This clobbers a3 and a0.
239 __ RecordWriteContextSlot( 239 __ RecordWriteContextSlot(
240 cp, target.offset(), a0, a3, kRAHasBeenSaved, kSaveFPRegs); 240 cp, target.offset(), a0, a3, GetRAState(), kSaveFPRegs);
241 } 241 }
242 } 242 }
243 Comment(";;; End allocate local context"); 243 Comment(";;; End allocate local context");
244 } 244 }
245 245
246 // Trace the call. 246 // Trace the call.
247 if (FLAG_trace && info()->IsOptimizing()) { 247 if (FLAG_trace && info()->IsOptimizing()) {
248 __ CallRuntime(Runtime::kTraceEnter, 0); 248 __ CallRuntime(Runtime::kTraceEnter, 0);
249 } 249 }
250 EnsureSpaceForLazyDeopt(); 250 EnsureSpaceForLazyDeopt();
(...skipping 2429 matching lines...) Expand 10 before | Expand all | Expand 10 after
2680 2680
2681 __ sw(value, target); 2681 __ sw(value, target);
2682 if (instr->hydrogen()->NeedsWriteBarrier()) { 2682 if (instr->hydrogen()->NeedsWriteBarrier()) {
2683 HType type = instr->hydrogen()->value()->type(); 2683 HType type = instr->hydrogen()->value()->type();
2684 SmiCheck check_needed = 2684 SmiCheck check_needed =
2685 type.IsHeapObject() ? OMIT_SMI_CHECK : INLINE_SMI_CHECK; 2685 type.IsHeapObject() ? OMIT_SMI_CHECK : INLINE_SMI_CHECK;
2686 __ RecordWriteContextSlot(context, 2686 __ RecordWriteContextSlot(context,
2687 target.offset(), 2687 target.offset(),
2688 value, 2688 value,
2689 scratch0(), 2689 scratch0(),
2690 kRAHasBeenSaved, 2690 GetRAState(),
2691 kSaveFPRegs, 2691 kSaveFPRegs,
2692 EMIT_REMEMBERED_SET, 2692 EMIT_REMEMBERED_SET,
2693 check_needed); 2693 check_needed);
2694 } 2694 }
2695 2695
2696 __ bind(&skip_assignment); 2696 __ bind(&skip_assignment);
2697 } 2697 }
2698 2698
2699 2699
2700 void LCodeGen::DoLoadNamedField(LLoadNamedField* instr) { 2700 void LCodeGen::DoLoadNamedField(LLoadNamedField* instr) {
(...skipping 1322 matching lines...) Expand 10 before | Expand all | Expand 10 after
4023 if (!instr->transition().is_null()) { 4023 if (!instr->transition().is_null()) {
4024 __ li(scratch, Operand(instr->transition())); 4024 __ li(scratch, Operand(instr->transition()));
4025 __ sw(scratch, FieldMemOperand(object, HeapObject::kMapOffset)); 4025 __ sw(scratch, FieldMemOperand(object, HeapObject::kMapOffset));
4026 if (instr->hydrogen()->NeedsWriteBarrierForMap()) { 4026 if (instr->hydrogen()->NeedsWriteBarrierForMap()) {
4027 Register temp = ToRegister(instr->temp()); 4027 Register temp = ToRegister(instr->temp());
4028 // Update the write barrier for the map field. 4028 // Update the write barrier for the map field.
4029 __ RecordWriteField(object, 4029 __ RecordWriteField(object,
4030 HeapObject::kMapOffset, 4030 HeapObject::kMapOffset,
4031 scratch, 4031 scratch,
4032 temp, 4032 temp,
4033 kRAHasBeenSaved, 4033 GetRAState(),
4034 kSaveFPRegs, 4034 kSaveFPRegs,
4035 OMIT_REMEMBERED_SET, 4035 OMIT_REMEMBERED_SET,
4036 OMIT_SMI_CHECK); 4036 OMIT_SMI_CHECK);
4037 } 4037 }
4038 } 4038 }
4039 4039
4040 // Do the store. 4040 // Do the store.
4041 HType type = instr->hydrogen()->value()->type(); 4041 HType type = instr->hydrogen()->value()->type();
4042 SmiCheck check_needed = 4042 SmiCheck check_needed =
4043 type.IsHeapObject() ? OMIT_SMI_CHECK : INLINE_SMI_CHECK; 4043 type.IsHeapObject() ? OMIT_SMI_CHECK : INLINE_SMI_CHECK;
4044 if (instr->is_in_object()) { 4044 if (instr->is_in_object()) {
4045 __ sw(value, FieldMemOperand(object, offset)); 4045 __ sw(value, FieldMemOperand(object, offset));
4046 if (instr->hydrogen()->NeedsWriteBarrier()) { 4046 if (instr->hydrogen()->NeedsWriteBarrier()) {
4047 // Update the write barrier for the object for in-object properties. 4047 // Update the write barrier for the object for in-object properties.
4048 __ RecordWriteField(object, 4048 __ RecordWriteField(object,
4049 offset, 4049 offset,
4050 value, 4050 value,
4051 scratch, 4051 scratch,
4052 kRAHasBeenSaved, 4052 GetRAState(),
4053 kSaveFPRegs, 4053 kSaveFPRegs,
4054 EMIT_REMEMBERED_SET, 4054 EMIT_REMEMBERED_SET,
4055 check_needed); 4055 check_needed);
4056 } 4056 }
4057 } else { 4057 } else {
4058 __ lw(scratch, FieldMemOperand(object, JSObject::kPropertiesOffset)); 4058 __ lw(scratch, FieldMemOperand(object, JSObject::kPropertiesOffset));
4059 __ sw(value, FieldMemOperand(scratch, offset)); 4059 __ sw(value, FieldMemOperand(scratch, offset));
4060 if (instr->hydrogen()->NeedsWriteBarrier()) { 4060 if (instr->hydrogen()->NeedsWriteBarrier()) {
4061 // Update the write barrier for the properties array. 4061 // Update the write barrier for the properties array.
4062 // object is used as a scratch register. 4062 // object is used as a scratch register.
4063 __ RecordWriteField(scratch, 4063 __ RecordWriteField(scratch,
4064 offset, 4064 offset,
4065 value, 4065 value,
4066 object, 4066 object,
4067 kRAHasBeenSaved, 4067 GetRAState(),
4068 kSaveFPRegs, 4068 kSaveFPRegs,
4069 EMIT_REMEMBERED_SET, 4069 EMIT_REMEMBERED_SET,
4070 check_needed); 4070 check_needed);
4071 } 4071 }
4072 } 4072 }
4073 } 4073 }
4074 4074
4075 4075
4076 void LCodeGen::DoStoreNamedGeneric(LStoreNamedGeneric* instr) { 4076 void LCodeGen::DoStoreNamedGeneric(LStoreNamedGeneric* instr) {
4077 ASSERT(ToRegister(instr->object()).is(a1)); 4077 ASSERT(ToRegister(instr->object()).is(a1));
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after
4268 4268
4269 if (instr->hydrogen()->NeedsWriteBarrier()) { 4269 if (instr->hydrogen()->NeedsWriteBarrier()) {
4270 HType type = instr->hydrogen()->value()->type(); 4270 HType type = instr->hydrogen()->value()->type();
4271 SmiCheck check_needed = 4271 SmiCheck check_needed =
4272 type.IsHeapObject() ? OMIT_SMI_CHECK : INLINE_SMI_CHECK; 4272 type.IsHeapObject() ? OMIT_SMI_CHECK : INLINE_SMI_CHECK;
4273 // Compute address of modified element and store it into key register. 4273 // Compute address of modified element and store it into key register.
4274 __ Addu(key, store_base, Operand(offset - kHeapObjectTag)); 4274 __ Addu(key, store_base, Operand(offset - kHeapObjectTag));
4275 __ RecordWrite(elements, 4275 __ RecordWrite(elements,
4276 key, 4276 key,
4277 value, 4277 value,
4278 kRAHasBeenSaved, 4278 GetRAState(),
4279 kSaveFPRegs, 4279 kSaveFPRegs,
4280 EMIT_REMEMBERED_SET, 4280 EMIT_REMEMBERED_SET,
4281 check_needed); 4281 check_needed);
4282 } 4282 }
4283 } 4283 }
4284 4284
4285 4285
4286 void LCodeGen::DoStoreKeyed(LStoreKeyed* instr) { 4286 void LCodeGen::DoStoreKeyed(LStoreKeyed* instr) {
4287 // By cases: external, fast double 4287 // By cases: external, fast double
4288 if (instr->is_external()) { 4288 if (instr->is_external()) {
(...skipping 30 matching lines...) Expand all
4319 Label not_applicable; 4319 Label not_applicable;
4320 __ lw(scratch, FieldMemOperand(object_reg, HeapObject::kMapOffset)); 4320 __ lw(scratch, FieldMemOperand(object_reg, HeapObject::kMapOffset));
4321 __ Branch(&not_applicable, ne, scratch, Operand(from_map)); 4321 __ Branch(&not_applicable, ne, scratch, Operand(from_map));
4322 4322
4323 if (IsSimpleMapChangeTransition(from_kind, to_kind)) { 4323 if (IsSimpleMapChangeTransition(from_kind, to_kind)) {
4324 Register new_map_reg = ToRegister(instr->new_map_temp()); 4324 Register new_map_reg = ToRegister(instr->new_map_temp());
4325 __ li(new_map_reg, Operand(to_map)); 4325 __ li(new_map_reg, Operand(to_map));
4326 __ sw(new_map_reg, FieldMemOperand(object_reg, HeapObject::kMapOffset)); 4326 __ sw(new_map_reg, FieldMemOperand(object_reg, HeapObject::kMapOffset));
4327 // Write barrier. 4327 // Write barrier.
4328 __ RecordWriteField(object_reg, HeapObject::kMapOffset, new_map_reg, 4328 __ RecordWriteField(object_reg, HeapObject::kMapOffset, new_map_reg,
4329 scratch, kRAHasBeenSaved, kDontSaveFPRegs); 4329 scratch, GetRAState(), kDontSaveFPRegs);
4330 } else if (FLAG_compiled_transitions) { 4330 } else if (FLAG_compiled_transitions) {
4331 PushSafepointRegistersScope scope(this, Safepoint::kWithRegisters); 4331 PushSafepointRegistersScope scope(this, Safepoint::kWithRegisters);
4332 __ mov(a0, object_reg); 4332 __ mov(a0, object_reg);
4333 __ li(a1, Operand(to_map)); 4333 __ li(a1, Operand(to_map));
4334 TransitionElementsKindStub stub(from_kind, to_kind); 4334 TransitionElementsKindStub stub(from_kind, to_kind);
4335 __ CallStub(&stub); 4335 __ CallStub(&stub);
4336 RecordSafepointWithRegisters( 4336 RecordSafepointWithRegisters(
4337 instr->pointer_map(), 0, Safepoint::kNoLazyDeopt); 4337 instr->pointer_map(), 0, Safepoint::kNoLazyDeopt);
4338 } else if (IsFastSmiElementsKind(from_kind) && 4338 } else if (IsFastSmiElementsKind(from_kind) &&
4339 IsFastDoubleElementsKind(to_kind)) { 4339 IsFastDoubleElementsKind(to_kind)) {
(...skipping 1764 matching lines...) Expand 10 before | Expand all | Expand 10 after
6104 __ Subu(scratch, result, scratch); 6104 __ Subu(scratch, result, scratch);
6105 __ lw(result, FieldMemOperand(scratch, 6105 __ lw(result, FieldMemOperand(scratch,
6106 FixedArray::kHeaderSize - kPointerSize)); 6106 FixedArray::kHeaderSize - kPointerSize));
6107 __ bind(&done); 6107 __ bind(&done);
6108 } 6108 }
6109 6109
6110 6110
6111 #undef __ 6111 #undef __
6112 6112
6113 } } // namespace v8::internal 6113 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/mips/lithium-codegen-mips.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698