| OLD | NEW |
| 1 // Copyright 2009 the V8 project authors. All rights reserved. | 1 // Copyright 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 842 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 853 // Remove the pointers stored on the stack. | 853 // Remove the pointers stored on the stack. |
| 854 __ bind(loop_statement.break_target()); | 854 __ bind(loop_statement.break_target()); |
| 855 __ Drop(5); | 855 __ Drop(5); |
| 856 | 856 |
| 857 // Exit and decrement the loop depth. | 857 // Exit and decrement the loop depth. |
| 858 __ bind(&exit); | 858 __ bind(&exit); |
| 859 decrement_loop_depth(); | 859 decrement_loop_depth(); |
| 860 } | 860 } |
| 861 | 861 |
| 862 | 862 |
| 863 void FullCodeGenerator::EmitNewClosure(Handle<SharedFunctionInfo> info) { | 863 void FullCodeGenerator::EmitNewClosure(Handle<SharedFunctionInfo> info, |
| 864 bool pretenure) { |
| 864 // Use the fast case closure allocation code that allocates in new | 865 // Use the fast case closure allocation code that allocates in new |
| 865 // space for nested functions that don't need literals cloning. | 866 // space for nested functions that don't need literals cloning. |
| 866 if (scope()->is_function_scope() && info->num_literals() == 0) { | 867 if (scope()->is_function_scope() && |
| 868 info->num_literals() == 0 && |
| 869 !pretenure) { |
| 867 FastNewClosureStub stub; | 870 FastNewClosureStub stub; |
| 868 __ mov(r0, Operand(info)); | 871 __ mov(r0, Operand(info)); |
| 869 __ push(r0); | 872 __ push(r0); |
| 870 __ CallStub(&stub); | 873 __ CallStub(&stub); |
| 871 } else { | 874 } else { |
| 872 __ mov(r0, Operand(info)); | 875 __ mov(r0, Operand(info)); |
| 873 __ Push(cp, r0); | 876 __ LoadRoot(r1, pretenure ? Heap::kTrueValueRootIndex |
| 874 __ CallRuntime(Runtime::kNewClosure, 2); | 877 : Heap::kFalseValueRootIndex); |
| 878 __ Push(cp, r0, r1); |
| 879 __ CallRuntime(Runtime::kNewClosure, 3); |
| 875 } | 880 } |
| 876 context()->Plug(r0); | 881 context()->Plug(r0); |
| 877 } | 882 } |
| 878 | 883 |
| 879 | 884 |
| 880 void FullCodeGenerator::VisitVariableProxy(VariableProxy* expr) { | 885 void FullCodeGenerator::VisitVariableProxy(VariableProxy* expr) { |
| 881 Comment cmnt(masm_, "[ VariableProxy"); | 886 Comment cmnt(masm_, "[ VariableProxy"); |
| 882 EmitVariableLoad(expr->var()); | 887 EmitVariableLoad(expr->var()); |
| 883 } | 888 } |
| 884 | 889 |
| (...skipping 1880 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2765 | 2770 |
| 2766 void FullCodeGenerator::EmitGetCachedArrayIndex(ZoneList<Expression*>* args) { | 2771 void FullCodeGenerator::EmitGetCachedArrayIndex(ZoneList<Expression*>* args) { |
| 2767 ASSERT(args->length() == 1); | 2772 ASSERT(args->length() == 1); |
| 2768 VisitForAccumulatorValue(args->at(0)); | 2773 VisitForAccumulatorValue(args->at(0)); |
| 2769 __ ldr(r0, FieldMemOperand(r0, String::kHashFieldOffset)); | 2774 __ ldr(r0, FieldMemOperand(r0, String::kHashFieldOffset)); |
| 2770 __ IndexFromHash(r0, r0); | 2775 __ IndexFromHash(r0, r0); |
| 2771 context()->Plug(r0); | 2776 context()->Plug(r0); |
| 2772 } | 2777 } |
| 2773 | 2778 |
| 2774 | 2779 |
| 2780 void FullCodeGenerator::EmitFastAsciiArrayJoin(ZoneList<Expression*>* args) { |
| 2781 __ LoadRoot(r0, Heap::kUndefinedValueRootIndex); |
| 2782 context()->Plug(r0); |
| 2783 return; |
| 2784 } |
| 2785 |
| 2786 |
| 2775 void FullCodeGenerator::VisitCallRuntime(CallRuntime* expr) { | 2787 void FullCodeGenerator::VisitCallRuntime(CallRuntime* expr) { |
| 2776 Handle<String> name = expr->name(); | 2788 Handle<String> name = expr->name(); |
| 2777 if (name->length() > 0 && name->Get(0) == '_') { | 2789 if (name->length() > 0 && name->Get(0) == '_') { |
| 2778 Comment cmnt(masm_, "[ InlineRuntimeCall"); | 2790 Comment cmnt(masm_, "[ InlineRuntimeCall"); |
| 2779 EmitInlineRuntimeCall(expr); | 2791 EmitInlineRuntimeCall(expr); |
| 2780 return; | 2792 return; |
| 2781 } | 2793 } |
| 2782 | 2794 |
| 2783 Comment cmnt(masm_, "[ CallRuntime"); | 2795 Comment cmnt(masm_, "[ CallRuntime"); |
| 2784 ZoneList<Expression*>* args = expr->arguments(); | 2796 ZoneList<Expression*>* args = expr->arguments(); |
| (...skipping 641 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3426 __ mov(r1, Operand(r1, ASR, 1)); // Un-smi-tag value. | 3438 __ mov(r1, Operand(r1, ASR, 1)); // Un-smi-tag value. |
| 3427 __ add(pc, r1, Operand(masm_->CodeObject())); | 3439 __ add(pc, r1, Operand(masm_->CodeObject())); |
| 3428 } | 3440 } |
| 3429 | 3441 |
| 3430 | 3442 |
| 3431 #undef __ | 3443 #undef __ |
| 3432 | 3444 |
| 3433 } } // namespace v8::internal | 3445 } } // namespace v8::internal |
| 3434 | 3446 |
| 3435 #endif // V8_TARGET_ARCH_ARM | 3447 #endif // V8_TARGET_ARCH_ARM |
| OLD | NEW |