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 2548 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3433 __ mov(r1, Operand(r1, ASR, 1)); // Un-smi-tag value. | 3438 __ mov(r1, Operand(r1, ASR, 1)); // Un-smi-tag value. |
3434 __ add(pc, r1, Operand(masm_->CodeObject())); | 3439 __ add(pc, r1, Operand(masm_->CodeObject())); |
3435 } | 3440 } |
3436 | 3441 |
3437 | 3442 |
3438 #undef __ | 3443 #undef __ |
3439 | 3444 |
3440 } } // namespace v8::internal | 3445 } } // namespace v8::internal |
3441 | 3446 |
3442 #endif // V8_TARGET_ARCH_ARM | 3447 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |