X87: Clean up code stubs and ensure distinct major keys.

port r23655.

original commit message:

  Clean up code stubs and ensure distinct major keys.

BUG=
R=weiliang.lin@intel.com

Review URL: https://codereview.chromium.org/543013002

Patch from Jing Bao <jing.bao@intel.com>.

git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@23712 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
This commit is contained in:
weiliang.lin@intel.com 2014-09-05 07:07:07 +00:00
parent 48c61115ec
commit 7cecf80c43
3 changed files with 12 additions and 58 deletions

View File

@ -15,52 +15,6 @@ namespace internal {
#define __ ACCESS_MASM(masm)
void ElementHandlerCompiler::GenerateLoadDictionaryElement(
MacroAssembler* masm) {
// ----------- S t a t e -------------
// -- ecx : key
// -- edx : receiver
// -- esp[0] : return address
// -----------------------------------
DCHECK(edx.is(LoadDescriptor::ReceiverRegister()));
DCHECK(ecx.is(LoadDescriptor::NameRegister()));
Label slow, miss;
// This stub is meant to be tail-jumped to, the receiver must already
// have been verified by the caller to not be a smi.
__ JumpIfNotSmi(ecx, &miss);
__ mov(ebx, ecx);
__ SmiUntag(ebx);
__ mov(eax, FieldOperand(edx, JSObject::kElementsOffset));
// Push receiver on the stack to free up a register for the dictionary
// probing.
__ push(edx);
__ LoadFromNumberDictionary(&slow, eax, ecx, ebx, edx, edi, eax);
// Pop receiver before returning.
__ pop(edx);
__ ret(0);
__ bind(&slow);
__ pop(edx);
// ----------- S t a t e -------------
// -- ecx : key
// -- edx : receiver
// -- esp[0] : return address
// -----------------------------------
TailCallBuiltin(masm, Builtins::kKeyedLoadIC_Slow);
__ bind(&miss);
// ----------- S t a t e -------------
// -- ecx : key
// -- edx : receiver
// -- esp[0] : return address
// -----------------------------------
TailCallBuiltin(masm, Builtins::kKeyedLoadIC_Miss);
}
void NamedLoadHandlerCompiler::GenerateLoadViaGetter(
MacroAssembler* masm, Handle<HeapType> type, Register receiver,
Handle<JSFunction> getter) {

View File

@ -1239,7 +1239,7 @@ static void BranchIfNotInternalizedString(MacroAssembler* masm,
}
void ICCompareStub::GenerateGeneric(MacroAssembler* masm) {
void CompareICStub::GenerateGeneric(MacroAssembler* masm) {
Label check_unequal_objects;
Condition cc = GetCondition();
@ -3050,7 +3050,7 @@ void BinaryOpICWithAllocationSiteStub::Generate(MacroAssembler* masm) {
}
void ICCompareStub::GenerateSmis(MacroAssembler* masm) {
void CompareICStub::GenerateSmis(MacroAssembler* masm) {
DCHECK(state() == CompareIC::SMI);
Label miss;
__ mov(ecx, edx);
@ -3076,7 +3076,7 @@ void ICCompareStub::GenerateSmis(MacroAssembler* masm) {
}
void ICCompareStub::GenerateNumbers(MacroAssembler* masm) {
void CompareICStub::GenerateNumbers(MacroAssembler* masm) {
DCHECK(state() == CompareIC::NUMBER);
Label generic_stub;
@ -3105,7 +3105,7 @@ void ICCompareStub::GenerateNumbers(MacroAssembler* masm) {
__ bind(&unordered);
__ bind(&generic_stub);
ICCompareStub stub(isolate(), op(), CompareIC::GENERIC, CompareIC::GENERIC,
CompareICStub stub(isolate(), op(), CompareIC::GENERIC, CompareIC::GENERIC,
CompareIC::GENERIC);
__ jmp(stub.GetCode(), RelocInfo::CODE_TARGET);
@ -3130,7 +3130,7 @@ void ICCompareStub::GenerateNumbers(MacroAssembler* masm) {
}
void ICCompareStub::GenerateInternalizedStrings(MacroAssembler* masm) {
void CompareICStub::GenerateInternalizedStrings(MacroAssembler* masm) {
DCHECK(state() == CompareIC::INTERNALIZED_STRING);
DCHECK(GetCondition() == equal);
@ -3175,7 +3175,7 @@ void ICCompareStub::GenerateInternalizedStrings(MacroAssembler* masm) {
}
void ICCompareStub::GenerateUniqueNames(MacroAssembler* masm) {
void CompareICStub::GenerateUniqueNames(MacroAssembler* masm) {
DCHECK(state() == CompareIC::UNIQUE_NAME);
DCHECK(GetCondition() == equal);
@ -3220,7 +3220,7 @@ void ICCompareStub::GenerateUniqueNames(MacroAssembler* masm) {
}
void ICCompareStub::GenerateStrings(MacroAssembler* masm) {
void CompareICStub::GenerateStrings(MacroAssembler* masm) {
DCHECK(state() == CompareIC::STRING);
Label miss;
@ -3309,7 +3309,7 @@ void ICCompareStub::GenerateStrings(MacroAssembler* masm) {
}
void ICCompareStub::GenerateObjects(MacroAssembler* masm) {
void CompareICStub::GenerateObjects(MacroAssembler* masm) {
DCHECK(state() == CompareIC::OBJECT);
Label miss;
__ mov(ecx, edx);
@ -3330,7 +3330,7 @@ void ICCompareStub::GenerateObjects(MacroAssembler* masm) {
}
void ICCompareStub::GenerateKnownObjects(MacroAssembler* masm) {
void CompareICStub::GenerateKnownObjects(MacroAssembler* masm) {
Label miss;
__ mov(ecx, edx);
__ and_(ecx, eax);
@ -3351,7 +3351,7 @@ void ICCompareStub::GenerateKnownObjects(MacroAssembler* masm) {
}
void ICCompareStub::GenerateMiss(MacroAssembler* masm) {
void CompareICStub::GenerateMiss(MacroAssembler* masm) {
{
// Call the runtime system in a fresh internal frame.
ExternalReference miss = ExternalReference(IC_Utility(IC::kCompareIC_Miss),

View File

@ -114,7 +114,7 @@ class NameDictionaryLookupStub: public PlatformCodeStub {
NameDictionary::kHeaderSize +
NameDictionary::kElementsStartIndex * kPointerSize;
Major MajorKey() const { return NameDictionaryLookup; }
virtual inline Major MajorKey() const FINAL OVERRIDE;
Register dictionary() const {
return Register::from_code(DictionaryBits::decode(minor_key_));
@ -338,7 +338,7 @@ class RecordWriteStub: public PlatformCodeStub {
kUpdateRememberedSetOnNoNeedToInformIncrementalMarker
};
Major MajorKey() const { return RecordWrite; }
virtual inline Major MajorKey() const FINAL OVERRIDE;
void Generate(MacroAssembler* masm);
void GenerateIncremental(MacroAssembler* masm, Mode mode);