| 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 <limits> | 5 #include <limits> |
| 6 | 6 |
| 7 #include "src/compiler/access-builder.h" | 7 #include "src/compiler/access-builder.h" |
| 8 #include "src/compiler/change-lowering.h" | 8 #include "src/compiler/change-lowering.h" |
| 9 #include "src/compiler/control-builders.h" | 9 #include "src/compiler/control-builders.h" |
| 10 #include "src/compiler/graph-reducer.h" | 10 #include "src/compiler/graph-reducer.h" |
| (...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 259 Node* load = | 259 Node* load = |
| 260 t.LoadElement(buffer_access, backing_store, t.Int32Constant(index)); | 260 t.LoadElement(buffer_access, backing_store, t.Int32Constant(index)); |
| 261 t.StoreElement(buffer_access, backing_store, t.Int32Constant(index + 1), | 261 t.StoreElement(buffer_access, backing_store, t.Int32Constant(index + 1), |
| 262 load); | 262 load); |
| 263 t.Return(t.jsgraph.TrueConstant()); | 263 t.Return(t.jsgraph.TrueConstant()); |
| 264 | 264 |
| 265 t.LowerAllNodes(); | 265 t.LowerAllNodes(); |
| 266 t.GenerateCode(); | 266 t.GenerateCode(); |
| 267 | 267 |
| 268 Handle<JSArrayBuffer> array = t.factory()->NewJSArrayBuffer(); | 268 Handle<JSArrayBuffer> array = t.factory()->NewJSArrayBuffer(); |
| 269 Runtime::SetupArrayBufferAllocatingData(t.isolate(), array, array_length); | 269 JSArrayBuffer::SetupAllocatingData(array, t.isolate(), array_length); |
| 270 uint8_t* data = reinterpret_cast<uint8_t*>(array->backing_store()); | 270 uint8_t* data = reinterpret_cast<uint8_t*>(array->backing_store()); |
| 271 for (int i = 0; i < array_length; i++) { | 271 for (int i = 0; i < array_length; i++) { |
| 272 data[i] = i; | 272 data[i] = i; |
| 273 } | 273 } |
| 274 | 274 |
| 275 // TODO(titzer): raw pointers in call | 275 // TODO(titzer): raw pointers in call |
| 276 Object* result = t.Call(*array); | 276 Object* result = t.Call(*array); |
| 277 CHECK_EQ(t.isolate()->heap()->true_value(), result); | 277 CHECK_EQ(t.isolate()->heap()->true_value(), result); |
| 278 for (int i = 0; i < array_length; i++) { | 278 for (int i = 0; i < array_length; i++) { |
| 279 uint8_t expected = i; | 279 uint8_t expected = i; |
| (...skipping 1762 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2042 Bounds phi_bounds = Bounds::Either(Bounds(d.arg1), Bounds(d.arg2), z); | 2042 Bounds phi_bounds = Bounds::Either(Bounds(d.arg1), Bounds(d.arg2), z); |
| 2043 NodeProperties::SetBounds(phi, phi_bounds); | 2043 NodeProperties::SetBounds(phi, phi_bounds); |
| 2044 | 2044 |
| 2045 Node* use = t.Use(phi, d.use); | 2045 Node* use = t.Use(phi, d.use); |
| 2046 t.Return(use); | 2046 t.Return(use); |
| 2047 t.Lower(); | 2047 t.Lower(); |
| 2048 | 2048 |
| 2049 CHECK_EQ(d.expected, OpParameter<MachineType>(phi)); | 2049 CHECK_EQ(d.expected, OpParameter<MachineType>(phi)); |
| 2050 } | 2050 } |
| 2051 } | 2051 } |
| OLD | NEW |