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

Side by Side Diff: src/hydrogen-mark-deoptimize.cc

Issue 1405363003: Move Hydrogen and Lithium to src/crankshaft/ (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: rebased Created 5 years, 2 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
« no previous file with comments | « src/hydrogen-mark-deoptimize.h ('k') | src/hydrogen-mark-unreachable.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "src/hydrogen-mark-deoptimize.h"
6
7 namespace v8 {
8 namespace internal {
9
10 void HMarkDeoptimizeOnUndefinedPhase::Run() {
11 const ZoneList<HPhi*>* phi_list = graph()->phi_list();
12 for (int i = 0; i < phi_list->length(); i++) {
13 HPhi* phi = phi_list->at(i);
14 if (phi->CheckFlag(HValue::kAllowUndefinedAsNaN) &&
15 !phi->CheckUsesForFlag(HValue::kAllowUndefinedAsNaN)) {
16 ProcessPhi(phi);
17 }
18 }
19 }
20
21
22 void HMarkDeoptimizeOnUndefinedPhase::ProcessPhi(HPhi* phi) {
23 DCHECK(phi->CheckFlag(HValue::kAllowUndefinedAsNaN));
24 DCHECK(worklist_.is_empty());
25
26 // Push the phi onto the worklist
27 phi->ClearFlag(HValue::kAllowUndefinedAsNaN);
28 worklist_.Add(phi, zone());
29
30 // Process all phis that can reach this phi
31 while (!worklist_.is_empty()) {
32 phi = worklist_.RemoveLast();
33 for (int i = phi->OperandCount() - 1; i >= 0; --i) {
34 HValue* input = phi->OperandAt(i);
35 if (input->IsPhi() && input->CheckFlag(HValue::kAllowUndefinedAsNaN)) {
36 input->ClearFlag(HValue::kAllowUndefinedAsNaN);
37 worklist_.Add(HPhi::cast(input), zone());
38 }
39 }
40 }
41 }
42
43
44 void HComputeChangeUndefinedToNaN::Run() {
45 const ZoneList<HBasicBlock*>* blocks(graph()->blocks());
46 for (int i = 0; i < blocks->length(); ++i) {
47 const HBasicBlock* block(blocks->at(i));
48 for (HInstruction* current = block->first(); current != NULL; ) {
49 HInstruction* next = current->next();
50 if (current->IsChange()) {
51 if (HChange::cast(current)->can_convert_undefined_to_nan()) {
52 current->SetFlag(HValue::kAllowUndefinedAsNaN);
53 }
54 }
55 current = next;
56 }
57 }
58 }
59
60
61 } // namespace internal
62 } // namespace v8
OLDNEW
« no previous file with comments | « src/hydrogen-mark-deoptimize.h ('k') | src/hydrogen-mark-unreachable.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698