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 2734 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2745 __ ldrb(r2, FieldMemOperand(r1, Map::kBitField2Offset)); | 2745 __ ldrb(r2, FieldMemOperand(r1, Map::kBitField2Offset)); |
2746 __ orr(r2, r2, Operand(1 << Map::kStringWrapperSafeForDefaultValueOf)); | 2746 __ orr(r2, r2, Operand(1 << Map::kStringWrapperSafeForDefaultValueOf)); |
2747 __ strb(r2, FieldMemOperand(r1, Map::kBitField2Offset)); | 2747 __ strb(r2, FieldMemOperand(r1, Map::kBitField2Offset)); |
2748 __ jmp(if_true); | 2748 __ jmp(if_true); |
2749 | 2749 |
2750 PrepareForBailoutBeforeSplit(expr, true, if_true, if_false); | 2750 PrepareForBailoutBeforeSplit(expr, true, if_true, if_false); |
2751 context()->Plug(if_true, if_false); | 2751 context()->Plug(if_true, if_false); |
2752 } | 2752 } |
2753 | 2753 |
2754 | 2754 |
| 2755 void FullCodeGenerator::EmitIsSymbol(CallRuntime* expr) { |
| 2756 ZoneList<Expression*>* args = expr->arguments(); |
| 2757 ASSERT(args->length() == 1); |
| 2758 |
| 2759 VisitForAccumulatorValue(args->at(0)); |
| 2760 |
| 2761 Label materialize_true, materialize_false; |
| 2762 Label* if_true = NULL; |
| 2763 Label* if_false = NULL; |
| 2764 Label* fall_through = NULL; |
| 2765 context()->PrepareTest(&materialize_true, &materialize_false, |
| 2766 &if_true, &if_false, &fall_through); |
| 2767 |
| 2768 __ JumpIfSmi(r0, if_false); |
| 2769 __ CompareObjectType(r0, r1, r2, SYMBOL_TYPE); |
| 2770 PrepareForBailoutBeforeSplit(expr, true, if_true, if_false); |
| 2771 Split(eq, if_true, if_false, fall_through); |
| 2772 |
| 2773 context()->Plug(if_true, if_false); |
| 2774 } |
| 2775 |
| 2776 |
2755 void FullCodeGenerator::EmitIsFunction(CallRuntime* expr) { | 2777 void FullCodeGenerator::EmitIsFunction(CallRuntime* expr) { |
2756 ZoneList<Expression*>* args = expr->arguments(); | 2778 ZoneList<Expression*>* args = expr->arguments(); |
2757 ASSERT(args->length() == 1); | 2779 ASSERT(args->length() == 1); |
2758 | 2780 |
2759 VisitForAccumulatorValue(args->at(0)); | 2781 VisitForAccumulatorValue(args->at(0)); |
2760 | 2782 |
2761 Label materialize_true, materialize_false; | 2783 Label materialize_true, materialize_false; |
2762 Label* if_true = NULL; | 2784 Label* if_true = NULL; |
2763 Label* if_false = NULL; | 2785 Label* if_false = NULL; |
2764 Label* fall_through = NULL; | 2786 Label* fall_through = NULL; |
(...skipping 1516 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4281 __ CompareObjectType(r0, r0, r1, JS_FUNCTION_TYPE); | 4303 __ CompareObjectType(r0, r0, r1, JS_FUNCTION_TYPE); |
4282 __ b(eq, if_true); | 4304 __ b(eq, if_true); |
4283 __ cmp(r1, Operand(JS_FUNCTION_PROXY_TYPE)); | 4305 __ cmp(r1, Operand(JS_FUNCTION_PROXY_TYPE)); |
4284 Split(eq, if_true, if_false, fall_through); | 4306 Split(eq, if_true, if_false, fall_through); |
4285 } else if (check->Equals(isolate()->heap()->object_string())) { | 4307 } else if (check->Equals(isolate()->heap()->object_string())) { |
4286 __ JumpIfSmi(r0, if_false); | 4308 __ JumpIfSmi(r0, if_false); |
4287 if (!FLAG_harmony_typeof) { | 4309 if (!FLAG_harmony_typeof) { |
4288 __ CompareRoot(r0, Heap::kNullValueRootIndex); | 4310 __ CompareRoot(r0, Heap::kNullValueRootIndex); |
4289 __ b(eq, if_true); | 4311 __ b(eq, if_true); |
4290 } | 4312 } |
| 4313 if (FLAG_harmony_symbols) { |
| 4314 __ CompareObjectType(r0, r0, r1, SYMBOL_TYPE); |
| 4315 __ b(eq, if_true); |
| 4316 } |
4291 // Check for JS objects => true. | 4317 // Check for JS objects => true. |
4292 __ CompareObjectType(r0, r0, r1, FIRST_NONCALLABLE_SPEC_OBJECT_TYPE); | 4318 __ CompareObjectType(r0, r0, r1, FIRST_NONCALLABLE_SPEC_OBJECT_TYPE); |
4293 __ b(lt, if_false); | 4319 __ b(lt, if_false); |
4294 __ CompareInstanceType(r0, r1, LAST_NONCALLABLE_SPEC_OBJECT_TYPE); | 4320 __ CompareInstanceType(r0, r1, LAST_NONCALLABLE_SPEC_OBJECT_TYPE); |
4295 __ b(gt, if_false); | 4321 __ b(gt, if_false); |
4296 // Check for undetectable objects => false. | 4322 // Check for undetectable objects => false. |
4297 __ ldrb(r1, FieldMemOperand(r0, Map::kBitFieldOffset)); | 4323 __ ldrb(r1, FieldMemOperand(r0, Map::kBitFieldOffset)); |
4298 __ tst(r1, Operand(1 << Map::kIsUndetectable)); | 4324 __ tst(r1, Operand(1 << Map::kIsUndetectable)); |
4299 Split(eq, if_true, if_false, fall_through); | 4325 Split(eq, if_true, if_false, fall_through); |
4300 } else { | 4326 } else { |
(...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4562 *context_length = 0; | 4588 *context_length = 0; |
4563 return previous_; | 4589 return previous_; |
4564 } | 4590 } |
4565 | 4591 |
4566 | 4592 |
4567 #undef __ | 4593 #undef __ |
4568 | 4594 |
4569 } } // namespace v8::internal | 4595 } } // namespace v8::internal |
4570 | 4596 |
4571 #endif // V8_TARGET_ARCH_ARM | 4597 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |