Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 #ifndef V8_COMPILER_JS_GRAPH_H_ | 5 #ifndef V8_COMPILER_JS_GRAPH_H_ |
| 6 #define V8_COMPILER_JS_GRAPH_H_ | 6 #define V8_COMPILER_JS_GRAPH_H_ |
| 7 | 7 |
| 8 #include "src/compiler/common-node-cache.h" | 8 #include "src/compiler/common-node-cache.h" |
| 9 #include "src/compiler/common-operator.h" | 9 #include "src/compiler/common-operator.h" |
| 10 #include "src/compiler/graph.h" | 10 #include "src/compiler/graph.h" |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 66 Node* Float64Constant(double value); | 66 Node* Float64Constant(double value); |
| 67 | 67 |
| 68 // Creates an ExternalConstant node, usually canonicalized. | 68 // Creates an ExternalConstant node, usually canonicalized. |
| 69 Node* ExternalConstant(ExternalReference ref); | 69 Node* ExternalConstant(ExternalReference ref); |
| 70 | 70 |
| 71 Node* SmiConstant(int32_t immediate) { | 71 Node* SmiConstant(int32_t immediate) { |
| 72 DCHECK(Smi::IsValid(immediate)); | 72 DCHECK(Smi::IsValid(immediate)); |
| 73 return Constant(immediate); | 73 return Constant(immediate); |
| 74 } | 74 } |
| 75 | 75 |
| 76 Node* LoadObjectField(Node* object, int offset, Node* context, Node* effect, | |
| 77 MachineType type = kMachAnyTagged) { | |
|
titzer
2014/08/20 12:54:38
This doesn't seem like the right place for this me
sigurds
2014/08/22 14:01:33
Done.
| |
| 78 // TODO(sigurds) Use simplified load here once it is ready. | |
| 79 MachineOperatorBuilder machine(zone()); | |
| 80 Node* field_load = graph()->NewNode(machine.Load(type), object, | |
| 81 Int32Constant(offset - kHeapObjectTag), | |
| 82 context, effect); | |
| 83 return field_load; | |
| 84 } | |
| 85 | |
| 76 JSOperatorBuilder* javascript() { return &javascript_; } | 86 JSOperatorBuilder* javascript() { return &javascript_; } |
| 77 CommonOperatorBuilder* common() { return common_; } | 87 CommonOperatorBuilder* common() { return common_; } |
| 78 Graph* graph() { return graph_; } | 88 Graph* graph() { return graph_; } |
| 79 Zone* zone() { return graph()->zone(); } | 89 Zone* zone() { return graph()->zone(); } |
| 80 Isolate* isolate() { return zone()->isolate(); } | 90 Isolate* isolate() { return zone()->isolate(); } |
| 81 | 91 |
| 82 private: | 92 private: |
| 83 Graph* graph_; | 93 Graph* graph_; |
| 84 CommonOperatorBuilder* common_; | 94 CommonOperatorBuilder* common_; |
| 85 JSOperatorBuilder javascript_; | 95 JSOperatorBuilder javascript_; |
| (...skipping 15 matching lines...) Expand all Loading... | |
| 101 Node* NumberConstant(double value); | 111 Node* NumberConstant(double value); |
| 102 Node* NewNode(Operator* op); | 112 Node* NewNode(Operator* op); |
| 103 | 113 |
| 104 Factory* factory() { return isolate()->factory(); } | 114 Factory* factory() { return isolate()->factory(); } |
| 105 }; | 115 }; |
| 106 } // namespace compiler | 116 } // namespace compiler |
| 107 } // namespace internal | 117 } // namespace internal |
| 108 } // namespace v8 | 118 } // namespace v8 |
| 109 | 119 |
| 110 #endif | 120 #endif |
| OLD | NEW |