OLD | NEW |
1 // Copyright 2006-2009 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2009 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 3960 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3971 __ ldr(r1, FieldMemOperand(r1, HeapObject::kMapOffset)); | 3971 __ ldr(r1, FieldMemOperand(r1, HeapObject::kMapOffset)); |
3972 __ ldrb(r2, FieldMemOperand(r1, Map::kBitFieldOffset)); | 3972 __ ldrb(r2, FieldMemOperand(r1, Map::kBitFieldOffset)); |
3973 __ and_(r2, r2, Operand(1 << Map::kIsUndetectable)); | 3973 __ and_(r2, r2, Operand(1 << Map::kIsUndetectable)); |
3974 __ cmp(r2, Operand(1 << Map::kIsUndetectable)); | 3974 __ cmp(r2, Operand(1 << Map::kIsUndetectable)); |
3975 | 3975 |
3976 cc_reg_ = eq; | 3976 cc_reg_ = eq; |
3977 | 3977 |
3978 } else if (check->Equals(Heap::function_symbol())) { | 3978 } else if (check->Equals(Heap::function_symbol())) { |
3979 __ tst(r1, Operand(kSmiTagMask)); | 3979 __ tst(r1, Operand(kSmiTagMask)); |
3980 false_target()->Branch(eq); | 3980 false_target()->Branch(eq); |
3981 __ CompareObjectType(r1, r1, r1, JS_FUNCTION_TYPE); | 3981 Register map_reg = r2; |
| 3982 __ CompareObjectType(r1, map_reg, r1, JS_FUNCTION_TYPE); |
| 3983 true_target()->Branch(eq); |
| 3984 // Regular expressions are callable so typeof == 'function'. |
| 3985 __ CompareInstanceType(map_reg, r1, JS_REGEXP_TYPE); |
3982 cc_reg_ = eq; | 3986 cc_reg_ = eq; |
3983 | 3987 |
3984 } else if (check->Equals(Heap::object_symbol())) { | 3988 } else if (check->Equals(Heap::object_symbol())) { |
3985 __ tst(r1, Operand(kSmiTagMask)); | 3989 __ tst(r1, Operand(kSmiTagMask)); |
3986 false_target()->Branch(eq); | 3990 false_target()->Branch(eq); |
3987 | 3991 |
3988 __ ldr(r2, FieldMemOperand(r1, HeapObject::kMapOffset)); | |
3989 __ LoadRoot(ip, Heap::kNullValueRootIndex); | 3992 __ LoadRoot(ip, Heap::kNullValueRootIndex); |
3990 __ cmp(r1, ip); | 3993 __ cmp(r1, ip); |
3991 true_target()->Branch(eq); | 3994 true_target()->Branch(eq); |
3992 | 3995 |
| 3996 Register map_reg = r2; |
| 3997 __ CompareObjectType(r1, map_reg, r1, JS_REGEXP_TYPE); |
| 3998 false_target()->Branch(eq); |
| 3999 |
3993 // It can be an undetectable object. | 4000 // It can be an undetectable object. |
3994 __ ldrb(r1, FieldMemOperand(r2, Map::kBitFieldOffset)); | 4001 __ ldrb(r1, FieldMemOperand(map_reg, Map::kBitFieldOffset)); |
3995 __ and_(r1, r1, Operand(1 << Map::kIsUndetectable)); | 4002 __ and_(r1, r1, Operand(1 << Map::kIsUndetectable)); |
3996 __ cmp(r1, Operand(1 << Map::kIsUndetectable)); | 4003 __ cmp(r1, Operand(1 << Map::kIsUndetectable)); |
3997 false_target()->Branch(eq); | 4004 false_target()->Branch(eq); |
3998 | 4005 |
3999 __ ldrb(r2, FieldMemOperand(r2, Map::kInstanceTypeOffset)); | 4006 __ ldrb(r1, FieldMemOperand(map_reg, Map::kInstanceTypeOffset)); |
4000 __ cmp(r2, Operand(FIRST_JS_OBJECT_TYPE)); | 4007 __ cmp(r1, Operand(FIRST_JS_OBJECT_TYPE)); |
4001 false_target()->Branch(lt); | 4008 false_target()->Branch(lt); |
4002 __ cmp(r2, Operand(LAST_JS_OBJECT_TYPE)); | 4009 __ cmp(r1, Operand(LAST_JS_OBJECT_TYPE)); |
4003 cc_reg_ = le; | 4010 cc_reg_ = le; |
4004 | 4011 |
4005 } else { | 4012 } else { |
4006 // Uncommon case: typeof testing against a string literal that is | 4013 // Uncommon case: typeof testing against a string literal that is |
4007 // never returned from the typeof operator. | 4014 // never returned from the typeof operator. |
4008 false_target()->Jump(); | 4015 false_target()->Jump(); |
4009 } | 4016 } |
4010 ASSERT(!has_valid_frame() || | 4017 ASSERT(!has_valid_frame() || |
4011 (has_cc() && frame_->height() == original_height)); | 4018 (has_cc() && frame_->height() == original_height)); |
4012 return; | 4019 return; |
(...skipping 2220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6233 int CompareStub::MinorKey() { | 6240 int CompareStub::MinorKey() { |
6234 // Encode the two parameters in a unique 16 bit value. | 6241 // Encode the two parameters in a unique 16 bit value. |
6235 ASSERT(static_cast<unsigned>(cc_) >> 28 < (1 << 15)); | 6242 ASSERT(static_cast<unsigned>(cc_) >> 28 < (1 << 15)); |
6236 return (static_cast<unsigned>(cc_) >> 27) | (strict_ ? 1 : 0); | 6243 return (static_cast<unsigned>(cc_) >> 27) | (strict_ ? 1 : 0); |
6237 } | 6244 } |
6238 | 6245 |
6239 | 6246 |
6240 #undef __ | 6247 #undef __ |
6241 | 6248 |
6242 } } // namespace v8::internal | 6249 } } // namespace v8::internal |
OLD | NEW |