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

Side by Side Diff: src/compiler/ast-graph-builder.cc

Issue 1196623002: [ubsan] Fix HeapObjectMatcher to avoid invalid casts. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: REBASE Created 5 years, 6 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 | « no previous file | src/compiler/common-operator-reducer.cc » ('j') | src/compiler/control-reducer.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 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/compiler/ast-graph-builder.h" 5 #include "src/compiler/ast-graph-builder.h"
6 6
7 #include "src/compiler.h" 7 #include "src/compiler.h"
8 #include "src/compiler/ast-loop-assignment-analyzer.h" 8 #include "src/compiler/ast-loop-assignment-analyzer.h"
9 #include "src/compiler/control-builders.h" 9 #include "src/compiler/control-builders.h"
10 #include "src/compiler/js-type-feedback.h" 10 #include "src/compiler/js-type-feedback.h"
(...skipping 3572 matching lines...) Expand 10 before | Expand all | Expand 10 after
3583 } 3583 }
3584 3584
3585 3585
3586 Node* AstGraphBuilder::BuildToBoolean(Node* input) { 3586 Node* AstGraphBuilder::BuildToBoolean(Node* input) {
3587 // TODO(bmeurer, mstarzinger): Refactor this into a separate optimization 3587 // TODO(bmeurer, mstarzinger): Refactor this into a separate optimization
3588 // method. 3588 // method.
3589 switch (input->opcode()) { 3589 switch (input->opcode()) {
3590 case IrOpcode::kNumberConstant: 3590 case IrOpcode::kNumberConstant:
3591 return jsgraph_->BooleanConstant(!NumberMatcher(input).Is(0)); 3591 return jsgraph_->BooleanConstant(!NumberMatcher(input).Is(0));
3592 case IrOpcode::kHeapConstant: { 3592 case IrOpcode::kHeapConstant: {
3593 Handle<Object> object = HeapObjectMatcher<Object>(input).Value().handle(); 3593 Handle<HeapObject> object = HeapObjectMatcher(input).Value().handle();
3594 return jsgraph_->BooleanConstant(object->BooleanValue()); 3594 return jsgraph_->BooleanConstant(object->BooleanValue());
3595 } 3595 }
3596 case IrOpcode::kJSEqual: 3596 case IrOpcode::kJSEqual:
3597 case IrOpcode::kJSNotEqual: 3597 case IrOpcode::kJSNotEqual:
3598 case IrOpcode::kJSStrictEqual: 3598 case IrOpcode::kJSStrictEqual:
3599 case IrOpcode::kJSStrictNotEqual: 3599 case IrOpcode::kJSStrictNotEqual:
3600 case IrOpcode::kJSLessThan: 3600 case IrOpcode::kJSLessThan:
3601 case IrOpcode::kJSLessThanOrEqual: 3601 case IrOpcode::kJSLessThanOrEqual:
3602 case IrOpcode::kJSGreaterThan: 3602 case IrOpcode::kJSGreaterThan:
3603 case IrOpcode::kJSGreaterThanOrEqual: 3603 case IrOpcode::kJSGreaterThanOrEqual:
(...skipping 475 matching lines...) Expand 10 before | Expand all | Expand 10 after
4079 // Phi does not exist yet, introduce one. 4079 // Phi does not exist yet, introduce one.
4080 value = NewPhi(inputs, value, control); 4080 value = NewPhi(inputs, value, control);
4081 value->ReplaceInput(inputs - 1, other); 4081 value->ReplaceInput(inputs - 1, other);
4082 } 4082 }
4083 return value; 4083 return value;
4084 } 4084 }
4085 4085
4086 } // namespace compiler 4086 } // namespace compiler
4087 } // namespace internal 4087 } // namespace internal
4088 } // namespace v8 4088 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | src/compiler/common-operator-reducer.cc » ('j') | src/compiler/control-reducer.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698