OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/hydrogen.h" | 5 #include "src/hydrogen.h" |
6 | 6 |
7 #include <sstream> | 7 #include <sstream> |
8 | 8 |
9 #include "src/v8.h" | 9 #include "src/v8.h" |
10 | 10 |
(...skipping 2668 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2679 val = Add<HClampToUint8>(val); | 2679 val = Add<HClampToUint8>(val); |
2680 } | 2680 } |
2681 return Add<HStoreKeyed>(elements, checked_key, val, elements_kind, | 2681 return Add<HStoreKeyed>(elements, checked_key, val, elements_kind, |
2682 STORE_TO_INITIALIZED_ENTRY); | 2682 STORE_TO_INITIALIZED_ENTRY); |
2683 } | 2683 } |
2684 | 2684 |
2685 DCHECK(access_type == LOAD); | 2685 DCHECK(access_type == LOAD); |
2686 DCHECK(val == NULL); | 2686 DCHECK(val == NULL); |
2687 HLoadKeyed* load = Add<HLoadKeyed>( | 2687 HLoadKeyed* load = Add<HLoadKeyed>( |
2688 elements, checked_key, dependency, elements_kind, load_mode); | 2688 elements, checked_key, dependency, elements_kind, load_mode); |
2689 if (FLAG_opt_safe_uint32_operations && | 2689 if (elements_kind == EXTERNAL_UINT32_ELEMENTS || |
2690 (elements_kind == EXTERNAL_UINT32_ELEMENTS || | 2690 elements_kind == UINT32_ELEMENTS) { |
2691 elements_kind == UINT32_ELEMENTS)) { | |
2692 graph()->RecordUint32Instruction(load); | 2691 graph()->RecordUint32Instruction(load); |
2693 } | 2692 } |
2694 return load; | 2693 return load; |
2695 } | 2694 } |
2696 | 2695 |
2697 | 2696 |
2698 HLoadNamedField* HGraphBuilder::AddLoadMap(HValue* object, | 2697 HLoadNamedField* HGraphBuilder::AddLoadMap(HValue* object, |
2699 HValue* dependency) { | 2698 HValue* dependency) { |
2700 return Add<HLoadNamedField>(object, dependency, HObjectAccess::ForMap()); | 2699 return Add<HLoadNamedField>(object, dependency, HObjectAccess::ForMap()); |
2701 } | 2700 } |
(...skipping 1691 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4393 Run<HMergeRemovableSimulatesPhase>(); | 4392 Run<HMergeRemovableSimulatesPhase>(); |
4394 | 4393 |
4395 Run<HMarkDeoptimizeOnUndefinedPhase>(); | 4394 Run<HMarkDeoptimizeOnUndefinedPhase>(); |
4396 Run<HRepresentationChangesPhase>(); | 4395 Run<HRepresentationChangesPhase>(); |
4397 | 4396 |
4398 Run<HInferTypesPhase>(); | 4397 Run<HInferTypesPhase>(); |
4399 | 4398 |
4400 // Must be performed before canonicalization to ensure that Canonicalize | 4399 // Must be performed before canonicalization to ensure that Canonicalize |
4401 // will not remove semantically meaningful ToInt32 operations e.g. BIT_OR with | 4400 // will not remove semantically meaningful ToInt32 operations e.g. BIT_OR with |
4402 // zero. | 4401 // zero. |
4403 if (FLAG_opt_safe_uint32_operations) Run<HUint32AnalysisPhase>(); | 4402 Run<HUint32AnalysisPhase>(); |
4404 | 4403 |
4405 if (FLAG_use_canonicalizing) Run<HCanonicalizePhase>(); | 4404 if (FLAG_use_canonicalizing) Run<HCanonicalizePhase>(); |
4406 | 4405 |
4407 if (FLAG_use_gvn) Run<HGlobalValueNumberingPhase>(); | 4406 if (FLAG_use_gvn) Run<HGlobalValueNumberingPhase>(); |
4408 | 4407 |
4409 if (FLAG_check_elimination) Run<HCheckEliminationPhase>(); | 4408 if (FLAG_check_elimination) Run<HCheckEliminationPhase>(); |
4410 | 4409 |
4411 if (FLAG_store_elimination) Run<HStoreEliminationPhase>(); | 4410 if (FLAG_store_elimination) Run<HStoreEliminationPhase>(); |
4412 | 4411 |
4413 Run<HRangeAnalysisPhase>(); | 4412 Run<HRangeAnalysisPhase>(); |
(...skipping 6035 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10449 } else { | 10448 } else { |
10450 instr = AddUncasted<HBitwise>(op, left, right); | 10449 instr = AddUncasted<HBitwise>(op, left, right); |
10451 } | 10450 } |
10452 break; | 10451 break; |
10453 } | 10452 } |
10454 case Token::SAR: | 10453 case Token::SAR: |
10455 instr = AddUncasted<HSar>(left, right); | 10454 instr = AddUncasted<HSar>(left, right); |
10456 break; | 10455 break; |
10457 case Token::SHR: | 10456 case Token::SHR: |
10458 instr = AddUncasted<HShr>(left, right); | 10457 instr = AddUncasted<HShr>(left, right); |
10459 if (FLAG_opt_safe_uint32_operations && instr->IsShr() && | 10458 if (instr->IsShr() && CanBeZero(right)) { |
10460 CanBeZero(right)) { | |
10461 graph()->RecordUint32Instruction(instr); | 10459 graph()->RecordUint32Instruction(instr); |
10462 } | 10460 } |
10463 break; | 10461 break; |
10464 case Token::SHL: | 10462 case Token::SHL: |
10465 instr = AddUncasted<HShl>(left, right); | 10463 instr = AddUncasted<HShl>(left, right); |
10466 break; | 10464 break; |
10467 default: | 10465 default: |
10468 UNREACHABLE(); | 10466 UNREACHABLE(); |
10469 } | 10467 } |
10470 } | 10468 } |
(...skipping 2064 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
12535 if (ShouldProduceTraceOutput()) { | 12533 if (ShouldProduceTraceOutput()) { |
12536 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); | 12534 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); |
12537 } | 12535 } |
12538 | 12536 |
12539 #ifdef DEBUG | 12537 #ifdef DEBUG |
12540 graph_->Verify(false); // No full verify. | 12538 graph_->Verify(false); // No full verify. |
12541 #endif | 12539 #endif |
12542 } | 12540 } |
12543 | 12541 |
12544 } } // namespace v8::internal | 12542 } } // namespace v8::internal |
OLD | NEW |