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 3584 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3595 ASSERT(result.is(v0)); | 3595 ASSERT(result.is(v0)); |
3596 __ Branch(&done); | 3596 __ Branch(&done); |
3597 | 3597 |
3598 __ bind(&bailout); | 3598 __ bind(&bailout); |
3599 __ LoadRoot(v0, Heap::kUndefinedValueRootIndex); | 3599 __ LoadRoot(v0, Heap::kUndefinedValueRootIndex); |
3600 __ bind(&done); | 3600 __ bind(&done); |
3601 context()->Plug(v0); | 3601 context()->Plug(v0); |
3602 } | 3602 } |
3603 | 3603 |
3604 | 3604 |
3605 void FullCodeGenerator::EmitIsNativeOrStrictMode(ZoneList<Expression*>* args) { | |
3606 ASSERT(args->length() == 1); | |
3607 | |
3608 // Load the function into v0. | |
3609 VisitForAccumulatorValue(args->at(0)); | |
3610 | |
3611 // Prepare for the test. | |
3612 Label materialize_true, materialize_false; | |
3613 Label* if_true = NULL; | |
3614 Label* if_false = NULL; | |
3615 Label* fall_through = NULL; | |
3616 context()->PrepareTest(&materialize_true, &materialize_false, | |
3617 &if_true, &if_false, &fall_through); | |
3618 | |
3619 // Test for strict mode function. | |
3620 __ lw(a1, FieldMemOperand(v0, JSFunction::kSharedFunctionInfoOffset)); | |
3621 __ lw(a1, FieldMemOperand(a1, SharedFunctionInfo::kCompilerHintsOffset)); | |
3622 __ And(at, a1, Operand(1 << (SharedFunctionInfo::kStrictModeFunction + | |
3623 kSmiTagSize))); | |
3624 __ Branch(if_true, ne, at, Operand(zero_reg)); | |
3625 | |
3626 // Test for native function. | |
3627 __ And(at, a1, Operand(1 << (SharedFunctionInfo::kNative + kSmiTagSize))); | |
3628 __ Branch(if_true, ne, at, Operand(zero_reg)); | |
3629 | |
3630 // Not native or strict-mode function. | |
3631 __ Branch(if_false); | |
3632 | |
3633 PrepareForBailoutBeforeSplit(TOS_REG, true, if_true, if_false); | |
3634 context()->Plug(if_true, if_false); | |
3635 } | |
3636 | |
3637 | |
3638 void FullCodeGenerator::VisitCallRuntime(CallRuntime* expr) { | 3605 void FullCodeGenerator::VisitCallRuntime(CallRuntime* expr) { |
3639 Handle<String> name = expr->name(); | 3606 Handle<String> name = expr->name(); |
3640 if (name->length() > 0 && name->Get(0) == '_') { | 3607 if (name->length() > 0 && name->Get(0) == '_') { |
3641 Comment cmnt(masm_, "[ InlineRuntimeCall"); | 3608 Comment cmnt(masm_, "[ InlineRuntimeCall"); |
3642 EmitInlineRuntimeCall(expr); | 3609 EmitInlineRuntimeCall(expr); |
3643 return; | 3610 return; |
3644 } | 3611 } |
3645 | 3612 |
3646 Comment cmnt(masm_, "[ CallRuntime"); | 3613 Comment cmnt(masm_, "[ CallRuntime"); |
3647 ZoneList<Expression*>* args = expr->arguments(); | 3614 ZoneList<Expression*>* args = expr->arguments(); |
(...skipping 670 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4318 __ Addu(at, a1, Operand(masm_->CodeObject())); | 4285 __ Addu(at, a1, Operand(masm_->CodeObject())); |
4319 __ Jump(at); | 4286 __ Jump(at); |
4320 } | 4287 } |
4321 | 4288 |
4322 | 4289 |
4323 #undef __ | 4290 #undef __ |
4324 | 4291 |
4325 } } // namespace v8::internal | 4292 } } // namespace v8::internal |
4326 | 4293 |
4327 #endif // V8_TARGET_ARCH_MIPS | 4294 #endif // V8_TARGET_ARCH_MIPS |
OLD | NEW |