| 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 #include "src/code-factory.h" | 5 #include "src/code-factory.h" |
| 6 #include "src/compiler/access-builder.h" | 6 #include "src/compiler/access-builder.h" |
| 7 #include "src/compiler/js-graph.h" | 7 #include "src/compiler/js-graph.h" |
| 8 #include "src/compiler/js-operator.h" | 8 #include "src/compiler/js-operator.h" |
| 9 #include "src/compiler/js-typed-lowering.h" | 9 #include "src/compiler/js-typed-lowering.h" |
| 10 #include "src/compiler/machine-operator.h" | 10 #include "src/compiler/machine-operator.h" |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 81 MachineOperatorBuilder machine(zone()); | 81 MachineOperatorBuilder machine(zone()); |
| 82 JSGraph jsgraph(isolate(), graph(), common(), javascript(), &machine); | 82 JSGraph jsgraph(isolate(), graph(), common(), javascript(), &machine); |
| 83 // TODO(titzer): mock the GraphReducer here for better unit testing. | 83 // TODO(titzer): mock the GraphReducer here for better unit testing. |
| 84 GraphReducer graph_reducer(zone(), graph()); | 84 GraphReducer graph_reducer(zone(), graph()); |
| 85 JSTypedLowering reducer(&graph_reducer, &jsgraph, zone()); | 85 JSTypedLowering reducer(&graph_reducer, &jsgraph, zone()); |
| 86 return reducer.Reduce(node); | 86 return reducer.Reduce(node); |
| 87 } | 87 } |
| 88 | 88 |
| 89 Handle<JSArrayBuffer> NewArrayBuffer(void* bytes, size_t byte_length) { | 89 Handle<JSArrayBuffer> NewArrayBuffer(void* bytes, size_t byte_length) { |
| 90 Handle<JSArrayBuffer> buffer = factory()->NewJSArrayBuffer(); | 90 Handle<JSArrayBuffer> buffer = factory()->NewJSArrayBuffer(); |
| 91 Runtime::SetupArrayBuffer(isolate(), buffer, true, bytes, byte_length); | 91 JSArrayBuffer::Setup(buffer, isolate(), true, bytes, byte_length); |
| 92 return buffer; | 92 return buffer; |
| 93 } | 93 } |
| 94 | 94 |
| 95 Matcher<Node*> IsIntPtrConstant(intptr_t value) { | 95 Matcher<Node*> IsIntPtrConstant(intptr_t value) { |
| 96 return sizeof(value) == 4 ? IsInt32Constant(static_cast<int32_t>(value)) | 96 return sizeof(value) == 4 ? IsInt32Constant(static_cast<int32_t>(value)) |
| 97 : IsInt64Constant(static_cast<int64_t>(value)); | 97 : IsInt64Constant(static_cast<int64_t>(value)); |
| 98 } | 98 } |
| 99 | 99 |
| 100 JSOperatorBuilder* javascript() { return &javascript_; } | 100 JSOperatorBuilder* javascript() { return &javascript_; } |
| 101 | 101 |
| (...skipping 1021 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1123 EXPECT_THAT(r.replacement(), | 1123 EXPECT_THAT(r.replacement(), |
| 1124 IsFinish(IsAllocate(IsNumberConstant(Context::SizeFor( | 1124 IsFinish(IsAllocate(IsNumberConstant(Context::SizeFor( |
| 1125 Context::MIN_CONTEXT_SLOTS)), | 1125 Context::MIN_CONTEXT_SLOTS)), |
| 1126 effect, control), | 1126 effect, control), |
| 1127 _)); | 1127 _)); |
| 1128 } | 1128 } |
| 1129 | 1129 |
| 1130 } // namespace compiler | 1130 } // namespace compiler |
| 1131 } // namespace internal | 1131 } // namespace internal |
| 1132 } // namespace v8 | 1132 } // namespace v8 |
| OLD | NEW |