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

Side by Side Diff: test/unittests/compiler/js-typed-lowering-unittest.cc

Issue 641343005: Share code between Factory::NewJSTypedArray and API (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 2 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 | Annotate | Revision Log
« no previous file with comments | « src/factory.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "src/compiler/access-builder.h" 5 #include "src/compiler/access-builder.h"
6 #include "src/compiler/js-graph.h" 6 #include "src/compiler/js-graph.h"
7 #include "src/compiler/js-operator.h" 7 #include "src/compiler/js-operator.h"
8 #include "src/compiler/js-typed-lowering.h" 8 #include "src/compiler/js-typed-lowering.h"
9 #include "src/compiler/machine-operator.h" 9 #include "src/compiler/machine-operator.h"
10 #include "src/compiler/node-properties-inl.h" 10 #include "src/compiler/node-properties-inl.h"
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 74
75 TEST_F(JSTypedLoweringTest, JSLoadPropertyFromExternalTypedArray) { 75 TEST_F(JSTypedLoweringTest, JSLoadPropertyFromExternalTypedArray) {
76 const size_t kLength = 17; 76 const size_t kLength = 17;
77 uint8_t backing_store[kLength * 8]; 77 uint8_t backing_store[kLength * 8];
78 Handle<JSArrayBuffer> buffer = 78 Handle<JSArrayBuffer> buffer =
79 NewArrayBuffer(backing_store, arraysize(backing_store)); 79 NewArrayBuffer(backing_store, arraysize(backing_store));
80 VectorSlotPair feedback(Handle<TypeFeedbackVector>::null(), 80 VectorSlotPair feedback(Handle<TypeFeedbackVector>::null(),
81 FeedbackVectorSlot::Invalid()); 81 FeedbackVectorSlot::Invalid());
82 TRACED_FOREACH(ExternalArrayType, type, kExternalArrayTypes) { 82 TRACED_FOREACH(ExternalArrayType, type, kExternalArrayTypes) {
83 Handle<JSTypedArray> array = 83 Handle<JSTypedArray> array =
84 factory()->NewJSTypedArray(type, buffer, kLength); 84 factory()->NewJSTypedArray(type, buffer, 0, kLength);
85 85
86 Node* key = Parameter(Type::Integral32()); 86 Node* key = Parameter(Type::Integral32());
87 Node* base = HeapConstant(array); 87 Node* base = HeapConstant(array);
88 Node* context = UndefinedConstant(); 88 Node* context = UndefinedConstant();
89 Node* effect = graph()->start(); 89 Node* effect = graph()->start();
90 Node* control = graph()->start(); 90 Node* control = graph()->start();
91 Node* node = graph()->NewNode(javascript()->LoadProperty(feedback), base, 91 Node* node = graph()->NewNode(javascript()->LoadProperty(feedback), base,
92 key, context); 92 key, context);
93 if (FLAG_turbo_deoptimization) { 93 if (FLAG_turbo_deoptimization) {
94 node->AppendInput(zone(), UndefinedConstant()); 94 node->AppendInput(zone(), UndefinedConstant());
(...skipping 18 matching lines...) Expand all
113 113
114 114
115 TEST_F(JSTypedLoweringTest, JSStorePropertyToExternalTypedArray) { 115 TEST_F(JSTypedLoweringTest, JSStorePropertyToExternalTypedArray) {
116 const size_t kLength = 17; 116 const size_t kLength = 17;
117 uint8_t backing_store[kLength * 8]; 117 uint8_t backing_store[kLength * 8];
118 Handle<JSArrayBuffer> buffer = 118 Handle<JSArrayBuffer> buffer =
119 NewArrayBuffer(backing_store, arraysize(backing_store)); 119 NewArrayBuffer(backing_store, arraysize(backing_store));
120 TRACED_FOREACH(ExternalArrayType, type, kExternalArrayTypes) { 120 TRACED_FOREACH(ExternalArrayType, type, kExternalArrayTypes) {
121 TRACED_FOREACH(StrictMode, strict_mode, kStrictModes) { 121 TRACED_FOREACH(StrictMode, strict_mode, kStrictModes) {
122 Handle<JSTypedArray> array = 122 Handle<JSTypedArray> array =
123 factory()->NewJSTypedArray(type, buffer, kLength); 123 factory()->NewJSTypedArray(type, buffer, 0, kLength);
124 124
125 Node* key = Parameter(Type::Integral32()); 125 Node* key = Parameter(Type::Integral32());
126 Node* base = HeapConstant(array); 126 Node* base = HeapConstant(array);
127 Node* value = Parameter(Type::Any()); 127 Node* value = Parameter(Type::Any());
128 Node* context = UndefinedConstant(); 128 Node* context = UndefinedConstant();
129 Node* effect = graph()->start(); 129 Node* effect = graph()->start();
130 Node* control = graph()->start(); 130 Node* control = graph()->start();
131 Node* node = graph()->NewNode(javascript()->StoreProperty(strict_mode), 131 Node* node = graph()->NewNode(javascript()->StoreProperty(strict_mode),
132 base, key, value, context); 132 base, key, value, context);
133 if (FLAG_turbo_deoptimization) { 133 if (FLAG_turbo_deoptimization) {
(...skipping 10 matching lines...) Expand all
144 IsIntPtrConstant(bit_cast<intptr_t>(&backing_store[0])), 144 IsIntPtrConstant(bit_cast<intptr_t>(&backing_store[0])),
145 key, IsInt32Constant(static_cast<int>(kLength)), value, 145 key, IsInt32Constant(static_cast<int>(kLength)), value,
146 effect, control)); 146 effect, control));
147 } 147 }
148 } 148 }
149 } 149 }
150 150
151 } // namespace compiler 151 } // namespace compiler
152 } // namespace internal 152 } // namespace internal
153 } // namespace v8 153 } // namespace v8
OLDNEW
« no previous file with comments | « src/factory.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698