| OLD | NEW |
| 1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 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 819 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 830 // Remove the pointers stored on the stack. | 830 // Remove the pointers stored on the stack. |
| 831 __ bind(loop_statement.break_target()); | 831 __ bind(loop_statement.break_target()); |
| 832 __ addq(rsp, Immediate(5 * kPointerSize)); | 832 __ addq(rsp, Immediate(5 * kPointerSize)); |
| 833 | 833 |
| 834 // Exit and decrement the loop depth. | 834 // Exit and decrement the loop depth. |
| 835 __ bind(&exit); | 835 __ bind(&exit); |
| 836 decrement_loop_depth(); | 836 decrement_loop_depth(); |
| 837 } | 837 } |
| 838 | 838 |
| 839 | 839 |
| 840 void FullCodeGenerator::EmitNewClosure(Handle<SharedFunctionInfo> info) { | 840 void FullCodeGenerator::EmitNewClosure(Handle<SharedFunctionInfo> info, |
| 841 bool pretenure) { |
| 841 // Use the fast case closure allocation code that allocates in new | 842 // Use the fast case closure allocation code that allocates in new |
| 842 // space for nested functions that don't need literals cloning. | 843 // space for nested functions that don't need literals cloning. |
| 843 if (scope()->is_function_scope() && info->num_literals() == 0) { | 844 if (scope()->is_function_scope() && |
| 845 info->num_literals() == 0 && |
| 846 !pretenure) { |
| 844 FastNewClosureStub stub; | 847 FastNewClosureStub stub; |
| 845 __ Push(info); | 848 __ Push(info); |
| 846 __ CallStub(&stub); | 849 __ CallStub(&stub); |
| 847 } else { | 850 } else { |
| 848 __ push(rsi); | 851 __ push(rsi); |
| 849 __ Push(info); | 852 __ Push(info); |
| 850 __ CallRuntime(Runtime::kNewClosure, 2); | 853 __ Push(pretenure ? Factory::true_value() : Factory::false_value()); |
| 854 __ CallRuntime(Runtime::kNewClosure, 3); |
| 851 } | 855 } |
| 852 context()->Plug(rax); | 856 context()->Plug(rax); |
| 853 } | 857 } |
| 854 | 858 |
| 855 | 859 |
| 856 void FullCodeGenerator::VisitVariableProxy(VariableProxy* expr) { | 860 void FullCodeGenerator::VisitVariableProxy(VariableProxy* expr) { |
| 857 Comment cmnt(masm_, "[ VariableProxy"); | 861 Comment cmnt(masm_, "[ VariableProxy"); |
| 858 EmitVariableLoad(expr->var()); | 862 EmitVariableLoad(expr->var()); |
| 859 } | 863 } |
| 860 | 864 |
| (...skipping 1927 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2788 VisitForAccumulatorValue(args->at(0)); | 2792 VisitForAccumulatorValue(args->at(0)); |
| 2789 | 2793 |
| 2790 __ movl(rax, FieldOperand(rax, String::kHashFieldOffset)); | 2794 __ movl(rax, FieldOperand(rax, String::kHashFieldOffset)); |
| 2791 ASSERT(String::kHashShift >= kSmiTagSize); | 2795 ASSERT(String::kHashShift >= kSmiTagSize); |
| 2792 __ IndexFromHash(rax, rax); | 2796 __ IndexFromHash(rax, rax); |
| 2793 | 2797 |
| 2794 context()->Plug(rax); | 2798 context()->Plug(rax); |
| 2795 } | 2799 } |
| 2796 | 2800 |
| 2797 | 2801 |
| 2802 void FullCodeGenerator::EmitFastAsciiArrayJoin(ZoneList<Expression*>* args) { |
| 2803 context()->Plug(Heap::kUndefinedValueRootIndex); |
| 2804 } |
| 2805 |
| 2806 |
| 2798 void FullCodeGenerator::VisitCallRuntime(CallRuntime* expr) { | 2807 void FullCodeGenerator::VisitCallRuntime(CallRuntime* expr) { |
| 2799 Handle<String> name = expr->name(); | 2808 Handle<String> name = expr->name(); |
| 2800 if (name->length() > 0 && name->Get(0) == '_') { | 2809 if (name->length() > 0 && name->Get(0) == '_') { |
| 2801 Comment cmnt(masm_, "[ InlineRuntimeCall"); | 2810 Comment cmnt(masm_, "[ InlineRuntimeCall"); |
| 2802 EmitInlineRuntimeCall(expr); | 2811 EmitInlineRuntimeCall(expr); |
| 2803 return; | 2812 return; |
| 2804 } | 2813 } |
| 2805 | 2814 |
| 2806 Comment cmnt(masm_, "[ CallRuntime"); | 2815 Comment cmnt(masm_, "[ CallRuntime"); |
| 2807 ZoneList<Expression*>* args = expr->arguments(); | 2816 ZoneList<Expression*>* args = expr->arguments(); |
| (...skipping 652 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3460 __ ret(0); | 3469 __ ret(0); |
| 3461 } | 3470 } |
| 3462 | 3471 |
| 3463 | 3472 |
| 3464 #undef __ | 3473 #undef __ |
| 3465 | 3474 |
| 3466 | 3475 |
| 3467 } } // namespace v8::internal | 3476 } } // namespace v8::internal |
| 3468 | 3477 |
| 3469 #endif // V8_TARGET_ARCH_X64 | 3478 #endif // V8_TARGET_ARCH_X64 |
| OLD | NEW |