OLD | NEW |
1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 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/interface-descriptors.h" | 5 #include "src/interface-descriptors.h" |
6 #include "src/isolate.h" | 6 #include "src/isolate.h" |
7 #include "test/cctest/compiler/function-tester.h" | 7 #include "test/cctest/compiler/function-tester.h" |
8 | 8 |
9 namespace v8 { | 9 namespace v8 { |
10 namespace internal { | 10 namespace internal { |
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
239 DCHECK_EQ(temp, var1.value()); | 239 DCHECK_EQ(temp, var1.value()); |
240 m.Return(temp); | 240 m.Return(temp); |
241 } | 241 } |
242 | 242 |
243 TEST(FixedArrayAccessSmiIndex) { | 243 TEST(FixedArrayAccessSmiIndex) { |
244 Isolate* isolate(CcTest::InitIsolateOnce()); | 244 Isolate* isolate(CcTest::InitIsolateOnce()); |
245 VoidDescriptor descriptor(isolate); | 245 VoidDescriptor descriptor(isolate); |
246 CodeStubAssemblerTester m(isolate, descriptor); | 246 CodeStubAssemblerTester m(isolate, descriptor); |
247 Handle<FixedArray> array = isolate->factory()->NewFixedArray(5); | 247 Handle<FixedArray> array = isolate->factory()->NewFixedArray(5); |
248 array->set(4, Smi::FromInt(733)); | 248 array->set(4, Smi::FromInt(733)); |
249 m.Return(m.LoadFixedArrayElementSmiIndex(m.HeapConstant(array), | 249 m.Return(m.LoadFixedArrayElement(m.HeapConstant(array), |
250 m.SmiTag(m.Int32Constant(4)))); | 250 m.SmiTag(m.Int32Constant(4)), 0, |
| 251 CodeStubAssembler::SMI_PARAMETERS)); |
251 Handle<Code> code = m.GenerateCode(); | 252 Handle<Code> code = m.GenerateCode(); |
252 FunctionTester ft(descriptor, code); | 253 FunctionTester ft(descriptor, code); |
253 MaybeHandle<Object> result = ft.Call(); | 254 MaybeHandle<Object> result = ft.Call(); |
254 CHECK_EQ(733, Handle<Smi>::cast(result.ToHandleChecked())->value()); | 255 CHECK_EQ(733, Handle<Smi>::cast(result.ToHandleChecked())->value()); |
255 } | 256 } |
256 | 257 |
257 TEST(LoadHeapNumberValue) { | 258 TEST(LoadHeapNumberValue) { |
258 Isolate* isolate(CcTest::InitIsolateOnce()); | 259 Isolate* isolate(CcTest::InitIsolateOnce()); |
259 VoidDescriptor descriptor(isolate); | 260 VoidDescriptor descriptor(isolate); |
260 CodeStubAssemblerTester m(isolate, descriptor); | 261 CodeStubAssemblerTester m(isolate, descriptor); |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
357 m.Goto(&l2); | 358 m.Goto(&l2); |
358 m.Bind(&l2); | 359 m.Bind(&l2); |
359 m.Goto(&default_label); | 360 m.Goto(&default_label); |
360 m.Bind(&default_label); | 361 m.Bind(&default_label); |
361 USE(m.GenerateCode()); | 362 USE(m.GenerateCode()); |
362 } | 363 } |
363 | 364 |
364 } // namespace compiler | 365 } // namespace compiler |
365 } // namespace internal | 366 } // namespace internal |
366 } // namespace v8 | 367 } // namespace v8 |
OLD | NEW |