X87: Minor-key-ify four stubs.

port r23605.

orginal commit message:
  - Minor-key-ify four stubs.
  - ICCompareStub
  - BinaryOpICStub
  - CompareNilICStub - VectorLoadStub

BUG=
R=weiliang.lin@intel.com

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

Patch from Chunyang Dai <chunyang.dai@intel.com>.

git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@23628 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent a08867f2
...@@ -1247,8 +1247,8 @@ void ICCompareStub::GenerateGeneric(MacroAssembler* masm) { ...@@ -1247,8 +1247,8 @@ void ICCompareStub::GenerateGeneric(MacroAssembler* masm) {
Condition cc = GetCondition(); Condition cc = GetCondition();
Label miss; Label miss;
CheckInputType(masm, edx, left_, &miss); CheckInputType(masm, edx, left(), &miss);
CheckInputType(masm, eax, right_, &miss); CheckInputType(masm, eax, right(), &miss);
// Compare two smis. // Compare two smis.
Label non_smi, smi_done; Label non_smi, smi_done;
...@@ -3070,7 +3070,7 @@ void BinaryOpICWithAllocationSiteStub::Generate(MacroAssembler* masm) { ...@@ -3070,7 +3070,7 @@ void BinaryOpICWithAllocationSiteStub::Generate(MacroAssembler* masm) {
void ICCompareStub::GenerateSmis(MacroAssembler* masm) { void ICCompareStub::GenerateSmis(MacroAssembler* masm) {
DCHECK(state_ == CompareIC::SMI); DCHECK(state() == CompareIC::SMI);
Label miss; Label miss;
__ mov(ecx, edx); __ mov(ecx, edx);
__ or_(ecx, eax); __ or_(ecx, eax);
...@@ -3096,16 +3096,16 @@ void ICCompareStub::GenerateSmis(MacroAssembler* masm) { ...@@ -3096,16 +3096,16 @@ void ICCompareStub::GenerateSmis(MacroAssembler* masm) {
void ICCompareStub::GenerateNumbers(MacroAssembler* masm) { void ICCompareStub::GenerateNumbers(MacroAssembler* masm) {
DCHECK(state_ == CompareIC::NUMBER); DCHECK(state() == CompareIC::NUMBER);
Label generic_stub; Label generic_stub;
Label unordered, maybe_undefined1, maybe_undefined2; Label unordered, maybe_undefined1, maybe_undefined2;
Label miss; Label miss;
if (left_ == CompareIC::SMI) { if (left() == CompareIC::SMI) {
__ JumpIfNotSmi(edx, &miss); __ JumpIfNotSmi(edx, &miss);
} }
if (right_ == CompareIC::SMI) { if (right() == CompareIC::SMI) {
__ JumpIfNotSmi(eax, &miss); __ JumpIfNotSmi(eax, &miss);
} }
...@@ -3124,12 +3124,12 @@ void ICCompareStub::GenerateNumbers(MacroAssembler* masm) { ...@@ -3124,12 +3124,12 @@ void ICCompareStub::GenerateNumbers(MacroAssembler* masm) {
__ bind(&unordered); __ bind(&unordered);
__ bind(&generic_stub); __ bind(&generic_stub);
ICCompareStub stub(isolate(), op_, CompareIC::GENERIC, CompareIC::GENERIC, ICCompareStub stub(isolate(), op(), CompareIC::GENERIC, CompareIC::GENERIC,
CompareIC::GENERIC); CompareIC::GENERIC);
__ jmp(stub.GetCode(), RelocInfo::CODE_TARGET); __ jmp(stub.GetCode(), RelocInfo::CODE_TARGET);
__ bind(&maybe_undefined1); __ bind(&maybe_undefined1);
if (Token::IsOrderedRelationalCompareOp(op_)) { if (Token::IsOrderedRelationalCompareOp(op())) {
__ cmp(eax, Immediate(isolate()->factory()->undefined_value())); __ cmp(eax, Immediate(isolate()->factory()->undefined_value()));
__ j(not_equal, &miss); __ j(not_equal, &miss);
__ JumpIfSmi(edx, &unordered); __ JumpIfSmi(edx, &unordered);
...@@ -3139,7 +3139,7 @@ void ICCompareStub::GenerateNumbers(MacroAssembler* masm) { ...@@ -3139,7 +3139,7 @@ void ICCompareStub::GenerateNumbers(MacroAssembler* masm) {
} }
__ bind(&maybe_undefined2); __ bind(&maybe_undefined2);
if (Token::IsOrderedRelationalCompareOp(op_)) { if (Token::IsOrderedRelationalCompareOp(op())) {
__ cmp(edx, Immediate(isolate()->factory()->undefined_value())); __ cmp(edx, Immediate(isolate()->factory()->undefined_value()));
__ j(equal, &unordered); __ j(equal, &unordered);
} }
...@@ -3150,7 +3150,7 @@ void ICCompareStub::GenerateNumbers(MacroAssembler* masm) { ...@@ -3150,7 +3150,7 @@ void ICCompareStub::GenerateNumbers(MacroAssembler* masm) {
void ICCompareStub::GenerateInternalizedStrings(MacroAssembler* masm) { void ICCompareStub::GenerateInternalizedStrings(MacroAssembler* masm) {
DCHECK(state_ == CompareIC::INTERNALIZED_STRING); DCHECK(state() == CompareIC::INTERNALIZED_STRING);
DCHECK(GetCondition() == equal); DCHECK(GetCondition() == equal);
// Registers containing left and right operands respectively. // Registers containing left and right operands respectively.
...@@ -3195,7 +3195,7 @@ void ICCompareStub::GenerateInternalizedStrings(MacroAssembler* masm) { ...@@ -3195,7 +3195,7 @@ void ICCompareStub::GenerateInternalizedStrings(MacroAssembler* masm) {
void ICCompareStub::GenerateUniqueNames(MacroAssembler* masm) { void ICCompareStub::GenerateUniqueNames(MacroAssembler* masm) {
DCHECK(state_ == CompareIC::UNIQUE_NAME); DCHECK(state() == CompareIC::UNIQUE_NAME);
DCHECK(GetCondition() == equal); DCHECK(GetCondition() == equal);
// Registers containing left and right operands respectively. // Registers containing left and right operands respectively.
...@@ -3240,10 +3240,10 @@ void ICCompareStub::GenerateUniqueNames(MacroAssembler* masm) { ...@@ -3240,10 +3240,10 @@ void ICCompareStub::GenerateUniqueNames(MacroAssembler* masm) {
void ICCompareStub::GenerateStrings(MacroAssembler* masm) { void ICCompareStub::GenerateStrings(MacroAssembler* masm) {
DCHECK(state_ == CompareIC::STRING); DCHECK(state() == CompareIC::STRING);
Label miss; Label miss;
bool equality = Token::IsEqualityOp(op_); bool equality = Token::IsEqualityOp(op());
// Registers containing left and right operands respectively. // Registers containing left and right operands respectively.
Register left = edx; Register left = edx;
...@@ -3330,7 +3330,7 @@ void ICCompareStub::GenerateStrings(MacroAssembler* masm) { ...@@ -3330,7 +3330,7 @@ void ICCompareStub::GenerateStrings(MacroAssembler* masm) {
void ICCompareStub::GenerateObjects(MacroAssembler* masm) { void ICCompareStub::GenerateObjects(MacroAssembler* masm) {
DCHECK(state_ == CompareIC::OBJECT); DCHECK(state() == CompareIC::OBJECT);
Label miss; Label miss;
__ mov(ecx, edx); __ mov(ecx, edx);
__ and_(ecx, eax); __ and_(ecx, eax);
...@@ -3381,7 +3381,7 @@ void ICCompareStub::GenerateMiss(MacroAssembler* masm) { ...@@ -3381,7 +3381,7 @@ void ICCompareStub::GenerateMiss(MacroAssembler* masm) {
__ push(eax); __ push(eax);
__ push(edx); // And also use them as the arguments. __ push(edx); // And also use them as the arguments.
__ push(eax); __ push(eax);
__ push(Immediate(Smi::FromInt(op_))); __ push(Immediate(Smi::FromInt(op())));
__ CallExternalReference(miss, 3); __ CallExternalReference(miss, 3);
// Compute the entry point of the rewritten stub. // Compute the entry point of the rewritten stub.
__ lea(edi, FieldOperand(eax, Code::kHeaderSize)); __ lea(edi, FieldOperand(eax, Code::kHeaderSize));
......
...@@ -16,7 +16,7 @@ void ArrayNativeCode(MacroAssembler* masm, ...@@ -16,7 +16,7 @@ void ArrayNativeCode(MacroAssembler* masm,
Label* call_generic_code); Label* call_generic_code);
class StoreBufferOverflowStub: public PlatformCodeStub { class StoreBufferOverflowStub : public PlatformCodeStub {
public: public:
explicit StoreBufferOverflowStub(Isolate* isolate) explicit StoreBufferOverflowStub(Isolate* isolate)
: PlatformCodeStub(isolate) { } : PlatformCodeStub(isolate) { }
......
...@@ -178,8 +178,7 @@ void MacroAssembler::RememberedSetHelper( ...@@ -178,8 +178,7 @@ void MacroAssembler::RememberedSetHelper(
DCHECK(and_then == kFallThroughAtEnd); DCHECK(and_then == kFallThroughAtEnd);
j(equal, &done, Label::kNear); j(equal, &done, Label::kNear);
} }
StoreBufferOverflowStub store_buffer_overflow = StoreBufferOverflowStub store_buffer_overflow(isolate());
StoreBufferOverflowStub(isolate());
CallStub(&store_buffer_overflow); CallStub(&store_buffer_overflow);
if (and_then == kReturnAtEnd) { if (and_then == kReturnAtEnd) {
ret(0); ret(0);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment