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 2746 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2757 __ ldrb(r2, FieldMemOperand(r1, Map::kBitField2Offset)); | 2757 __ ldrb(r2, FieldMemOperand(r1, Map::kBitField2Offset)); |
2758 __ orr(r2, r2, Operand(1 << Map::kStringWrapperSafeForDefaultValueOf)); | 2758 __ orr(r2, r2, Operand(1 << Map::kStringWrapperSafeForDefaultValueOf)); |
2759 __ strb(r2, FieldMemOperand(r1, Map::kBitField2Offset)); | 2759 __ strb(r2, FieldMemOperand(r1, Map::kBitField2Offset)); |
2760 __ jmp(if_true); | 2760 __ jmp(if_true); |
2761 | 2761 |
2762 PrepareForBailoutBeforeSplit(expr, true, if_true, if_false); | 2762 PrepareForBailoutBeforeSplit(expr, true, if_true, if_false); |
2763 context()->Plug(if_true, if_false); | 2763 context()->Plug(if_true, if_false); |
2764 } | 2764 } |
2765 | 2765 |
2766 | 2766 |
2767 void FullCodeGenerator::EmitIsSymbol(CallRuntime* expr) { | |
2768 ZoneList<Expression*>* args = expr->arguments(); | |
2769 ASSERT(args->length() == 1); | |
2770 | |
2771 VisitForAccumulatorValue(args->at(0)); | |
2772 | |
2773 Label materialize_true, materialize_false; | |
2774 Label* if_true = NULL; | |
2775 Label* if_false = NULL; | |
2776 Label* fall_through = NULL; | |
2777 context()->PrepareTest(&materialize_true, &materialize_false, | |
2778 &if_true, &if_false, &fall_through); | |
2779 | |
2780 __ JumpIfSmi(r0, if_false); | |
2781 __ CompareObjectType(r0, r1, r2, SYMBOL_TYPE); | |
2782 PrepareForBailoutBeforeSplit(expr, true, if_true, if_false); | |
2783 Split(eq, if_true, if_false, fall_through); | |
2784 | |
2785 context()->Plug(if_true, if_false); | |
2786 } | |
2787 | |
2788 | |
2789 void FullCodeGenerator::EmitIsFunction(CallRuntime* expr) { | 2767 void FullCodeGenerator::EmitIsFunction(CallRuntime* expr) { |
2790 ZoneList<Expression*>* args = expr->arguments(); | 2768 ZoneList<Expression*>* args = expr->arguments(); |
2791 ASSERT(args->length() == 1); | 2769 ASSERT(args->length() == 1); |
2792 | 2770 |
2793 VisitForAccumulatorValue(args->at(0)); | 2771 VisitForAccumulatorValue(args->at(0)); |
2794 | 2772 |
2795 Label materialize_true, materialize_false; | 2773 Label materialize_true, materialize_false; |
2796 Label* if_true = NULL; | 2774 Label* if_true = NULL; |
2797 Label* if_false = NULL; | 2775 Label* if_false = NULL; |
2798 Label* fall_through = NULL; | 2776 Label* fall_through = NULL; |
(...skipping 1486 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4285 __ cmp(r0, ip); | 4263 __ cmp(r0, ip); |
4286 Split(eq, if_true, if_false, fall_through); | 4264 Split(eq, if_true, if_false, fall_through); |
4287 } else if (check->Equals(isolate()->heap()->string_string())) { | 4265 } else if (check->Equals(isolate()->heap()->string_string())) { |
4288 __ JumpIfSmi(r0, if_false); | 4266 __ JumpIfSmi(r0, if_false); |
4289 // Check for undetectable objects => false. | 4267 // Check for undetectable objects => false. |
4290 __ CompareObjectType(r0, r0, r1, FIRST_NONSTRING_TYPE); | 4268 __ CompareObjectType(r0, r0, r1, FIRST_NONSTRING_TYPE); |
4291 __ b(ge, if_false); | 4269 __ b(ge, if_false); |
4292 __ ldrb(r1, FieldMemOperand(r0, Map::kBitFieldOffset)); | 4270 __ ldrb(r1, FieldMemOperand(r0, Map::kBitFieldOffset)); |
4293 __ tst(r1, Operand(1 << Map::kIsUndetectable)); | 4271 __ tst(r1, Operand(1 << Map::kIsUndetectable)); |
4294 Split(eq, if_true, if_false, fall_through); | 4272 Split(eq, if_true, if_false, fall_through); |
| 4273 } else if (check->Equals(isolate()->heap()->symbol_string())) { |
| 4274 __ JumpIfSmi(r0, if_false); |
| 4275 __ CompareObjectType(r0, r0, r1, SYMBOL_TYPE); |
| 4276 Split(eq, if_true, if_false, fall_through); |
4295 } else if (check->Equals(isolate()->heap()->boolean_string())) { | 4277 } else if (check->Equals(isolate()->heap()->boolean_string())) { |
4296 __ CompareRoot(r0, Heap::kTrueValueRootIndex); | 4278 __ CompareRoot(r0, Heap::kTrueValueRootIndex); |
4297 __ b(eq, if_true); | 4279 __ b(eq, if_true); |
4298 __ CompareRoot(r0, Heap::kFalseValueRootIndex); | 4280 __ CompareRoot(r0, Heap::kFalseValueRootIndex); |
4299 Split(eq, if_true, if_false, fall_through); | 4281 Split(eq, if_true, if_false, fall_through); |
4300 } else if (FLAG_harmony_typeof && | 4282 } else if (FLAG_harmony_typeof && |
4301 check->Equals(isolate()->heap()->null_string())) { | 4283 check->Equals(isolate()->heap()->null_string())) { |
4302 __ CompareRoot(r0, Heap::kNullValueRootIndex); | 4284 __ CompareRoot(r0, Heap::kNullValueRootIndex); |
4303 Split(eq, if_true, if_false, fall_through); | 4285 Split(eq, if_true, if_false, fall_through); |
4304 } else if (check->Equals(isolate()->heap()->undefined_string())) { | 4286 } else if (check->Equals(isolate()->heap()->undefined_string())) { |
(...skipping 12 matching lines...) Expand all Loading... |
4317 __ CompareObjectType(r0, r0, r1, JS_FUNCTION_TYPE); | 4299 __ CompareObjectType(r0, r0, r1, JS_FUNCTION_TYPE); |
4318 __ b(eq, if_true); | 4300 __ b(eq, if_true); |
4319 __ cmp(r1, Operand(JS_FUNCTION_PROXY_TYPE)); | 4301 __ cmp(r1, Operand(JS_FUNCTION_PROXY_TYPE)); |
4320 Split(eq, if_true, if_false, fall_through); | 4302 Split(eq, if_true, if_false, fall_through); |
4321 } else if (check->Equals(isolate()->heap()->object_string())) { | 4303 } else if (check->Equals(isolate()->heap()->object_string())) { |
4322 __ JumpIfSmi(r0, if_false); | 4304 __ JumpIfSmi(r0, if_false); |
4323 if (!FLAG_harmony_typeof) { | 4305 if (!FLAG_harmony_typeof) { |
4324 __ CompareRoot(r0, Heap::kNullValueRootIndex); | 4306 __ CompareRoot(r0, Heap::kNullValueRootIndex); |
4325 __ b(eq, if_true); | 4307 __ b(eq, if_true); |
4326 } | 4308 } |
4327 if (FLAG_harmony_symbols) { | |
4328 __ CompareObjectType(r0, r0, r1, SYMBOL_TYPE); | |
4329 __ b(eq, if_true); | |
4330 } | |
4331 // Check for JS objects => true. | 4309 // Check for JS objects => true. |
4332 __ CompareObjectType(r0, r0, r1, FIRST_NONCALLABLE_SPEC_OBJECT_TYPE); | 4310 __ CompareObjectType(r0, r0, r1, FIRST_NONCALLABLE_SPEC_OBJECT_TYPE); |
4333 __ b(lt, if_false); | 4311 __ b(lt, if_false); |
4334 __ CompareInstanceType(r0, r1, LAST_NONCALLABLE_SPEC_OBJECT_TYPE); | 4312 __ CompareInstanceType(r0, r1, LAST_NONCALLABLE_SPEC_OBJECT_TYPE); |
4335 __ b(gt, if_false); | 4313 __ b(gt, if_false); |
4336 // Check for undetectable objects => false. | 4314 // Check for undetectable objects => false. |
4337 __ ldrb(r1, FieldMemOperand(r0, Map::kBitFieldOffset)); | 4315 __ ldrb(r1, FieldMemOperand(r0, Map::kBitFieldOffset)); |
4338 __ tst(r1, Operand(1 << Map::kIsUndetectable)); | 4316 __ tst(r1, Operand(1 << Map::kIsUndetectable)); |
4339 Split(eq, if_true, if_false, fall_through); | 4317 Split(eq, if_true, if_false, fall_through); |
4340 } else { | 4318 } else { |
(...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4602 *context_length = 0; | 4580 *context_length = 0; |
4603 return previous_; | 4581 return previous_; |
4604 } | 4582 } |
4605 | 4583 |
4606 | 4584 |
4607 #undef __ | 4585 #undef __ |
4608 | 4586 |
4609 } } // namespace v8::internal | 4587 } } // namespace v8::internal |
4610 | 4588 |
4611 #endif // V8_TARGET_ARCH_ARM | 4589 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |