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

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

Issue 157543002: A64: Synchronize with r18581. (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/a64
Patch Set: Created 6 years, 10 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-x64.h ('k') | src/x64/macro-assembler-x64.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 918 matching lines...) Expand 10 before | Expand all | Expand 10 after
929 } 929 }
930 if (FLAG_stress_environments && !instr->HasEnvironment()) { 930 if (FLAG_stress_environments && !instr->HasEnvironment()) {
931 instr = AssignEnvironment(instr); 931 instr = AssignEnvironment(instr);
932 } 932 }
933 chunk_->AddInstruction(instr, current_block_); 933 chunk_->AddInstruction(instr, current_block_);
934 } 934 }
935 current_instruction_ = old_current; 935 current_instruction_ = old_current;
936 } 936 }
937 937
938 938
939 LEnvironment* LChunkBuilder::CreateEnvironment(
940 HEnvironment* hydrogen_env,
941 int* argument_index_accumulator,
942 ZoneList<HValue*>* objects_to_materialize) {
943 if (hydrogen_env == NULL) return NULL;
944
945 LEnvironment* outer = CreateEnvironment(hydrogen_env->outer(),
946 argument_index_accumulator,
947 objects_to_materialize);
948 BailoutId ast_id = hydrogen_env->ast_id();
949 ASSERT(!ast_id.IsNone() ||
950 hydrogen_env->frame_type() != JS_FUNCTION);
951 int value_count = hydrogen_env->length() - hydrogen_env->specials_count();
952 LEnvironment* result = new(zone()) LEnvironment(
953 hydrogen_env->closure(),
954 hydrogen_env->frame_type(),
955 ast_id,
956 hydrogen_env->parameter_count(),
957 argument_count_,
958 value_count,
959 outer,
960 hydrogen_env->entry(),
961 zone());
962 int argument_index = *argument_index_accumulator;
963 int object_index = objects_to_materialize->length();
964 for (int i = 0; i < hydrogen_env->length(); ++i) {
965 if (hydrogen_env->is_special_index(i)) continue;
966
967 LOperand* op;
968 HValue* value = hydrogen_env->values()->at(i);
969 if (value->IsArgumentsObject() || value->IsCapturedObject()) {
970 objects_to_materialize->Add(value, zone());
971 op = LEnvironment::materialization_marker();
972 } else if (value->IsPushArgument()) {
973 op = new(zone()) LArgument(argument_index++);
974 } else {
975 op = UseAny(value);
976 }
977 result->AddValue(op,
978 value->representation(),
979 value->CheckFlag(HInstruction::kUint32));
980 }
981
982 for (int i = object_index; i < objects_to_materialize->length(); ++i) {
983 HValue* object_to_materialize = objects_to_materialize->at(i);
984 int previously_materialized_object = -1;
985 for (int prev = 0; prev < i; ++prev) {
986 if (objects_to_materialize->at(prev) == objects_to_materialize->at(i)) {
987 previously_materialized_object = prev;
988 break;
989 }
990 }
991 int length = object_to_materialize->OperandCount();
992 bool is_arguments = object_to_materialize->IsArgumentsObject();
993 if (previously_materialized_object >= 0) {
994 result->AddDuplicateObject(previously_materialized_object);
995 continue;
996 } else {
997 result->AddNewObject(is_arguments ? length - 1 : length, is_arguments);
998 }
999 for (int i = is_arguments ? 1 : 0; i < length; ++i) {
1000 LOperand* op;
1001 HValue* value = object_to_materialize->OperandAt(i);
1002 if (value->IsArgumentsObject() || value->IsCapturedObject()) {
1003 objects_to_materialize->Add(value, zone());
1004 op = LEnvironment::materialization_marker();
1005 } else {
1006 ASSERT(!value->IsPushArgument());
1007 op = UseAny(value);
1008 }
1009 result->AddValue(op,
1010 value->representation(),
1011 value->CheckFlag(HInstruction::kUint32));
1012 }
1013 }
1014
1015 if (hydrogen_env->frame_type() == JS_FUNCTION) {
1016 *argument_index_accumulator = argument_index;
1017 }
1018
1019 return result;
1020 }
1021
1022
1023 LInstruction* LChunkBuilder::DoGoto(HGoto* instr) { 939 LInstruction* LChunkBuilder::DoGoto(HGoto* instr) {
1024 return new(zone()) LGoto(instr->FirstSuccessor()); 940 return new(zone()) LGoto(instr->FirstSuccessor());
1025 } 941 }
1026 942
1027 943
1028 LInstruction* LChunkBuilder::DoDebugBreak(HDebugBreak* instr) { 944 LInstruction* LChunkBuilder::DoDebugBreak(HDebugBreak* instr) {
1029 return new(zone()) LDebugBreak(); 945 return new(zone()) LDebugBreak();
1030 } 946 }
1031 947
1032 948
(...skipping 1512 matching lines...) Expand 10 before | Expand all | Expand 10 after
2545 } 2461 }
2546 2462
2547 2463
2548 LInstruction* LChunkBuilder::DoEnterInlined(HEnterInlined* instr) { 2464 LInstruction* LChunkBuilder::DoEnterInlined(HEnterInlined* instr) {
2549 HEnvironment* outer = current_block_->last_environment(); 2465 HEnvironment* outer = current_block_->last_environment();
2550 HConstant* undefined = graph()->GetConstantUndefined(); 2466 HConstant* undefined = graph()->GetConstantUndefined();
2551 HEnvironment* inner = outer->CopyForInlining(instr->closure(), 2467 HEnvironment* inner = outer->CopyForInlining(instr->closure(),
2552 instr->arguments_count(), 2468 instr->arguments_count(),
2553 instr->function(), 2469 instr->function(),
2554 undefined, 2470 undefined,
2555 instr->inlining_kind(), 2471 instr->inlining_kind());
2556 instr->undefined_receiver());
2557 // Only replay binding of arguments object if it wasn't removed from graph. 2472 // Only replay binding of arguments object if it wasn't removed from graph.
2558 if (instr->arguments_var() != NULL && instr->arguments_object()->IsLinked()) { 2473 if (instr->arguments_var() != NULL && instr->arguments_object()->IsLinked()) {
2559 inner->Bind(instr->arguments_var(), instr->arguments_object()); 2474 inner->Bind(instr->arguments_var(), instr->arguments_object());
2560 } 2475 }
2561 inner->set_entry(instr); 2476 inner->set_entry(instr);
2562 current_block_->UpdateEnvironment(inner); 2477 current_block_->UpdateEnvironment(inner);
2563 chunk_->AddInlinedClosure(instr->closure()); 2478 chunk_->AddInlinedClosure(instr->closure());
2564 return NULL; 2479 return NULL;
2565 } 2480 }
2566 2481
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
2609 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { 2524 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) {
2610 LOperand* object = UseRegister(instr->object()); 2525 LOperand* object = UseRegister(instr->object());
2611 LOperand* index = UseTempRegister(instr->index()); 2526 LOperand* index = UseTempRegister(instr->index());
2612 return DefineSameAsFirst(new(zone()) LLoadFieldByIndex(object, index)); 2527 return DefineSameAsFirst(new(zone()) LLoadFieldByIndex(object, index));
2613 } 2528 }
2614 2529
2615 2530
2616 } } // namespace v8::internal 2531 } } // namespace v8::internal
2617 2532
2618 #endif // V8_TARGET_ARCH_X64 2533 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/x64/lithium-x64.h ('k') | src/x64/macro-assembler-x64.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698