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 3740 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3751 // Call runtime to perform the lookup. | 3751 // Call runtime to perform the lookup. |
3752 __ push(cache); | 3752 __ push(cache); |
3753 __ push(key); | 3753 __ push(key); |
3754 __ CallRuntime(Runtime::kGetFromCache, 2); | 3754 __ CallRuntime(Runtime::kGetFromCache, 2); |
3755 | 3755 |
3756 __ bind(&done); | 3756 __ bind(&done); |
3757 context()->Plug(rax); | 3757 context()->Plug(rax); |
3758 } | 3758 } |
3759 | 3759 |
3760 | 3760 |
3761 void FullCodeGenerator::EmitIsRegExpEquivalent(CallRuntime* expr) { | |
3762 ZoneList<Expression*>* args = expr->arguments(); | |
3763 ASSERT_EQ(2, args->length()); | |
3764 | |
3765 Register right = rax; | |
3766 Register left = rbx; | |
3767 Register tmp = rcx; | |
3768 | |
3769 VisitForStackValue(args->at(0)); | |
3770 VisitForAccumulatorValue(args->at(1)); | |
3771 __ pop(left); | |
3772 | |
3773 Label done, fail, ok; | |
3774 __ cmpq(left, right); | |
3775 __ j(equal, &ok, Label::kNear); | |
3776 // Fail if either is a non-HeapObject. | |
3777 Condition either_smi = masm()->CheckEitherSmi(left, right, tmp); | |
3778 __ j(either_smi, &fail, Label::kNear); | |
3779 __ j(zero, &fail, Label::kNear); | |
3780 __ movp(tmp, FieldOperand(left, HeapObject::kMapOffset)); | |
3781 __ cmpb(FieldOperand(tmp, Map::kInstanceTypeOffset), | |
3782 Immediate(JS_REGEXP_TYPE)); | |
3783 __ j(not_equal, &fail, Label::kNear); | |
3784 __ cmpq(tmp, FieldOperand(right, HeapObject::kMapOffset)); | |
3785 __ j(not_equal, &fail, Label::kNear); | |
3786 __ movp(tmp, FieldOperand(left, JSRegExp::kDataOffset)); | |
3787 __ cmpq(tmp, FieldOperand(right, JSRegExp::kDataOffset)); | |
3788 __ j(equal, &ok, Label::kNear); | |
3789 __ bind(&fail); | |
3790 __ Move(rax, isolate()->factory()->false_value()); | |
3791 __ jmp(&done, Label::kNear); | |
3792 __ bind(&ok); | |
3793 __ Move(rax, isolate()->factory()->true_value()); | |
3794 __ bind(&done); | |
3795 | |
3796 context()->Plug(rax); | |
3797 } | |
3798 | |
3799 | |
3800 void FullCodeGenerator::EmitHasCachedArrayIndex(CallRuntime* expr) { | 3761 void FullCodeGenerator::EmitHasCachedArrayIndex(CallRuntime* expr) { |
3801 ZoneList<Expression*>* args = expr->arguments(); | 3762 ZoneList<Expression*>* args = expr->arguments(); |
3802 ASSERT(args->length() == 1); | 3763 ASSERT(args->length() == 1); |
3803 | 3764 |
3804 VisitForAccumulatorValue(args->at(0)); | 3765 VisitForAccumulatorValue(args->at(0)); |
3805 | 3766 |
3806 Label materialize_true, materialize_false; | 3767 Label materialize_true, materialize_false; |
3807 Label* if_true = NULL; | 3768 Label* if_true = NULL; |
3808 Label* if_false = NULL; | 3769 Label* if_false = NULL; |
3809 Label* fall_through = NULL; | 3770 Label* fall_through = NULL; |
(...skipping 1085 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4895 | 4856 |
4896 ASSERT_EQ(isolate->builtins()->OsrAfterStackCheck()->entry(), | 4857 ASSERT_EQ(isolate->builtins()->OsrAfterStackCheck()->entry(), |
4897 Assembler::target_address_at(call_target_address)); | 4858 Assembler::target_address_at(call_target_address)); |
4898 return OSR_AFTER_STACK_CHECK; | 4859 return OSR_AFTER_STACK_CHECK; |
4899 } | 4860 } |
4900 | 4861 |
4901 | 4862 |
4902 } } // namespace v8::internal | 4863 } } // namespace v8::internal |
4903 | 4864 |
4904 #endif // V8_TARGET_ARCH_X64 | 4865 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |