OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 3759 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3770 // Call runtime to perform the lookup. | 3770 // Call runtime to perform the lookup. |
3771 __ push(cache); | 3771 __ push(cache); |
3772 __ push(key); | 3772 __ push(key); |
3773 __ CallRuntime(Runtime::kGetFromCache, 2); | 3773 __ CallRuntime(Runtime::kGetFromCache, 2); |
3774 | 3774 |
3775 __ bind(&done); | 3775 __ bind(&done); |
3776 context()->Plug(eax); | 3776 context()->Plug(eax); |
3777 } | 3777 } |
3778 | 3778 |
3779 | 3779 |
3780 void FullCodeGenerator::EmitIsRegExpEquivalent(CallRuntime* expr) { | |
3781 ZoneList<Expression*>* args = expr->arguments(); | |
3782 ASSERT_EQ(2, args->length()); | |
3783 | |
3784 Register right = eax; | |
3785 Register left = ebx; | |
3786 Register tmp = ecx; | |
3787 | |
3788 VisitForStackValue(args->at(0)); | |
3789 VisitForAccumulatorValue(args->at(1)); | |
3790 __ pop(left); | |
3791 | |
3792 Label done, fail, ok; | |
3793 __ cmp(left, right); | |
3794 __ j(equal, &ok); | |
3795 // Fail if either is a non-HeapObject. | |
3796 __ mov(tmp, left); | |
3797 __ and_(tmp, right); | |
3798 __ JumpIfSmi(tmp, &fail); | |
3799 __ mov(tmp, FieldOperand(left, HeapObject::kMapOffset)); | |
3800 __ CmpInstanceType(tmp, JS_REGEXP_TYPE); | |
3801 __ j(not_equal, &fail); | |
3802 __ cmp(tmp, FieldOperand(right, HeapObject::kMapOffset)); | |
3803 __ j(not_equal, &fail); | |
3804 __ mov(tmp, FieldOperand(left, JSRegExp::kDataOffset)); | |
3805 __ cmp(tmp, FieldOperand(right, JSRegExp::kDataOffset)); | |
3806 __ j(equal, &ok); | |
3807 __ bind(&fail); | |
3808 __ mov(eax, Immediate(isolate()->factory()->false_value())); | |
3809 __ jmp(&done); | |
3810 __ bind(&ok); | |
3811 __ mov(eax, Immediate(isolate()->factory()->true_value())); | |
3812 __ bind(&done); | |
3813 | |
3814 context()->Plug(eax); | |
3815 } | |
3816 | |
3817 | |
3818 void FullCodeGenerator::EmitHasCachedArrayIndex(CallRuntime* expr) { | 3780 void FullCodeGenerator::EmitHasCachedArrayIndex(CallRuntime* expr) { |
3819 ZoneList<Expression*>* args = expr->arguments(); | 3781 ZoneList<Expression*>* args = expr->arguments(); |
3820 ASSERT(args->length() == 1); | 3782 ASSERT(args->length() == 1); |
3821 | 3783 |
3822 VisitForAccumulatorValue(args->at(0)); | 3784 VisitForAccumulatorValue(args->at(0)); |
3823 | 3785 |
3824 __ AssertString(eax); | 3786 __ AssertString(eax); |
3825 | 3787 |
3826 Label materialize_true, materialize_false; | 3788 Label materialize_true, materialize_false; |
3827 Label* if_true = NULL; | 3789 Label* if_true = NULL; |
(...skipping 1068 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4896 | 4858 |
4897 ASSERT_EQ(isolate->builtins()->OsrAfterStackCheck()->entry(), | 4859 ASSERT_EQ(isolate->builtins()->OsrAfterStackCheck()->entry(), |
4898 Assembler::target_address_at(call_target_address)); | 4860 Assembler::target_address_at(call_target_address)); |
4899 return OSR_AFTER_STACK_CHECK; | 4861 return OSR_AFTER_STACK_CHECK; |
4900 } | 4862 } |
4901 | 4863 |
4902 | 4864 |
4903 } } // namespace v8::internal | 4865 } } // namespace v8::internal |
4904 | 4866 |
4905 #endif // V8_TARGET_ARCH_IA32 | 4867 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |