Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(34)

Side by Side Diff: src/ia32/lithium-ia32.cc

Issue 16996004: Rollback of r15097, r15087 in trunk branch. (Closed) Base URL: https://v8.googlecode.com/svn/trunk
Patch Set: Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/ia32/lithium-codegen-ia32.cc ('k') | src/lithium.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 972 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 BailoutId ast_id = hydrogen_env->ast_id(); 990 BailoutId ast_id = hydrogen_env->ast_id();
991 ASSERT(!ast_id.IsNone() || 991 ASSERT(!ast_id.IsNone() ||
992 hydrogen_env->frame_type() != JS_FUNCTION); 992 hydrogen_env->frame_type() != JS_FUNCTION);
993 int value_count = hydrogen_env->length() - hydrogen_env->specials_count(); 993 int value_count = hydrogen_env->length();
994 LEnvironment* result = 994 LEnvironment* result =
995 new(zone()) LEnvironment(hydrogen_env->closure(), 995 new(zone()) LEnvironment(hydrogen_env->closure(),
996 hydrogen_env->frame_type(), 996 hydrogen_env->frame_type(),
997 ast_id, 997 ast_id,
998 hydrogen_env->parameter_count(), 998 hydrogen_env->parameter_count(),
999 argument_count_, 999 argument_count_,
1000 value_count, 1000 value_count,
1001 outer, 1001 outer,
1002 hydrogen_env->entry(), 1002 hydrogen_env->entry(),
1003 zone()); 1003 zone());
1004 bool needs_arguments_object_materialization = false;
1005 int argument_index = *argument_index_accumulator; 1004 int argument_index = *argument_index_accumulator;
1006 for (int i = 0; i < hydrogen_env->length(); ++i) { 1005 for (int i = 0; i < value_count; ++i) {
1007 if (hydrogen_env->is_special_index(i)) continue; 1006 if (hydrogen_env->is_special_index(i)) continue;
1008 1007
1009 HValue* value = hydrogen_env->values()->at(i); 1008 HValue* value = hydrogen_env->values()->at(i);
1010 LOperand* op = NULL; 1009 LOperand* op = NULL;
1011 if (value->IsArgumentsObject()) { 1010 if (value->IsArgumentsObject()) {
1012 needs_arguments_object_materialization = true;
1013 op = NULL; 1011 op = NULL;
1014 } else if (value->IsPushArgument()) { 1012 } else if (value->IsPushArgument()) {
1015 op = new(zone()) LArgument(argument_index++); 1013 op = new(zone()) LArgument(argument_index++);
1016 } else { 1014 } else {
1017 op = UseAny(value); 1015 op = UseAny(value);
1018 } 1016 }
1019 result->AddValue(op, 1017 result->AddValue(op,
1020 value->representation(), 1018 value->representation(),
1021 value->CheckFlag(HInstruction::kUint32)); 1019 value->CheckFlag(HInstruction::kUint32));
1022 } 1020 }
1023 1021
1024 if (needs_arguments_object_materialization) {
1025 HArgumentsObject* arguments = hydrogen_env->entry() == NULL
1026 ? graph()->GetArgumentsObject()
1027 : hydrogen_env->entry()->arguments_object();
1028 ASSERT(arguments->IsLinked());
1029 for (int i = 1; i < arguments->arguments_count(); ++i) {
1030 HValue* value = arguments->arguments_values()->at(i);
1031 ASSERT(!value->IsArgumentsObject() && !value->IsPushArgument());
1032 ASSERT(HInstruction::cast(value)->IsLinked());
1033 LOperand* op = UseAny(value);
1034 result->AddValue(op,
1035 value->representation(),
1036 value->CheckFlag(HInstruction::kUint32));
1037 }
1038 }
1039
1040 if (hydrogen_env->frame_type() == JS_FUNCTION) { 1022 if (hydrogen_env->frame_type() == JS_FUNCTION) {
1041 *argument_index_accumulator = argument_index; 1023 *argument_index_accumulator = argument_index;
1042 } 1024 }
1043 1025
1044 return result; 1026 return result;
1045 } 1027 }
1046 1028
1047 1029
1048 LInstruction* LChunkBuilder::DoGoto(HGoto* instr) { 1030 LInstruction* LChunkBuilder::DoGoto(HGoto* instr) {
1049 return new(zone()) LGoto(instr->FirstSuccessor()->block_id()); 1031 return new(zone()) LGoto(instr->FirstSuccessor()->block_id());
(...skipping 1760 matching lines...) Expand 10 before | Expand all | Expand 10 after
2810 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { 2792 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) {
2811 LOperand* object = UseRegister(instr->object()); 2793 LOperand* object = UseRegister(instr->object());
2812 LOperand* index = UseTempRegister(instr->index()); 2794 LOperand* index = UseTempRegister(instr->index());
2813 return DefineSameAsFirst(new(zone()) LLoadFieldByIndex(object, index)); 2795 return DefineSameAsFirst(new(zone()) LLoadFieldByIndex(object, index));
2814 } 2796 }
2815 2797
2816 2798
2817 } } // namespace v8::internal 2799 } } // namespace v8::internal
2818 2800
2819 #endif // V8_TARGET_ARCH_IA32 2801 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/ia32/lithium-codegen-ia32.cc ('k') | src/lithium.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698