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

Side by Side Diff: src/x64/lithium-x64.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/x64/lithium-codegen-x64.cc ('k') | test/mjsunit/compiler/inline-arguments.js » ('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 919 matching lines...) Expand 10 before | Expand all | Expand 10 after
930 LEnvironment* LChunkBuilder::CreateEnvironment( 930 LEnvironment* LChunkBuilder::CreateEnvironment(
931 HEnvironment* hydrogen_env, 931 HEnvironment* hydrogen_env,
932 int* argument_index_accumulator) { 932 int* argument_index_accumulator) {
933 if (hydrogen_env == NULL) return NULL; 933 if (hydrogen_env == NULL) return NULL;
934 934
935 LEnvironment* outer = 935 LEnvironment* outer =
936 CreateEnvironment(hydrogen_env->outer(), argument_index_accumulator); 936 CreateEnvironment(hydrogen_env->outer(), argument_index_accumulator);
937 BailoutId ast_id = hydrogen_env->ast_id(); 937 BailoutId ast_id = hydrogen_env->ast_id();
938 ASSERT(!ast_id.IsNone() || 938 ASSERT(!ast_id.IsNone() ||
939 hydrogen_env->frame_type() != JS_FUNCTION); 939 hydrogen_env->frame_type() != JS_FUNCTION);
940 int value_count = hydrogen_env->length() - hydrogen_env->specials_count(); 940 int value_count = hydrogen_env->length();
941 LEnvironment* result = new(zone()) LEnvironment( 941 LEnvironment* result = new(zone()) LEnvironment(
942 hydrogen_env->closure(), 942 hydrogen_env->closure(),
943 hydrogen_env->frame_type(), 943 hydrogen_env->frame_type(),
944 ast_id, 944 ast_id,
945 hydrogen_env->parameter_count(), 945 hydrogen_env->parameter_count(),
946 argument_count_, 946 argument_count_,
947 value_count, 947 value_count,
948 outer, 948 outer,
949 hydrogen_env->entry(), 949 hydrogen_env->entry(),
950 zone()); 950 zone());
951 bool needs_arguments_object_materialization = false;
952 int argument_index = *argument_index_accumulator; 951 int argument_index = *argument_index_accumulator;
953 for (int i = 0; i < hydrogen_env->length(); ++i) { 952 for (int i = 0; i < value_count; ++i) {
954 if (hydrogen_env->is_special_index(i)) continue; 953 if (hydrogen_env->is_special_index(i)) continue;
955 954
956 HValue* value = hydrogen_env->values()->at(i); 955 HValue* value = hydrogen_env->values()->at(i);
957 LOperand* op = NULL; 956 LOperand* op = NULL;
958 if (value->IsArgumentsObject()) { 957 if (value->IsArgumentsObject()) {
959 needs_arguments_object_materialization = true;
960 op = NULL; 958 op = NULL;
961 } else if (value->IsPushArgument()) { 959 } else if (value->IsPushArgument()) {
962 op = new(zone()) LArgument(argument_index++); 960 op = new(zone()) LArgument(argument_index++);
963 } else { 961 } else {
964 op = UseAny(value); 962 op = UseAny(value);
965 } 963 }
966 result->AddValue(op, 964 result->AddValue(op,
967 value->representation(), 965 value->representation(),
968 value->CheckFlag(HInstruction::kUint32)); 966 value->CheckFlag(HInstruction::kUint32));
969 } 967 }
970 968
971 if (needs_arguments_object_materialization) {
972 HArgumentsObject* arguments = hydrogen_env->entry() == NULL
973 ? graph()->GetArgumentsObject()
974 : hydrogen_env->entry()->arguments_object();
975 ASSERT(arguments->IsLinked());
976 for (int i = 1; i < arguments->arguments_count(); ++i) {
977 HValue* value = arguments->arguments_values()->at(i);
978 ASSERT(!value->IsArgumentsObject() && !value->IsPushArgument());
979 ASSERT(HInstruction::cast(value)->IsLinked());
980 LOperand* op = UseAny(value);
981 result->AddValue(op,
982 value->representation(),
983 value->CheckFlag(HInstruction::kUint32));
984 }
985 }
986
987 if (hydrogen_env->frame_type() == JS_FUNCTION) { 969 if (hydrogen_env->frame_type() == JS_FUNCTION) {
988 *argument_index_accumulator = argument_index; 970 *argument_index_accumulator = argument_index;
989 } 971 }
990 972
991 return result; 973 return result;
992 } 974 }
993 975
994 976
995 LInstruction* LChunkBuilder::DoGoto(HGoto* instr) { 977 LInstruction* LChunkBuilder::DoGoto(HGoto* instr) {
996 return new(zone()) LGoto(instr->FirstSuccessor()->block_id()); 978 return new(zone()) LGoto(instr->FirstSuccessor()->block_id());
(...skipping 1607 matching lines...) Expand 10 before | Expand all | Expand 10 after
2604 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { 2586 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) {
2605 LOperand* object = UseRegister(instr->object()); 2587 LOperand* object = UseRegister(instr->object());
2606 LOperand* index = UseTempRegister(instr->index()); 2588 LOperand* index = UseTempRegister(instr->index());
2607 return DefineSameAsFirst(new(zone()) LLoadFieldByIndex(object, index)); 2589 return DefineSameAsFirst(new(zone()) LLoadFieldByIndex(object, index));
2608 } 2590 }
2609 2591
2610 2592
2611 } } // namespace v8::internal 2593 } } // namespace v8::internal
2612 2594
2613 #endif // V8_TARGET_ARCH_X64 2595 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/x64/lithium-codegen-x64.cc ('k') | test/mjsunit/compiler/inline-arguments.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698