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

Side by Side Diff: src/arm/code-stubs-arm.cc

Issue 1314503003: VectorICs: Cleanup, remove unnecessary arguments from HandleArrayCases() (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 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
« no previous file with comments | « no previous file | src/arm64/code-stubs-arm64.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 #if V8_TARGET_ARCH_ARM 5 #if V8_TARGET_ARCH_ARM
6 6
7 #include "src/base/bits.h" 7 #include "src/base/bits.h"
8 #include "src/bootstrapper.h" 8 #include "src/bootstrapper.h"
9 #include "src/code-stubs.h" 9 #include "src/code-stubs.h"
10 #include "src/codegen.h" 10 #include "src/codegen.h"
(...skipping 4323 matching lines...) Expand 10 before | Expand all | Expand 10 after
4334 4334
4335 4335
4336 void LoadICStub::Generate(MacroAssembler* masm) { GenerateImpl(masm, false); } 4336 void LoadICStub::Generate(MacroAssembler* masm) { GenerateImpl(masm, false); }
4337 4337
4338 4338
4339 void LoadICStub::GenerateForTrampoline(MacroAssembler* masm) { 4339 void LoadICStub::GenerateForTrampoline(MacroAssembler* masm) {
4340 GenerateImpl(masm, true); 4340 GenerateImpl(masm, true);
4341 } 4341 }
4342 4342
4343 4343
4344 static void HandleArrayCases(MacroAssembler* masm, Register receiver, 4344 static void HandleArrayCases(MacroAssembler* masm, Register feedback,
4345 Register key, Register vector, Register slot, 4345 Register receiver_map, Register scratch1,
4346 Register feedback, Register receiver_map, 4346 Register scratch2, bool is_polymorphic,
4347 Register scratch1, Register scratch2, 4347 Label* miss) {
4348 bool is_polymorphic, Label* miss) {
4349 // feedback initially contains the feedback array 4348 // feedback initially contains the feedback array
4350 Label next_loop, prepare_next; 4349 Label next_loop, prepare_next;
4351 Label start_polymorphic; 4350 Label start_polymorphic;
4352 4351
4353 Register cached_map = scratch1; 4352 Register cached_map = scratch1;
4354 4353
4355 __ ldr(cached_map, 4354 __ ldr(cached_map,
4356 FieldMemOperand(feedback, FixedArray::OffsetOfElementAt(0))); 4355 FieldMemOperand(feedback, FixedArray::OffsetOfElementAt(0)));
4357 __ ldr(cached_map, FieldMemOperand(cached_map, WeakCell::kValueOffset)); 4356 __ ldr(cached_map, FieldMemOperand(cached_map, WeakCell::kValueOffset));
4358 __ cmp(receiver_map, cached_map); 4357 __ cmp(receiver_map, cached_map);
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
4448 Label try_array, load_smi_map, compare_map; 4447 Label try_array, load_smi_map, compare_map;
4449 Label not_array, miss; 4448 Label not_array, miss;
4450 HandleMonomorphicCase(masm, receiver, receiver_map, feedback, vector, slot, 4449 HandleMonomorphicCase(masm, receiver, receiver_map, feedback, vector, slot,
4451 scratch1, &compare_map, &load_smi_map, &try_array); 4450 scratch1, &compare_map, &load_smi_map, &try_array);
4452 4451
4453 // Is it a fixed array? 4452 // Is it a fixed array?
4454 __ bind(&try_array); 4453 __ bind(&try_array);
4455 __ ldr(scratch1, FieldMemOperand(feedback, HeapObject::kMapOffset)); 4454 __ ldr(scratch1, FieldMemOperand(feedback, HeapObject::kMapOffset));
4456 __ CompareRoot(scratch1, Heap::kFixedArrayMapRootIndex); 4455 __ CompareRoot(scratch1, Heap::kFixedArrayMapRootIndex);
4457 __ b(ne, &not_array); 4456 __ b(ne, &not_array);
4458 HandleArrayCases(masm, receiver, name, vector, slot, feedback, receiver_map, 4457 HandleArrayCases(masm, feedback, receiver_map, scratch1, r9, true, &miss);
4459 scratch1, r9, true, &miss);
4460 4458
4461 __ bind(&not_array); 4459 __ bind(&not_array);
4462 __ CompareRoot(feedback, Heap::kmegamorphic_symbolRootIndex); 4460 __ CompareRoot(feedback, Heap::kmegamorphic_symbolRootIndex);
4463 __ b(ne, &miss); 4461 __ b(ne, &miss);
4464 Code::Flags code_flags = Code::RemoveTypeAndHolderFromFlags( 4462 Code::Flags code_flags = Code::RemoveTypeAndHolderFromFlags(
4465 Code::ComputeHandlerFlags(Code::LOAD_IC)); 4463 Code::ComputeHandlerFlags(Code::LOAD_IC));
4466 masm->isolate()->stub_cache()->GenerateProbe(masm, Code::LOAD_IC, code_flags, 4464 masm->isolate()->stub_cache()->GenerateProbe(masm, Code::LOAD_IC, code_flags,
4467 receiver, name, feedback, 4465 receiver, name, feedback,
4468 receiver_map, scratch1, r9); 4466 receiver_map, scratch1, r9);
4469 4467
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
4509 4507
4510 __ bind(&try_array); 4508 __ bind(&try_array);
4511 // Is it a fixed array? 4509 // Is it a fixed array?
4512 __ ldr(scratch1, FieldMemOperand(feedback, HeapObject::kMapOffset)); 4510 __ ldr(scratch1, FieldMemOperand(feedback, HeapObject::kMapOffset));
4513 __ CompareRoot(scratch1, Heap::kFixedArrayMapRootIndex); 4511 __ CompareRoot(scratch1, Heap::kFixedArrayMapRootIndex);
4514 __ b(ne, &not_array); 4512 __ b(ne, &not_array);
4515 4513
4516 // We have a polymorphic element handler. 4514 // We have a polymorphic element handler.
4517 Label polymorphic, try_poly_name; 4515 Label polymorphic, try_poly_name;
4518 __ bind(&polymorphic); 4516 __ bind(&polymorphic);
4519 HandleArrayCases(masm, receiver, key, vector, slot, feedback, receiver_map, 4517 HandleArrayCases(masm, feedback, receiver_map, scratch1, r9, true, &miss);
4520 scratch1, r9, true, &miss);
4521 4518
4522 __ bind(&not_array); 4519 __ bind(&not_array);
4523 // Is it generic? 4520 // Is it generic?
4524 __ CompareRoot(feedback, Heap::kmegamorphic_symbolRootIndex); 4521 __ CompareRoot(feedback, Heap::kmegamorphic_symbolRootIndex);
4525 __ b(ne, &try_poly_name); 4522 __ b(ne, &try_poly_name);
4526 Handle<Code> megamorphic_stub = 4523 Handle<Code> megamorphic_stub =
4527 KeyedLoadIC::ChooseMegamorphicStub(masm->isolate(), GetExtraICState()); 4524 KeyedLoadIC::ChooseMegamorphicStub(masm->isolate(), GetExtraICState());
4528 __ Jump(megamorphic_stub, RelocInfo::CODE_TARGET); 4525 __ Jump(megamorphic_stub, RelocInfo::CODE_TARGET);
4529 4526
4530 __ bind(&try_poly_name); 4527 __ bind(&try_poly_name);
4531 // We might have a name in feedback, and a fixed array in the next slot. 4528 // We might have a name in feedback, and a fixed array in the next slot.
4532 __ cmp(key, feedback); 4529 __ cmp(key, feedback);
4533 __ b(ne, &miss); 4530 __ b(ne, &miss);
4534 // If the name comparison succeeded, we know we have a fixed array with 4531 // If the name comparison succeeded, we know we have a fixed array with
4535 // at least one map/handler pair. 4532 // at least one map/handler pair.
4536 __ add(feedback, vector, Operand::PointerOffsetFromSmiKey(slot)); 4533 __ add(feedback, vector, Operand::PointerOffsetFromSmiKey(slot));
4537 __ ldr(feedback, 4534 __ ldr(feedback,
4538 FieldMemOperand(feedback, FixedArray::kHeaderSize + kPointerSize)); 4535 FieldMemOperand(feedback, FixedArray::kHeaderSize + kPointerSize));
4539 HandleArrayCases(masm, receiver, key, vector, slot, feedback, receiver_map, 4536 HandleArrayCases(masm, feedback, receiver_map, scratch1, r9, false, &miss);
4540 scratch1, r9, false, &miss);
4541 4537
4542 __ bind(&miss); 4538 __ bind(&miss);
4543 KeyedLoadIC::GenerateMiss(masm); 4539 KeyedLoadIC::GenerateMiss(masm);
4544 4540
4545 __ bind(&load_smi_map); 4541 __ bind(&load_smi_map);
4546 __ LoadRoot(receiver_map, Heap::kHeapNumberMapRootIndex); 4542 __ LoadRoot(receiver_map, Heap::kHeapNumberMapRootIndex);
4547 __ jmp(&compare_map); 4543 __ jmp(&compare_map);
4548 } 4544 }
4549 4545
4550 4546
(...skipping 904 matching lines...) Expand 10 before | Expand all | Expand 10 after
5455 MemOperand(fp, 6 * kPointerSize), NULL); 5451 MemOperand(fp, 6 * kPointerSize), NULL);
5456 } 5452 }
5457 5453
5458 5454
5459 #undef __ 5455 #undef __
5460 5456
5461 } // namespace internal 5457 } // namespace internal
5462 } // namespace v8 5458 } // namespace v8
5463 5459
5464 #endif // V8_TARGET_ARCH_ARM 5460 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « no previous file | src/arm64/code-stubs-arm64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698