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

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

Issue 141363005: A64: Synchronize with r15204. (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/a64
Patch Set: Created 6 years, 11 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-ia32.h ('k') | src/ia32/macro-assembler-ia32.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(); 993 int value_count = hydrogen_env->length() - hydrogen_env->specials_count();
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;
1004 int argument_index = *argument_index_accumulator; 1005 int argument_index = *argument_index_accumulator;
1005 for (int i = 0; i < value_count; ++i) { 1006 for (int i = 0; i < hydrogen_env->length(); ++i) {
1006 if (hydrogen_env->is_special_index(i)) continue; 1007 if (hydrogen_env->is_special_index(i)) continue;
1007 1008
1008 HValue* value = hydrogen_env->values()->at(i); 1009 HValue* value = hydrogen_env->values()->at(i);
1009 LOperand* op = NULL; 1010 LOperand* op = NULL;
1010 if (value->IsArgumentsObject()) { 1011 if (value->IsArgumentsObject()) {
1012 needs_arguments_object_materialization = true;
1011 op = NULL; 1013 op = NULL;
1012 } else if (value->IsPushArgument()) { 1014 } else if (value->IsPushArgument()) {
1013 op = new(zone()) LArgument(argument_index++); 1015 op = new(zone()) LArgument(argument_index++);
1014 } else { 1016 } else {
1015 op = UseAny(value); 1017 op = UseAny(value);
1016 } 1018 }
1017 result->AddValue(op, 1019 result->AddValue(op,
1018 value->representation(), 1020 value->representation(),
1019 value->CheckFlag(HInstruction::kUint32)); 1021 value->CheckFlag(HInstruction::kUint32));
1020 } 1022 }
1021 1023
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 LOperand* op = UseAny(value);
1033 result->AddValue(op,
1034 value->representation(),
1035 value->CheckFlag(HInstruction::kUint32));
1036 }
1037 }
1038
1022 if (hydrogen_env->frame_type() == JS_FUNCTION) { 1039 if (hydrogen_env->frame_type() == JS_FUNCTION) {
1023 *argument_index_accumulator = argument_index; 1040 *argument_index_accumulator = argument_index;
1024 } 1041 }
1025 1042
1026 return result; 1043 return result;
1027 } 1044 }
1028 1045
1029 1046
1030 LInstruction* LChunkBuilder::DoGoto(HGoto* instr) { 1047 LInstruction* LChunkBuilder::DoGoto(HGoto* instr) {
1031 return new(zone()) LGoto(instr->FirstSuccessor()->block_id()); 1048 return new(zone()) LGoto(instr->FirstSuccessor()->block_id());
(...skipping 414 matching lines...) Expand 10 before | Expand all | Expand 10 after
1446 LOperand* divisor = UseRegister(instr->right()); 1463 LOperand* divisor = UseRegister(instr->right());
1447 LDivI* result = new(zone()) LDivI(dividend, divisor, temp); 1464 LDivI* result = new(zone()) LDivI(dividend, divisor, temp);
1448 return AssignEnvironment(DefineFixed(result, eax)); 1465 return AssignEnvironment(DefineFixed(result, eax));
1449 } else { 1466 } else {
1450 ASSERT(instr->representation().IsSmiOrTagged()); 1467 ASSERT(instr->representation().IsSmiOrTagged());
1451 return DoArithmeticT(Token::DIV, instr); 1468 return DoArithmeticT(Token::DIV, instr);
1452 } 1469 }
1453 } 1470 }
1454 1471
1455 1472
1456 HValue* LChunkBuilder::SimplifiedDividendForMathFloorOfDiv(HValue* dividend) {
1457 // A value with an integer representation does not need to be transformed.
1458 if (dividend->representation().IsInteger32()) {
1459 return dividend;
1460 // A change from an integer32 can be replaced by the integer32 value.
1461 } else if (dividend->IsChange() &&
1462 HChange::cast(dividend)->from().IsInteger32()) {
1463 return HChange::cast(dividend)->value();
1464 }
1465 return NULL;
1466 }
1467
1468
1469 HValue* LChunkBuilder::SimplifiedDivisorForMathFloorOfDiv(HValue* divisor) { 1473 HValue* LChunkBuilder::SimplifiedDivisorForMathFloorOfDiv(HValue* divisor) {
1470 if (divisor->IsConstant() && 1474 if (divisor->IsConstant() &&
1471 HConstant::cast(divisor)->HasInteger32Value()) { 1475 HConstant::cast(divisor)->HasInteger32Value()) {
1472 HConstant* constant_val = HConstant::cast(divisor); 1476 HConstant* constant_val = HConstant::cast(divisor);
1473 return constant_val->CopyToRepresentation(Representation::Integer32(), 1477 return constant_val->CopyToRepresentation(Representation::Integer32(),
1474 divisor->block()->zone()); 1478 divisor->block()->zone());
1475 } 1479 }
1476 // A value with an integer representation does not need to be transformed. 1480 // A value with an integer representation does not need to be transformed.
1477 if (divisor->representation().IsInteger32()) { 1481 if (divisor->representation().IsInteger32()) {
1478 return divisor; 1482 return divisor;
(...skipping 1244 matching lines...) Expand 10 before | Expand all | Expand 10 after
2723 2727
2724 LInstruction* LChunkBuilder::DoEnterInlined(HEnterInlined* instr) { 2728 LInstruction* LChunkBuilder::DoEnterInlined(HEnterInlined* instr) {
2725 HEnvironment* outer = current_block_->last_environment(); 2729 HEnvironment* outer = current_block_->last_environment();
2726 HConstant* undefined = graph()->GetConstantUndefined(); 2730 HConstant* undefined = graph()->GetConstantUndefined();
2727 HEnvironment* inner = outer->CopyForInlining(instr->closure(), 2731 HEnvironment* inner = outer->CopyForInlining(instr->closure(),
2728 instr->arguments_count(), 2732 instr->arguments_count(),
2729 instr->function(), 2733 instr->function(),
2730 undefined, 2734 undefined,
2731 instr->inlining_kind(), 2735 instr->inlining_kind(),
2732 instr->undefined_receiver()); 2736 instr->undefined_receiver());
2733 if (instr->arguments_var() != NULL) { 2737 // Only replay binding of arguments object if it wasn't removed from graph.
2734 inner->Bind(instr->arguments_var(), graph()->GetArgumentsObject()); 2738 if (instr->arguments_var() != NULL && instr->arguments_object()->IsLinked()) {
2739 inner->Bind(instr->arguments_var(), instr->arguments_object());
2735 } 2740 }
2736 inner->set_entry(instr); 2741 inner->set_entry(instr);
2737 current_block_->UpdateEnvironment(inner); 2742 current_block_->UpdateEnvironment(inner);
2738 chunk_->AddInlinedClosure(instr->closure()); 2743 chunk_->AddInlinedClosure(instr->closure());
2739 return NULL; 2744 return NULL;
2740 } 2745 }
2741 2746
2742 2747
2743 LInstruction* LChunkBuilder::DoLeaveInlined(HLeaveInlined* instr) { 2748 LInstruction* LChunkBuilder::DoLeaveInlined(HLeaveInlined* instr) {
2744 LInstruction* pop = NULL; 2749 LInstruction* pop = NULL;
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
2792 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { 2797 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) {
2793 LOperand* object = UseRegister(instr->object()); 2798 LOperand* object = UseRegister(instr->object());
2794 LOperand* index = UseTempRegister(instr->index()); 2799 LOperand* index = UseTempRegister(instr->index());
2795 return DefineSameAsFirst(new(zone()) LLoadFieldByIndex(object, index)); 2800 return DefineSameAsFirst(new(zone()) LLoadFieldByIndex(object, index));
2796 } 2801 }
2797 2802
2798 2803
2799 } } // namespace v8::internal 2804 } } // namespace v8::internal
2800 2805
2801 #endif // V8_TARGET_ARCH_IA32 2806 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/ia32/lithium-ia32.h ('k') | src/ia32/macro-assembler-ia32.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698