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

Side by Side Diff: src/compiler/bounds-check-lowering.cc

Issue 768543002: [WIP] TrapHandler 2014/11/27. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 6 years 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/compiler/bounds-check-lowering.h ('k') | src/compiler/js-typed-lowering.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 2014 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/compiler/bounds-check-lowering.h"
6
7 #include "src/compiler/js-graph.h"
8
9 namespace v8 {
10 namespace internal {
11 namespace compiler {
12
13 BoundsCheckLowering::~BoundsCheckLowering() {}
14
15
16 Reduction BoundsCheckLowering::Reduce(Node* node) {
17 if (node->opcode() != IrOpcode::kBoundsCheck) return NoChange();
18 Node* const offset = node->InputAt(0);
19 Node* const length = node->InputAt(1);
20 Node* const select = graph()->NewNode(
21 common()->Select(kMachUint32, BranchHint::kTrue),
22 graph()->NewNode(machine()->Uint32LessThan(), offset, length), offset,
23 length);
24 return Replace(select);
25 }
26
27
28 Graph* BoundsCheckLowering::graph() const { return jsgraph()->graph(); }
29
30
31 CommonOperatorBuilder* BoundsCheckLowering::common() const {
32 return jsgraph()->common();
33 }
34
35
36 MachineOperatorBuilder* BoundsCheckLowering::machine() const {
37 return jsgraph()->machine();
38 }
39
40 } // namespace compiler
41 } // namespace internal
42 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/bounds-check-lowering.h ('k') | src/compiler/js-typed-lowering.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698