OLD | NEW |
1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 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 5164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5175 __ InvokeBuiltin(Builtins::INSTANCE_OF, JUMP_FUNCTION); | 5175 __ InvokeBuiltin(Builtins::INSTANCE_OF, JUMP_FUNCTION); |
5176 } | 5176 } |
5177 | 5177 |
5178 | 5178 |
5179 Register InstanceofStub::left() { return eax; } | 5179 Register InstanceofStub::left() { return eax; } |
5180 | 5180 |
5181 | 5181 |
5182 Register InstanceofStub::right() { return edx; } | 5182 Register InstanceofStub::right() { return edx; } |
5183 | 5183 |
5184 | 5184 |
5185 const char* InstanceofStub::GetName() { | |
5186 if (name_ != NULL) return name_; | |
5187 const int kMaxNameLength = 100; | |
5188 name_ = Bootstrapper::AllocateAutoDeletedArray(kMaxNameLength); | |
5189 if (name_ == NULL) return "OOM"; | |
5190 | |
5191 const char* args = ""; | |
5192 if (HasArgsInRegisters()) { | |
5193 args = "_REGS"; | |
5194 } | |
5195 | |
5196 const char* inline_check = ""; | |
5197 if (HasCallSiteInlineCheck()) { | |
5198 inline_check = "_INLINE"; | |
5199 } | |
5200 | |
5201 const char* return_true_false_object = ""; | |
5202 if (ReturnTrueFalseObject()) { | |
5203 return_true_false_object = "_TRUEFALSE"; | |
5204 } | |
5205 | |
5206 OS::SNPrintF(Vector<char>(name_, kMaxNameLength), | |
5207 "InstanceofStub%s%s%s", | |
5208 args, | |
5209 inline_check, | |
5210 return_true_false_object); | |
5211 return name_; | |
5212 } | |
5213 | |
5214 | |
5215 int CompareStub::MinorKey() { | 5185 int CompareStub::MinorKey() { |
5216 // Encode the three parameters in a unique 16 bit value. To avoid duplicate | 5186 // Encode the three parameters in a unique 16 bit value. To avoid duplicate |
5217 // stubs the never NaN NaN condition is only taken into account if the | 5187 // stubs the never NaN NaN condition is only taken into account if the |
5218 // condition is equals. | 5188 // condition is equals. |
5219 ASSERT(static_cast<unsigned>(cc_) < (1 << 12)); | 5189 ASSERT(static_cast<unsigned>(cc_) < (1 << 12)); |
5220 ASSERT(lhs_.is(no_reg) && rhs_.is(no_reg)); | 5190 ASSERT(lhs_.is(no_reg) && rhs_.is(no_reg)); |
5221 return ConditionField::encode(static_cast<unsigned>(cc_)) | 5191 return ConditionField::encode(static_cast<unsigned>(cc_)) |
5222 | RegisterField::encode(false) // lhs_ and rhs_ are not used | 5192 | RegisterField::encode(false) // lhs_ and rhs_ are not used |
5223 | StrictField::encode(strict_) | 5193 | StrictField::encode(strict_) |
5224 | NeverNanNanField::encode(cc_ == equal ? never_nan_nan_ : false) | 5194 | NeverNanNanField::encode(cc_ == equal ? never_nan_nan_ : false) |
(...skipping 1295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6520 // Do a tail call to the rewritten stub. | 6490 // Do a tail call to the rewritten stub. |
6521 __ jmp(Operand(edi)); | 6491 __ jmp(Operand(edi)); |
6522 } | 6492 } |
6523 | 6493 |
6524 | 6494 |
6525 #undef __ | 6495 #undef __ |
6526 | 6496 |
6527 } } // namespace v8::internal | 6497 } } // namespace v8::internal |
6528 | 6498 |
6529 #endif // V8_TARGET_ARCH_IA32 | 6499 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |