OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 3556 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3567 ASSERT(result.is(r0)); | 3567 ASSERT(result.is(r0)); |
3568 __ b(&done); | 3568 __ b(&done); |
3569 | 3569 |
3570 __ bind(&bailout); | 3570 __ bind(&bailout); |
3571 __ LoadRoot(r0, Heap::kUndefinedValueRootIndex); | 3571 __ LoadRoot(r0, Heap::kUndefinedValueRootIndex); |
3572 __ bind(&done); | 3572 __ bind(&done); |
3573 context()->Plug(r0); | 3573 context()->Plug(r0); |
3574 } | 3574 } |
3575 | 3575 |
3576 | 3576 |
| 3577 void FullCodeGenerator::EmitIsNativeOrStrictMode(ZoneList<Expression*>* args) { |
| 3578 ASSERT(args->length() == 1); |
| 3579 |
| 3580 // Load the function into r0. |
| 3581 VisitForAccumulatorValue(args->at(0)); |
| 3582 |
| 3583 // Prepare for the test. |
| 3584 Label materialize_true, materialize_false; |
| 3585 Label* if_true = NULL; |
| 3586 Label* if_false = NULL; |
| 3587 Label* fall_through = NULL; |
| 3588 context()->PrepareTest(&materialize_true, &materialize_false, |
| 3589 &if_true, &if_false, &fall_through); |
| 3590 |
| 3591 // Test for strict mode function. |
| 3592 __ ldr(r1, FieldMemOperand(r0, JSFunction::kSharedFunctionInfoOffset)); |
| 3593 __ ldr(r1, FieldMemOperand(r1, SharedFunctionInfo::kCompilerHintsOffset)); |
| 3594 __ tst(r1, Operand(1 << (SharedFunctionInfo::kStrictModeFunction + |
| 3595 kSmiTagSize))); |
| 3596 __ b(ne, if_true); |
| 3597 |
| 3598 // Test for native function. |
| 3599 __ tst(r1, Operand(1 << (SharedFunctionInfo::kNative + kSmiTagSize))); |
| 3600 __ b(ne, if_true); |
| 3601 |
| 3602 // Not native or strict-mode function. |
| 3603 __ b(if_false); |
| 3604 |
| 3605 PrepareForBailoutBeforeSplit(TOS_REG, true, if_true, if_false); |
| 3606 context()->Plug(if_true, if_false); |
| 3607 } |
| 3608 |
| 3609 |
3577 void FullCodeGenerator::VisitCallRuntime(CallRuntime* expr) { | 3610 void FullCodeGenerator::VisitCallRuntime(CallRuntime* expr) { |
3578 Handle<String> name = expr->name(); | 3611 Handle<String> name = expr->name(); |
3579 if (name->length() > 0 && name->Get(0) == '_') { | 3612 if (name->length() > 0 && name->Get(0) == '_') { |
3580 Comment cmnt(masm_, "[ InlineRuntimeCall"); | 3613 Comment cmnt(masm_, "[ InlineRuntimeCall"); |
3581 EmitInlineRuntimeCall(expr); | 3614 EmitInlineRuntimeCall(expr); |
3582 return; | 3615 return; |
3583 } | 3616 } |
3584 | 3617 |
3585 Comment cmnt(masm_, "[ CallRuntime"); | 3618 Comment cmnt(masm_, "[ CallRuntime"); |
3586 ZoneList<Expression*>* args = expr->arguments(); | 3619 ZoneList<Expression*>* args = expr->arguments(); |
(...skipping 674 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4261 __ mov(r1, Operand(r1, ASR, 1)); // Un-smi-tag value. | 4294 __ mov(r1, Operand(r1, ASR, 1)); // Un-smi-tag value. |
4262 __ add(pc, r1, Operand(masm_->CodeObject())); | 4295 __ add(pc, r1, Operand(masm_->CodeObject())); |
4263 } | 4296 } |
4264 | 4297 |
4265 | 4298 |
4266 #undef __ | 4299 #undef __ |
4267 | 4300 |
4268 } } // namespace v8::internal | 4301 } } // namespace v8::internal |
4269 | 4302 |
4270 #endif // V8_TARGET_ARCH_ARM | 4303 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |