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 3797 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3808 } | 3808 } |
3809 | 3809 |
3810 | 3810 |
3811 void FullCodeGenerator::EmitRegExpConstructResult(CallRuntime* expr) { | 3811 void FullCodeGenerator::EmitRegExpConstructResult(CallRuntime* expr) { |
3812 RegExpConstructResultStub stub; | 3812 RegExpConstructResultStub stub; |
3813 ZoneList<Expression*>* args = expr->arguments(); | 3813 ZoneList<Expression*>* args = expr->arguments(); |
3814 ASSERT(args->length() == 3); | 3814 ASSERT(args->length() == 3); |
3815 VisitForStackValue(args->at(0)); | 3815 VisitForStackValue(args->at(0)); |
3816 VisitForStackValue(args->at(1)); | 3816 VisitForStackValue(args->at(1)); |
3817 VisitForAccumulatorValue(args->at(2)); | 3817 VisitForAccumulatorValue(args->at(2)); |
| 3818 __ mov(a0, result_register()); |
3818 __ pop(a1); | 3819 __ pop(a1); |
3819 __ pop(a2); | 3820 __ pop(a2); |
3820 __ CallStub(&stub); | 3821 __ CallStub(&stub); |
3821 context()->Plug(v0); | 3822 context()->Plug(v0); |
3822 } | 3823 } |
3823 | 3824 |
3824 | 3825 |
3825 void FullCodeGenerator::EmitGetFromCache(CallRuntime* expr) { | 3826 void FullCodeGenerator::EmitGetFromCache(CallRuntime* expr) { |
3826 ZoneList<Expression*>* args = expr->arguments(); | 3827 ZoneList<Expression*>* args = expr->arguments(); |
3827 ASSERT_EQ(2, args->length()); | 3828 ASSERT_EQ(2, args->length()); |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3869 __ bind(¬_found); | 3870 __ bind(¬_found); |
3870 // Call runtime to perform the lookup. | 3871 // Call runtime to perform the lookup. |
3871 __ Push(cache, key); | 3872 __ Push(cache, key); |
3872 __ CallRuntime(Runtime::kGetFromCache, 2); | 3873 __ CallRuntime(Runtime::kGetFromCache, 2); |
3873 | 3874 |
3874 __ bind(&done); | 3875 __ bind(&done); |
3875 context()->Plug(v0); | 3876 context()->Plug(v0); |
3876 } | 3877 } |
3877 | 3878 |
3878 | 3879 |
3879 void FullCodeGenerator::EmitIsRegExpEquivalent(CallRuntime* expr) { | |
3880 ZoneList<Expression*>* args = expr->arguments(); | |
3881 ASSERT_EQ(2, args->length()); | |
3882 | |
3883 Register right = v0; | |
3884 Register left = a1; | |
3885 Register tmp = a2; | |
3886 Register tmp2 = a3; | |
3887 | |
3888 VisitForStackValue(args->at(0)); | |
3889 VisitForAccumulatorValue(args->at(1)); // Result (right) in v0. | |
3890 __ pop(left); | |
3891 | |
3892 Label done, fail, ok; | |
3893 __ Branch(&ok, eq, left, Operand(right)); | |
3894 // Fail if either is a non-HeapObject. | |
3895 __ And(tmp, left, Operand(right)); | |
3896 __ JumpIfSmi(tmp, &fail); | |
3897 __ lw(tmp, FieldMemOperand(left, HeapObject::kMapOffset)); | |
3898 __ lbu(tmp2, FieldMemOperand(tmp, Map::kInstanceTypeOffset)); | |
3899 __ Branch(&fail, ne, tmp2, Operand(JS_REGEXP_TYPE)); | |
3900 __ lw(tmp2, FieldMemOperand(right, HeapObject::kMapOffset)); | |
3901 __ Branch(&fail, ne, tmp, Operand(tmp2)); | |
3902 __ lw(tmp, FieldMemOperand(left, JSRegExp::kDataOffset)); | |
3903 __ lw(tmp2, FieldMemOperand(right, JSRegExp::kDataOffset)); | |
3904 __ Branch(&ok, eq, tmp, Operand(tmp2)); | |
3905 __ bind(&fail); | |
3906 __ LoadRoot(v0, Heap::kFalseValueRootIndex); | |
3907 __ jmp(&done); | |
3908 __ bind(&ok); | |
3909 __ LoadRoot(v0, Heap::kTrueValueRootIndex); | |
3910 __ bind(&done); | |
3911 | |
3912 context()->Plug(v0); | |
3913 } | |
3914 | |
3915 | |
3916 void FullCodeGenerator::EmitHasCachedArrayIndex(CallRuntime* expr) { | 3880 void FullCodeGenerator::EmitHasCachedArrayIndex(CallRuntime* expr) { |
3917 ZoneList<Expression*>* args = expr->arguments(); | 3881 ZoneList<Expression*>* args = expr->arguments(); |
3918 VisitForAccumulatorValue(args->at(0)); | 3882 VisitForAccumulatorValue(args->at(0)); |
3919 | 3883 |
3920 Label materialize_true, materialize_false; | 3884 Label materialize_true, materialize_false; |
3921 Label* if_true = NULL; | 3885 Label* if_true = NULL; |
3922 Label* if_false = NULL; | 3886 Label* if_false = NULL; |
3923 Label* fall_through = NULL; | 3887 Label* fall_through = NULL; |
3924 context()->PrepareTest(&materialize_true, &materialize_false, | 3888 context()->PrepareTest(&materialize_true, &materialize_false, |
3925 &if_true, &if_false, &fall_through); | 3889 &if_true, &if_false, &fall_through); |
(...skipping 1037 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4963 Assembler::target_address_at(pc_immediate_load_address)) == | 4927 Assembler::target_address_at(pc_immediate_load_address)) == |
4964 reinterpret_cast<uint32_t>( | 4928 reinterpret_cast<uint32_t>( |
4965 isolate->builtins()->OsrAfterStackCheck()->entry())); | 4929 isolate->builtins()->OsrAfterStackCheck()->entry())); |
4966 return OSR_AFTER_STACK_CHECK; | 4930 return OSR_AFTER_STACK_CHECK; |
4967 } | 4931 } |
4968 | 4932 |
4969 | 4933 |
4970 } } // namespace v8::internal | 4934 } } // namespace v8::internal |
4971 | 4935 |
4972 #endif // V8_TARGET_ARCH_MIPS | 4936 #endif // V8_TARGET_ARCH_MIPS |
OLD | NEW |