| 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 505 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 516 !(block()->IsReachable() || | 516 !(block()->IsReachable() || |
| 517 IsBlockEntry() || | 517 IsBlockEntry() || |
| 518 IsControlInstruction() || | 518 IsControlInstruction() || |
| 519 IsSimulate() || | 519 IsSimulate() || |
| 520 IsEnterInlined() || | 520 IsEnterInlined() || |
| 521 IsLeaveInlined()); | 521 IsLeaveInlined()); |
| 522 } | 522 } |
| 523 | 523 |
| 524 | 524 |
| 525 bool HValue::IsInteger32Constant() { | 525 bool HValue::IsInteger32Constant() { |
| 526 return IsConstant() && HConstant::cast(this)->HasInteger32Value(); | 526 HValue* value_to_check = IsForceRepresentation() |
| 527 ? HForceRepresentation::cast(this)->value() |
| 528 : this; |
| 529 return value_to_check->IsConstant() && |
| 530 HConstant::cast(value_to_check)->HasInteger32Value(); |
| 527 } | 531 } |
| 528 | 532 |
| 529 | 533 |
| 530 int32_t HValue::GetInteger32Constant() { | 534 int32_t HValue::GetInteger32Constant() { |
| 531 return HConstant::cast(this)->Integer32Value(); | 535 HValue* constant_value = IsForceRepresentation() |
| 536 ? HForceRepresentation::cast(this)->value() |
| 537 : this; |
| 538 return HConstant::cast(constant_value)->Integer32Value(); |
| 532 } | 539 } |
| 533 | 540 |
| 534 | 541 |
| 535 bool HValue::EqualsInteger32Constant(int32_t value) { | 542 bool HValue::EqualsInteger32Constant(int32_t value) { |
| 536 return IsInteger32Constant() && GetInteger32Constant() == value; | 543 return IsInteger32Constant() && GetInteger32Constant() == value; |
| 537 } | 544 } |
| 538 | 545 |
| 539 | 546 |
| 540 void HValue::SetOperandAt(int index, HValue* value) { | 547 void HValue::SetOperandAt(int index, HValue* value) { |
| 541 RegisterUse(index, value); | 548 RegisterUse(index, value); |
| (...skipping 2397 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2939 return false; | 2946 return false; |
| 2940 } | 2947 } |
| 2941 | 2948 |
| 2942 | 2949 |
| 2943 void HCompareHoleAndBranch::InferRepresentation( | 2950 void HCompareHoleAndBranch::InferRepresentation( |
| 2944 HInferRepresentationPhase* h_infer) { | 2951 HInferRepresentationPhase* h_infer) { |
| 2945 ChangeRepresentation(value()->representation()); | 2952 ChangeRepresentation(value()->representation()); |
| 2946 } | 2953 } |
| 2947 | 2954 |
| 2948 | 2955 |
| 2956 bool HCompareMinusZeroAndBranch::KnownSuccessorBlock(HBasicBlock** block) { |
| 2957 if (value()->representation().IsSmiOrInteger32()) { |
| 2958 // A Smi or Integer32 cannot contain minus zero. |
| 2959 *block = SecondSuccessor(); |
| 2960 return true; |
| 2961 } |
| 2962 *block = NULL; |
| 2963 return false; |
| 2964 } |
| 2965 |
| 2966 |
| 2967 void HCompareMinusZeroAndBranch::InferRepresentation( |
| 2968 HInferRepresentationPhase* h_infer) { |
| 2969 ChangeRepresentation(value()->representation()); |
| 2970 } |
| 2971 |
| 2972 |
| 2973 |
| 2949 void HGoto::PrintDataTo(StringStream* stream) { | 2974 void HGoto::PrintDataTo(StringStream* stream) { |
| 2950 stream->Add("B%d", SuccessorAt(0)->block_id()); | 2975 stream->Add("B%d", SuccessorAt(0)->block_id()); |
| 2951 } | 2976 } |
| 2952 | 2977 |
| 2953 | 2978 |
| 2954 void HCompareNumericAndBranch::InferRepresentation( | 2979 void HCompareNumericAndBranch::InferRepresentation( |
| 2955 HInferRepresentationPhase* h_infer) { | 2980 HInferRepresentationPhase* h_infer) { |
| 2956 Representation left_rep = left()->representation(); | 2981 Representation left_rep = left()->representation(); |
| 2957 Representation right_rep = right()->representation(); | 2982 Representation right_rep = right()->representation(); |
| 2958 Representation observed_left = observed_input_representation(0); | 2983 Representation observed_left = observed_input_representation(0); |
| (...skipping 415 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3374 if (MustAllocateDoubleAligned()) { | 3399 if (MustAllocateDoubleAligned()) { |
| 3375 if (!dominator_allocate->MustAllocateDoubleAligned()) { | 3400 if (!dominator_allocate->MustAllocateDoubleAligned()) { |
| 3376 dominator_allocate->MakeDoubleAligned(); | 3401 dominator_allocate->MakeDoubleAligned(); |
| 3377 } | 3402 } |
| 3378 if ((dominator_size_constant & kDoubleAlignmentMask) != 0) { | 3403 if ((dominator_size_constant & kDoubleAlignmentMask) != 0) { |
| 3379 dominator_size_constant += kDoubleSize / 2; | 3404 dominator_size_constant += kDoubleSize / 2; |
| 3380 new_dominator_size += kDoubleSize / 2; | 3405 new_dominator_size += kDoubleSize / 2; |
| 3381 } | 3406 } |
| 3382 } | 3407 } |
| 3383 | 3408 |
| 3384 if (new_dominator_size > Page::kMaxNonCodeHeapObjectSize) { | 3409 if (new_dominator_size > isolate()->heap()->MaxRegularSpaceAllocationSize()) { |
| 3385 if (FLAG_trace_allocation_folding) { | 3410 if (FLAG_trace_allocation_folding) { |
| 3386 PrintF("#%d (%s) cannot fold into #%d (%s) due to size: %d\n", | 3411 PrintF("#%d (%s) cannot fold into #%d (%s) due to size: %d\n", |
| 3387 id(), Mnemonic(), dominator_allocate->id(), | 3412 id(), Mnemonic(), dominator_allocate->id(), |
| 3388 dominator_allocate->Mnemonic(), new_dominator_size); | 3413 dominator_allocate->Mnemonic(), new_dominator_size); |
| 3389 } | 3414 } |
| 3390 return; | 3415 return; |
| 3391 } | 3416 } |
| 3392 | 3417 |
| 3393 HInstruction* new_dominator_size_constant = HConstant::CreateAndInsertBefore( | 3418 HInstruction* new_dominator_size_constant = HConstant::CreateAndInsertBefore( |
| 3394 zone, | 3419 zone, |
| (...skipping 933 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4328 break; | 4353 break; |
| 4329 case kExternalMemory: | 4354 case kExternalMemory: |
| 4330 stream->Add("[external-memory]"); | 4355 stream->Add("[external-memory]"); |
| 4331 break; | 4356 break; |
| 4332 } | 4357 } |
| 4333 | 4358 |
| 4334 stream->Add("@%d", offset()); | 4359 stream->Add("@%d", offset()); |
| 4335 } | 4360 } |
| 4336 | 4361 |
| 4337 } } // namespace v8::internal | 4362 } } // namespace v8::internal |
| OLD | NEW |