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