| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 969 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 980 } | 980 } |
| 981 | 981 |
| 982 | 982 |
| 983 LEnvironment* LChunkBuilder::CreateEnvironment( | 983 LEnvironment* LChunkBuilder::CreateEnvironment( |
| 984 HEnvironment* hydrogen_env, | 984 HEnvironment* hydrogen_env, |
| 985 int* argument_index_accumulator) { | 985 int* argument_index_accumulator) { |
| 986 if (hydrogen_env == NULL) return NULL; | 986 if (hydrogen_env == NULL) return NULL; |
| 987 | 987 |
| 988 LEnvironment* outer = | 988 LEnvironment* outer = |
| 989 CreateEnvironment(hydrogen_env->outer(), argument_index_accumulator); | 989 CreateEnvironment(hydrogen_env->outer(), argument_index_accumulator); |
| 990 #if DEBUG |
| 990 BailoutId ast_id = hydrogen_env->ast_id(); | 991 BailoutId ast_id = hydrogen_env->ast_id(); |
| 991 ASSERT(!ast_id.IsNone() || | 992 ASSERT(!ast_id.IsNone() || |
| 992 hydrogen_env->frame_type() != JS_FUNCTION); | 993 hydrogen_env->frame_type() != JS_FUNCTION); |
| 994 #endif |
| 993 int value_count = hydrogen_env->length() - hydrogen_env->specials_count(); | 995 int value_count = hydrogen_env->length() - hydrogen_env->specials_count(); |
| 994 LEnvironment* result = | 996 LEnvironment* result = |
| 995 new(zone()) LEnvironment(hydrogen_env->closure(), | 997 new(zone()) LEnvironment(hydrogen_env, |
| 996 hydrogen_env->frame_type(), | |
| 997 ast_id, | |
| 998 hydrogen_env->parameter_count(), | |
| 999 argument_count_, | 998 argument_count_, |
| 1000 value_count, | 999 value_count, |
| 1001 outer, | 1000 outer, |
| 1002 hydrogen_env->entry(), | 1001 hydrogen_env->entry(), |
| 1003 zone()); | 1002 zone()); |
| 1003 |
| 1004 bool needs_arguments_object_materialization = false; | 1004 bool needs_arguments_object_materialization = false; |
| 1005 int argument_index = *argument_index_accumulator; | 1005 int argument_index = *argument_index_accumulator; |
| 1006 for (int i = 0; i < hydrogen_env->length(); ++i) { | 1006 for (int i = 0; i < hydrogen_env->length(); ++i) { |
| 1007 if (hydrogen_env->is_special_index(i)) continue; | 1007 if (hydrogen_env->is_special_index(i)) continue; |
| 1008 | 1008 |
| 1009 HValue* value = hydrogen_env->values()->at(i); | 1009 HValue* value = hydrogen_env->values()->at(i); |
| 1010 LOperand* op = NULL; | 1010 LOperand* op = NULL; |
| 1011 if (value->IsArgumentsObject()) { | 1011 if (value->IsArgumentsObject()) { |
| 1012 needs_arguments_object_materialization = true; | 1012 needs_arguments_object_materialization = true; |
| 1013 op = NULL; | 1013 op = NULL; |
| (...skipping 1721 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2735 return MarkAsCall(new(zone()) LStackCheck(context), instr); | 2735 return MarkAsCall(new(zone()) LStackCheck(context), instr); |
| 2736 } else { | 2736 } else { |
| 2737 ASSERT(instr->is_backwards_branch()); | 2737 ASSERT(instr->is_backwards_branch()); |
| 2738 LOperand* context = UseAny(instr->context()); | 2738 LOperand* context = UseAny(instr->context()); |
| 2739 return AssignEnvironment( | 2739 return AssignEnvironment( |
| 2740 AssignPointerMap(new(zone()) LStackCheck(context))); | 2740 AssignPointerMap(new(zone()) LStackCheck(context))); |
| 2741 } | 2741 } |
| 2742 } | 2742 } |
| 2743 | 2743 |
| 2744 | 2744 |
| 2745 LInstruction* LChunkBuilder::DoEnterTry(HEnterTry* instr) { |
| 2746 current_block_->last_environment()->AddExceptionHandler(); |
| 2747 return new(zone()) LEnterTry; |
| 2748 } |
| 2749 |
| 2750 |
| 2751 LInstruction* LChunkBuilder::DoLeaveTry(HLeaveTry* instr) { |
| 2752 current_block_->last_environment()->RemoveExceptionHandler(); |
| 2753 return new(zone()) LLeaveTry; |
| 2754 } |
| 2755 |
| 2756 |
| 2745 LInstruction* LChunkBuilder::DoEnterInlined(HEnterInlined* instr) { | 2757 LInstruction* LChunkBuilder::DoEnterInlined(HEnterInlined* instr) { |
| 2746 HEnvironment* outer = current_block_->last_environment(); | 2758 HEnvironment* outer = current_block_->last_environment(); |
| 2747 HConstant* undefined = graph()->GetConstantUndefined(); | 2759 HConstant* undefined = graph()->GetConstantUndefined(); |
| 2748 HEnvironment* inner = outer->CopyForInlining(instr->closure(), | 2760 HEnvironment* inner = outer->CopyForInlining(instr->closure(), |
| 2749 instr->arguments_count(), | 2761 instr->arguments_count(), |
| 2750 instr->function(), | 2762 instr->function(), |
| 2751 undefined, | 2763 undefined, |
| 2752 instr->inlining_kind(), | 2764 instr->inlining_kind(), |
| 2753 instr->undefined_receiver()); | 2765 instr->undefined_receiver()); |
| 2754 // Only replay binding of arguments object if it wasn't removed from graph. | 2766 // Only replay binding of arguments object if it wasn't removed from graph. |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2814 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { | 2826 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { |
| 2815 LOperand* object = UseRegister(instr->object()); | 2827 LOperand* object = UseRegister(instr->object()); |
| 2816 LOperand* index = UseTempRegister(instr->index()); | 2828 LOperand* index = UseTempRegister(instr->index()); |
| 2817 return DefineSameAsFirst(new(zone()) LLoadFieldByIndex(object, index)); | 2829 return DefineSameAsFirst(new(zone()) LLoadFieldByIndex(object, index)); |
| 2818 } | 2830 } |
| 2819 | 2831 |
| 2820 | 2832 |
| 2821 } } // namespace v8::internal | 2833 } } // namespace v8::internal |
| 2822 | 2834 |
| 2823 #endif // V8_TARGET_ARCH_IA32 | 2835 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |