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

Side by Side Diff: test/cctest/compiler/test-simplified-lowering.cc

Issue 1305383003: Move runtime helper for JSArrayBuffer onto objects. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@local_cleanup-runtime-helpers-2
Patch Set: Self-nit. Created 5 years, 3 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
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 <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
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
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 }
OLDNEW
« no previous file with comments | « src/runtime/runtime-typedarray.cc ('k') | test/unittests/compiler/js-typed-lowering-unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698