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

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

Issue 8332003: Handlify CallStubCompiler::CompileCallField. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Rename some functions on ARM. Created 9 years, 1 month 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 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 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 6659 matching lines...) Expand 10 before | Expand all | Expand 10 after
6670 Label start; 6670 Label start;
6671 __ bind(&start); 6671 __ bind(&start);
6672 __ add(ip, pc, Operand(Assembler::kInstrSize)); 6672 __ add(ip, pc, Operand(Assembler::kInstrSize));
6673 __ str(ip, MemOperand(sp, 0)); 6673 __ str(ip, MemOperand(sp, 0));
6674 __ Jump(target); // Call the C++ function. 6674 __ Jump(target); // Call the C++ function.
6675 ASSERT_EQ(Assembler::kInstrSize + Assembler::kPcLoadDelta, 6675 ASSERT_EQ(Assembler::kInstrSize + Assembler::kPcLoadDelta,
6676 masm->SizeOfCodeGeneratedSince(&start)); 6676 masm->SizeOfCodeGeneratedSince(&start));
6677 } 6677 }
6678 6678
6679 6679
6680 MaybeObject* StringDictionaryLookupStub::GenerateNegativeLookup( 6680 void StringDictionaryLookupStub::GenerateNegativeLookup(MacroAssembler* masm,
Kevin Millikin (Chromium) 2011/10/24 15:55:12 Cannot be wrapped with retry after GC, because it
Vyacheslav Egorov (Chromium) 2011/10/24 16:18:31 You can use create stub in the beginning of the fu
6681 Label* miss,
6682 Label* done,
6683 Register receiver,
6684 Register properties,
6685 Handle<String> name,
6686 Register scratch0) {
6687 // If names of slots in range from 1 to kProbes - 1 for the hash value are
6688 // not equal to the name and kProbes-th slot is not used (its name is the
6689 // undefined value), it guarantees the hash table doesn't contain the
6690 // property. It's true even if some slots represent deleted properties
6691 // (their names are the null value).
6692 for (int i = 0; i < kInlinedProbes; i++) {
6693 // scratch0 points to properties hash.
6694 // Compute the masked index: (hash + i + i * i) & mask.
6695 Register index = scratch0;
6696 // Capacity is smi 2^n.
6697 __ ldr(index, FieldMemOperand(properties, kCapacityOffset));
6698 __ sub(index, index, Operand(1));
6699 __ and_(index, index, Operand(
6700 Smi::FromInt(name->Hash() + StringDictionary::GetProbeOffset(i))));
6701
6702 // Scale the index by multiplying by the entry size.
6703 ASSERT(StringDictionary::kEntrySize == 3);
6704 __ add(index, index, Operand(index, LSL, 1)); // index *= 3.
6705
6706 Register entity_name = scratch0;
6707 // Having undefined at this place means the name is not contained.
6708 ASSERT_EQ(kSmiTagSize, 1);
6709 Register tmp = properties;
6710 __ add(tmp, properties, Operand(index, LSL, 1));
6711 __ ldr(entity_name, FieldMemOperand(tmp, kElementsStartOffset));
6712
6713 ASSERT(!tmp.is(entity_name));
6714 __ LoadRoot(tmp, Heap::kUndefinedValueRootIndex);
6715 __ cmp(entity_name, tmp);
6716 __ b(eq, done);
6717
6718 if (i != kInlinedProbes - 1) {
6719 // Stop if found the property.
6720 __ cmp(entity_name, Operand(Handle<String>(name)));
6721 __ b(eq, miss);
6722
6723 // Check if the entry name is not a symbol.
6724 __ ldr(entity_name, FieldMemOperand(entity_name, HeapObject::kMapOffset));
6725 __ ldrb(entity_name,
6726 FieldMemOperand(entity_name, Map::kInstanceTypeOffset));
6727 __ tst(entity_name, Operand(kIsSymbolMask));
6728 __ b(eq, miss);
6729
6730 // Restore the properties.
6731 __ ldr(properties,
6732 FieldMemOperand(receiver, JSObject::kPropertiesOffset));
6733 }
6734 }
6735
6736 const int spill_mask =
6737 (lr.bit() | r6.bit() | r5.bit() | r4.bit() | r3.bit() |
6738 r2.bit() | r1.bit() | r0.bit());
6739
6740 __ stm(db_w, sp, spill_mask);
6741 __ ldr(r0, FieldMemOperand(receiver, JSObject::kPropertiesOffset));
6742 __ mov(r1, Operand(Handle<String>(name)));
6743 StringDictionaryLookupStub stub(NEGATIVE_LOOKUP);
6744 __ CallStub(&stub);
Kevin Millikin (Chromium) 2011/10/24 15:55:12 This is the only change from the original function
6745 __ tst(r0, Operand(r0));
6746 __ ldm(ia_w, sp, spill_mask);
6747
6748 __ b(eq, done);
6749 __ b(ne, miss);
6750 }
6751
6752
6753 // TODO(kmillikin): Eliminate this function when the stub cache is fully
6754 // handlified.
6755 MaybeObject* StringDictionaryLookupStub::TryGenerateNegativeLookup(
6681 MacroAssembler* masm, 6756 MacroAssembler* masm,
6682 Label* miss, 6757 Label* miss,
6683 Label* done, 6758 Label* done,
6684 Register receiver, 6759 Register receiver,
6685 Register properties, 6760 Register properties,
6686 String* name, 6761 String* name,
6687 Register scratch0) { 6762 Register scratch0) {
6688 // If names of slots in range from 1 to kProbes - 1 for the hash value are 6763 // If names of slots in range from 1 to kProbes - 1 for the hash value are
6689 // not equal to the name and kProbes-th slot is not used (its name is the 6764 // not equal to the name and kProbes-th slot is not used (its name is the
6690 // undefined value), it guarantees the hash table doesn't contain the 6765 // undefined value), it guarantees the hash table doesn't contain the
(...skipping 486 matching lines...) Expand 10 before | Expand all | Expand 10 after
7177 __ bind(&need_incremental); 7252 __ bind(&need_incremental);
7178 7253
7179 // Fall through when we need to inform the incremental marker. 7254 // Fall through when we need to inform the incremental marker.
7180 } 7255 }
7181 7256
7182 #undef __ 7257 #undef __
7183 7258
7184 } } // namespace v8::internal 7259 } } // namespace v8::internal
7185 7260
7186 #endif // V8_TARGET_ARCH_ARM 7261 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « src/arm/code-stubs-arm.h ('k') | src/arm/stub-cache-arm.cc » ('j') | src/arm/stub-cache-arm.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698