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

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

Issue 12221064: Implement many KeyedStoreStubs using Crankshaft (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Rebase 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
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 221 matching lines...) Expand 10 before | Expand all | Expand 10 after
232 if (var->IsContextSlot()) { 232 if (var->IsContextSlot()) {
233 int parameter_offset = StandardFrameConstants::kCallerSPOffset + 233 int parameter_offset = StandardFrameConstants::kCallerSPOffset +
234 (num_parameters - 1 - i) * kPointerSize; 234 (num_parameters - 1 - i) * kPointerSize;
235 // Load parameter from stack. 235 // Load parameter from stack.
236 __ ldr(r0, MemOperand(fp, parameter_offset)); 236 __ ldr(r0, MemOperand(fp, parameter_offset));
237 // Store it in the context. 237 // Store it in the context.
238 MemOperand target = ContextOperand(cp, var->index()); 238 MemOperand target = ContextOperand(cp, var->index());
239 __ str(r0, target); 239 __ str(r0, target);
240 // Update the write barrier. This clobbers r3 and r0. 240 // Update the write barrier. This clobbers r3 and r0.
241 __ RecordWriteContextSlot( 241 __ RecordWriteContextSlot(
242 cp, target.offset(), r0, r3, kLRHasBeenSaved, kSaveFPRegs); 242 cp, target.offset(), r0, r3, GetLinkRegisterState(), kSaveFPRegs);
243 } 243 }
244 } 244 }
245 Comment(";;; End allocate local context"); 245 Comment(";;; End allocate local context");
246 } 246 }
247 247
248 // Trace the call. 248 // Trace the call.
249 if (FLAG_trace && info()->IsOptimizing()) { 249 if (FLAG_trace && info()->IsOptimizing()) {
250 __ CallRuntime(Runtime::kTraceEnter, 0); 250 __ CallRuntime(Runtime::kTraceEnter, 0);
251 } 251 }
252 return !is_aborted(); 252 return !is_aborted();
(...skipping 2806 matching lines...) Expand 10 before | Expand all | Expand 10 after
3059 3059
3060 __ str(value, target); 3060 __ str(value, target);
3061 if (instr->hydrogen()->NeedsWriteBarrier()) { 3061 if (instr->hydrogen()->NeedsWriteBarrier()) {
3062 HType type = instr->hydrogen()->value()->type(); 3062 HType type = instr->hydrogen()->value()->type();
3063 SmiCheck check_needed = 3063 SmiCheck check_needed =
3064 type.IsHeapObject() ? OMIT_SMI_CHECK : INLINE_SMI_CHECK; 3064 type.IsHeapObject() ? OMIT_SMI_CHECK : INLINE_SMI_CHECK;
3065 __ RecordWriteContextSlot(context, 3065 __ RecordWriteContextSlot(context,
3066 target.offset(), 3066 target.offset(),
3067 value, 3067 value,
3068 scratch, 3068 scratch,
3069 kLRHasBeenSaved, 3069 GetLinkRegisterState(),
3070 kSaveFPRegs, 3070 kSaveFPRegs,
3071 EMIT_REMEMBERED_SET, 3071 EMIT_REMEMBERED_SET,
3072 check_needed); 3072 check_needed);
3073 } 3073 }
3074 3074
3075 __ bind(&skip_assignment); 3075 __ bind(&skip_assignment);
3076 } 3076 }
3077 3077
3078 3078
3079 void LCodeGen::DoLoadNamedField(LLoadNamedField* instr) { 3079 void LCodeGen::DoLoadNamedField(LLoadNamedField* instr) {
(...skipping 1264 matching lines...) Expand 10 before | Expand all | Expand 10 after
4344 if (!instr->transition().is_null()) { 4344 if (!instr->transition().is_null()) {
4345 __ mov(scratch, Operand(instr->transition())); 4345 __ mov(scratch, Operand(instr->transition()));
4346 __ str(scratch, FieldMemOperand(object, HeapObject::kMapOffset)); 4346 __ str(scratch, FieldMemOperand(object, HeapObject::kMapOffset));
4347 if (instr->hydrogen()->NeedsWriteBarrierForMap()) { 4347 if (instr->hydrogen()->NeedsWriteBarrierForMap()) {
4348 Register temp = ToRegister(instr->temp()); 4348 Register temp = ToRegister(instr->temp());
4349 // Update the write barrier for the map field. 4349 // Update the write barrier for the map field.
4350 __ RecordWriteField(object, 4350 __ RecordWriteField(object,
4351 HeapObject::kMapOffset, 4351 HeapObject::kMapOffset,
4352 scratch, 4352 scratch,
4353 temp, 4353 temp,
4354 kLRHasBeenSaved, 4354 GetLinkRegisterState(),
4355 kSaveFPRegs, 4355 kSaveFPRegs,
4356 OMIT_REMEMBERED_SET, 4356 OMIT_REMEMBERED_SET,
4357 OMIT_SMI_CHECK); 4357 OMIT_SMI_CHECK);
4358 } 4358 }
4359 } 4359 }
4360 4360
4361 // Do the store. 4361 // Do the store.
4362 HType type = instr->hydrogen()->value()->type(); 4362 HType type = instr->hydrogen()->value()->type();
4363 SmiCheck check_needed = 4363 SmiCheck check_needed =
4364 type.IsHeapObject() ? OMIT_SMI_CHECK : INLINE_SMI_CHECK; 4364 type.IsHeapObject() ? OMIT_SMI_CHECK : INLINE_SMI_CHECK;
4365 if (instr->is_in_object()) { 4365 if (instr->is_in_object()) {
4366 __ str(value, FieldMemOperand(object, offset)); 4366 __ str(value, FieldMemOperand(object, offset));
4367 if (instr->hydrogen()->NeedsWriteBarrier()) { 4367 if (instr->hydrogen()->NeedsWriteBarrier()) {
4368 // Update the write barrier for the object for in-object properties. 4368 // Update the write barrier for the object for in-object properties.
4369 __ RecordWriteField(object, 4369 __ RecordWriteField(object,
4370 offset, 4370 offset,
4371 value, 4371 value,
4372 scratch, 4372 scratch,
4373 kLRHasBeenSaved, 4373 GetLinkRegisterState(),
4374 kSaveFPRegs, 4374 kSaveFPRegs,
4375 EMIT_REMEMBERED_SET, 4375 EMIT_REMEMBERED_SET,
4376 check_needed); 4376 check_needed);
4377 } 4377 }
4378 } else { 4378 } else {
4379 __ ldr(scratch, FieldMemOperand(object, JSObject::kPropertiesOffset)); 4379 __ ldr(scratch, FieldMemOperand(object, JSObject::kPropertiesOffset));
4380 __ str(value, FieldMemOperand(scratch, offset)); 4380 __ str(value, FieldMemOperand(scratch, offset));
4381 if (instr->hydrogen()->NeedsWriteBarrier()) { 4381 if (instr->hydrogen()->NeedsWriteBarrier()) {
4382 // Update the write barrier for the properties array. 4382 // Update the write barrier for the properties array.
4383 // object is used as a scratch register. 4383 // object is used as a scratch register.
4384 __ RecordWriteField(scratch, 4384 __ RecordWriteField(scratch,
4385 offset, 4385 offset,
4386 value, 4386 value,
4387 object, 4387 object,
4388 kLRHasBeenSaved, 4388 GetLinkRegisterState(),
4389 kSaveFPRegs, 4389 kSaveFPRegs,
4390 EMIT_REMEMBERED_SET, 4390 EMIT_REMEMBERED_SET,
4391 check_needed); 4391 check_needed);
4392 } 4392 }
4393 } 4393 }
4394 } 4394 }
4395 4395
4396 4396
4397 void LCodeGen::DoStoreNamedGeneric(LStoreNamedGeneric* instr) { 4397 void LCodeGen::DoStoreNamedGeneric(LStoreNamedGeneric* instr) {
4398 ASSERT(ToRegister(instr->object()).is(r1)); 4398 ASSERT(ToRegister(instr->object()).is(r1));
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after
4579 4579
4580 if (instr->hydrogen()->NeedsWriteBarrier()) { 4580 if (instr->hydrogen()->NeedsWriteBarrier()) {
4581 HType type = instr->hydrogen()->value()->type(); 4581 HType type = instr->hydrogen()->value()->type();
4582 SmiCheck check_needed = 4582 SmiCheck check_needed =
4583 type.IsHeapObject() ? OMIT_SMI_CHECK : INLINE_SMI_CHECK; 4583 type.IsHeapObject() ? OMIT_SMI_CHECK : INLINE_SMI_CHECK;
4584 // Compute address of modified element and store it into key register. 4584 // Compute address of modified element and store it into key register.
4585 __ add(key, store_base, Operand(offset - kHeapObjectTag)); 4585 __ add(key, store_base, Operand(offset - kHeapObjectTag));
4586 __ RecordWrite(elements, 4586 __ RecordWrite(elements,
4587 key, 4587 key,
4588 value, 4588 value,
4589 kLRHasBeenSaved, 4589 GetLinkRegisterState(),
4590 kSaveFPRegs, 4590 kSaveFPRegs,
4591 EMIT_REMEMBERED_SET, 4591 EMIT_REMEMBERED_SET,
4592 check_needed); 4592 check_needed);
4593 } 4593 }
4594 } 4594 }
4595 4595
4596 4596
4597 void LCodeGen::DoStoreKeyed(LStoreKeyed* instr) { 4597 void LCodeGen::DoStoreKeyed(LStoreKeyed* instr) {
4598 // By cases: external, fast double 4598 // By cases: external, fast double
4599 if (instr->is_external()) { 4599 if (instr->is_external()) {
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
4631 __ ldr(scratch, FieldMemOperand(object_reg, HeapObject::kMapOffset)); 4631 __ ldr(scratch, FieldMemOperand(object_reg, HeapObject::kMapOffset));
4632 __ cmp(scratch, Operand(from_map)); 4632 __ cmp(scratch, Operand(from_map));
4633 __ b(ne, &not_applicable); 4633 __ b(ne, &not_applicable);
4634 4634
4635 if (IsSimpleMapChangeTransition(from_kind, to_kind)) { 4635 if (IsSimpleMapChangeTransition(from_kind, to_kind)) {
4636 Register new_map_reg = ToRegister(instr->new_map_temp()); 4636 Register new_map_reg = ToRegister(instr->new_map_temp());
4637 __ mov(new_map_reg, Operand(to_map)); 4637 __ mov(new_map_reg, Operand(to_map));
4638 __ str(new_map_reg, FieldMemOperand(object_reg, HeapObject::kMapOffset)); 4638 __ str(new_map_reg, FieldMemOperand(object_reg, HeapObject::kMapOffset));
4639 // Write barrier. 4639 // Write barrier.
4640 __ RecordWriteField(object_reg, HeapObject::kMapOffset, new_map_reg, 4640 __ RecordWriteField(object_reg, HeapObject::kMapOffset, new_map_reg,
4641 scratch, kLRHasBeenSaved, kDontSaveFPRegs); 4641 scratch, GetLinkRegisterState(), kDontSaveFPRegs);
4642 } else if (FLAG_compiled_transitions) { 4642 } else if (FLAG_compiled_transitions) {
4643 PushSafepointRegistersScope scope(this, Safepoint::kWithRegisters); 4643 PushSafepointRegistersScope scope(this, Safepoint::kWithRegisters);
4644 __ Move(r0, object_reg); 4644 __ Move(r0, object_reg);
4645 __ Move(r1, to_map); 4645 __ Move(r1, to_map);
4646 TransitionElementsKindStub stub(from_kind, to_kind); 4646 TransitionElementsKindStub stub(from_kind, to_kind);
4647 __ CallStub(&stub); 4647 __ CallStub(&stub);
4648 RecordSafepointWithRegisters( 4648 RecordSafepointWithRegisters(
4649 instr->pointer_map(), 0, Safepoint::kNoLazyDeopt); 4649 instr->pointer_map(), 0, Safepoint::kNoLazyDeopt);
4650 } else if (IsFastSmiElementsKind(from_kind) && 4650 } else if (IsFastSmiElementsKind(from_kind) &&
4651 IsFastDoubleElementsKind(to_kind)) { 4651 IsFastDoubleElementsKind(to_kind)) {
(...skipping 1739 matching lines...) Expand 10 before | Expand all | Expand 10 after
6391 __ sub(scratch, result, Operand(index, LSL, kPointerSizeLog2 - kSmiTagSize)); 6391 __ sub(scratch, result, Operand(index, LSL, kPointerSizeLog2 - kSmiTagSize));
6392 __ ldr(result, FieldMemOperand(scratch, 6392 __ ldr(result, FieldMemOperand(scratch,
6393 FixedArray::kHeaderSize - kPointerSize)); 6393 FixedArray::kHeaderSize - kPointerSize));
6394 __ bind(&done); 6394 __ bind(&done);
6395 } 6395 }
6396 6396
6397 6397
6398 #undef __ 6398 #undef __
6399 6399
6400 } } // namespace v8::internal 6400 } } // namespace v8::internal
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698