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

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: Final review feedback 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/arm/lithium-codegen-arm.h ('k') | src/ast.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 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 2815 matching lines...) Expand 10 before | Expand all | Expand 10 after
3068 3068
3069 __ str(value, target); 3069 __ str(value, target);
3070 if (instr->hydrogen()->NeedsWriteBarrier()) { 3070 if (instr->hydrogen()->NeedsWriteBarrier()) {
3071 HType type = instr->hydrogen()->value()->type(); 3071 HType type = instr->hydrogen()->value()->type();
3072 SmiCheck check_needed = 3072 SmiCheck check_needed =
3073 type.IsHeapObject() ? OMIT_SMI_CHECK : INLINE_SMI_CHECK; 3073 type.IsHeapObject() ? OMIT_SMI_CHECK : INLINE_SMI_CHECK;
3074 __ RecordWriteContextSlot(context, 3074 __ RecordWriteContextSlot(context,
3075 target.offset(), 3075 target.offset(),
3076 value, 3076 value,
3077 scratch, 3077 scratch,
3078 kLRHasBeenSaved, 3078 GetLinkRegisterState(),
3079 kSaveFPRegs, 3079 kSaveFPRegs,
3080 EMIT_REMEMBERED_SET, 3080 EMIT_REMEMBERED_SET,
3081 check_needed); 3081 check_needed);
3082 } 3082 }
3083 3083
3084 __ bind(&skip_assignment); 3084 __ bind(&skip_assignment);
3085 } 3085 }
3086 3086
3087 3087
3088 void LCodeGen::DoLoadNamedField(LLoadNamedField* instr) { 3088 void LCodeGen::DoLoadNamedField(LLoadNamedField* instr) {
(...skipping 1271 matching lines...) Expand 10 before | Expand all | Expand 10 after
4360 if (!instr->transition().is_null()) { 4360 if (!instr->transition().is_null()) {
4361 __ mov(scratch, Operand(instr->transition())); 4361 __ mov(scratch, Operand(instr->transition()));
4362 __ str(scratch, FieldMemOperand(object, HeapObject::kMapOffset)); 4362 __ str(scratch, FieldMemOperand(object, HeapObject::kMapOffset));
4363 if (instr->hydrogen()->NeedsWriteBarrierForMap()) { 4363 if (instr->hydrogen()->NeedsWriteBarrierForMap()) {
4364 Register temp = ToRegister(instr->temp()); 4364 Register temp = ToRegister(instr->temp());
4365 // Update the write barrier for the map field. 4365 // Update the write barrier for the map field.
4366 __ RecordWriteField(object, 4366 __ RecordWriteField(object,
4367 HeapObject::kMapOffset, 4367 HeapObject::kMapOffset,
4368 scratch, 4368 scratch,
4369 temp, 4369 temp,
4370 kLRHasBeenSaved, 4370 GetLinkRegisterState(),
4371 kSaveFPRegs, 4371 kSaveFPRegs,
4372 OMIT_REMEMBERED_SET, 4372 OMIT_REMEMBERED_SET,
4373 OMIT_SMI_CHECK); 4373 OMIT_SMI_CHECK);
4374 } 4374 }
4375 } 4375 }
4376 4376
4377 // Do the store. 4377 // Do the store.
4378 HType type = instr->hydrogen()->value()->type(); 4378 HType type = instr->hydrogen()->value()->type();
4379 SmiCheck check_needed = 4379 SmiCheck check_needed =
4380 type.IsHeapObject() ? OMIT_SMI_CHECK : INLINE_SMI_CHECK; 4380 type.IsHeapObject() ? OMIT_SMI_CHECK : INLINE_SMI_CHECK;
4381 if (instr->is_in_object()) { 4381 if (instr->is_in_object()) {
4382 __ str(value, FieldMemOperand(object, offset)); 4382 __ str(value, FieldMemOperand(object, offset));
4383 if (instr->hydrogen()->NeedsWriteBarrier()) { 4383 if (instr->hydrogen()->NeedsWriteBarrier()) {
4384 // Update the write barrier for the object for in-object properties. 4384 // Update the write barrier for the object for in-object properties.
4385 __ RecordWriteField(object, 4385 __ RecordWriteField(object,
4386 offset, 4386 offset,
4387 value, 4387 value,
4388 scratch, 4388 scratch,
4389 kLRHasBeenSaved, 4389 GetLinkRegisterState(),
4390 kSaveFPRegs, 4390 kSaveFPRegs,
4391 EMIT_REMEMBERED_SET, 4391 EMIT_REMEMBERED_SET,
4392 check_needed); 4392 check_needed);
4393 } 4393 }
4394 } else { 4394 } else {
4395 __ ldr(scratch, FieldMemOperand(object, JSObject::kPropertiesOffset)); 4395 __ ldr(scratch, FieldMemOperand(object, JSObject::kPropertiesOffset));
4396 __ str(value, FieldMemOperand(scratch, offset)); 4396 __ str(value, FieldMemOperand(scratch, offset));
4397 if (instr->hydrogen()->NeedsWriteBarrier()) { 4397 if (instr->hydrogen()->NeedsWriteBarrier()) {
4398 // Update the write barrier for the properties array. 4398 // Update the write barrier for the properties array.
4399 // object is used as a scratch register. 4399 // object is used as a scratch register.
4400 __ RecordWriteField(scratch, 4400 __ RecordWriteField(scratch,
4401 offset, 4401 offset,
4402 value, 4402 value,
4403 object, 4403 object,
4404 kLRHasBeenSaved, 4404 GetLinkRegisterState(),
4405 kSaveFPRegs, 4405 kSaveFPRegs,
4406 EMIT_REMEMBERED_SET, 4406 EMIT_REMEMBERED_SET,
4407 check_needed); 4407 check_needed);
4408 } 4408 }
4409 } 4409 }
4410 } 4410 }
4411 4411
4412 4412
4413 void LCodeGen::DoStoreNamedGeneric(LStoreNamedGeneric* instr) { 4413 void LCodeGen::DoStoreNamedGeneric(LStoreNamedGeneric* instr) {
4414 ASSERT(ToRegister(instr->object()).is(r1)); 4414 ASSERT(ToRegister(instr->object()).is(r1));
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after
4595 4595
4596 if (instr->hydrogen()->NeedsWriteBarrier()) { 4596 if (instr->hydrogen()->NeedsWriteBarrier()) {
4597 HType type = instr->hydrogen()->value()->type(); 4597 HType type = instr->hydrogen()->value()->type();
4598 SmiCheck check_needed = 4598 SmiCheck check_needed =
4599 type.IsHeapObject() ? OMIT_SMI_CHECK : INLINE_SMI_CHECK; 4599 type.IsHeapObject() ? OMIT_SMI_CHECK : INLINE_SMI_CHECK;
4600 // Compute address of modified element and store it into key register. 4600 // Compute address of modified element and store it into key register.
4601 __ add(key, store_base, Operand(offset - kHeapObjectTag)); 4601 __ add(key, store_base, Operand(offset - kHeapObjectTag));
4602 __ RecordWrite(elements, 4602 __ RecordWrite(elements,
4603 key, 4603 key,
4604 value, 4604 value,
4605 kLRHasBeenSaved, 4605 GetLinkRegisterState(),
4606 kSaveFPRegs, 4606 kSaveFPRegs,
4607 EMIT_REMEMBERED_SET, 4607 EMIT_REMEMBERED_SET,
4608 check_needed); 4608 check_needed);
4609 } 4609 }
4610 } 4610 }
4611 4611
4612 4612
4613 void LCodeGen::DoStoreKeyed(LStoreKeyed* instr) { 4613 void LCodeGen::DoStoreKeyed(LStoreKeyed* instr) {
4614 // By cases: external, fast double 4614 // By cases: external, fast double
4615 if (instr->is_external()) { 4615 if (instr->is_external()) {
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
4647 __ ldr(scratch, FieldMemOperand(object_reg, HeapObject::kMapOffset)); 4647 __ ldr(scratch, FieldMemOperand(object_reg, HeapObject::kMapOffset));
4648 __ cmp(scratch, Operand(from_map)); 4648 __ cmp(scratch, Operand(from_map));
4649 __ b(ne, &not_applicable); 4649 __ b(ne, &not_applicable);
4650 4650
4651 if (IsSimpleMapChangeTransition(from_kind, to_kind)) { 4651 if (IsSimpleMapChangeTransition(from_kind, to_kind)) {
4652 Register new_map_reg = ToRegister(instr->new_map_temp()); 4652 Register new_map_reg = ToRegister(instr->new_map_temp());
4653 __ mov(new_map_reg, Operand(to_map)); 4653 __ mov(new_map_reg, Operand(to_map));
4654 __ str(new_map_reg, FieldMemOperand(object_reg, HeapObject::kMapOffset)); 4654 __ str(new_map_reg, FieldMemOperand(object_reg, HeapObject::kMapOffset));
4655 // Write barrier. 4655 // Write barrier.
4656 __ RecordWriteField(object_reg, HeapObject::kMapOffset, new_map_reg, 4656 __ RecordWriteField(object_reg, HeapObject::kMapOffset, new_map_reg,
4657 scratch, kLRHasBeenSaved, kDontSaveFPRegs); 4657 scratch, GetLinkRegisterState(), kDontSaveFPRegs);
4658 } else if (FLAG_compiled_transitions) { 4658 } else if (FLAG_compiled_transitions) {
4659 PushSafepointRegistersScope scope(this, Safepoint::kWithRegisters); 4659 PushSafepointRegistersScope scope(this, Safepoint::kWithRegisters);
4660 __ Move(r0, object_reg); 4660 __ Move(r0, object_reg);
4661 __ Move(r1, to_map); 4661 __ Move(r1, to_map);
4662 TransitionElementsKindStub stub(from_kind, to_kind); 4662 TransitionElementsKindStub stub(from_kind, to_kind);
4663 __ CallStub(&stub); 4663 __ CallStub(&stub);
4664 RecordSafepointWithRegisters( 4664 RecordSafepointWithRegisters(
4665 instr->pointer_map(), 0, Safepoint::kNoLazyDeopt); 4665 instr->pointer_map(), 0, Safepoint::kNoLazyDeopt);
4666 } else if (IsFastSmiElementsKind(from_kind) && 4666 } else if (IsFastSmiElementsKind(from_kind) &&
4667 IsFastDoubleElementsKind(to_kind)) { 4667 IsFastDoubleElementsKind(to_kind)) {
(...skipping 1725 matching lines...) Expand 10 before | Expand all | Expand 10 after
6393 __ sub(scratch, result, Operand(index, LSL, kPointerSizeLog2 - kSmiTagSize)); 6393 __ sub(scratch, result, Operand(index, LSL, kPointerSizeLog2 - kSmiTagSize));
6394 __ ldr(result, FieldMemOperand(scratch, 6394 __ ldr(result, FieldMemOperand(scratch,
6395 FixedArray::kHeaderSize - kPointerSize)); 6395 FixedArray::kHeaderSize - kPointerSize));
6396 __ bind(&done); 6396 __ bind(&done);
6397 } 6397 }
6398 6398
6399 6399
6400 #undef __ 6400 #undef __
6401 6401
6402 } } // namespace v8::internal 6402 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/arm/lithium-codegen-arm.h ('k') | src/ast.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698