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/base/utils/random-number-generator.h" | 5 #include "src/base/utils/random-number-generator.h" |
6 #include "src/code-factory.h" | 6 #include "src/code-factory.h" |
7 #include "src/code-stub-assembler.h" | 7 #include "src/code-stub-assembler.h" |
8 #include "src/compiler/node.h" | 8 #include "src/compiler/node.h" |
9 #include "src/ic/stub-cache.h" | 9 #include "src/ic/stub-cache.h" |
10 #include "src/isolate.h" | 10 #include "src/isolate.h" |
(...skipping 1299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1310 factory->meta_map(), | 1310 factory->meta_map(), |
1311 factory->code_map(), | 1311 factory->code_map(), |
1312 Map::Create(isolate, 0), | 1312 Map::Create(isolate, 0), |
1313 factory->hash_table_map(), | 1313 factory->hash_table_map(), |
1314 factory->symbol_map(), | 1314 factory->symbol_map(), |
1315 factory->string_map(), | 1315 factory->string_map(), |
1316 Map::Create(isolate, 0), | 1316 Map::Create(isolate, 0), |
1317 factory->sloppy_arguments_elements_map(), | 1317 factory->sloppy_arguments_elements_map(), |
1318 }; | 1318 }; |
1319 | 1319 |
1320 for (int name_index = 0; name_index < arraysize(names); name_index++) { | 1320 for (size_t name_index = 0; name_index < arraysize(names); name_index++) { |
1321 Handle<Name> name = names[name_index]; | 1321 Handle<Name> name = names[name_index]; |
1322 for (int map_index = 0; map_index < arraysize(maps); map_index++) { | 1322 for (size_t map_index = 0; map_index < arraysize(maps); map_index++) { |
1323 Handle<Map> map = maps[map_index]; | 1323 Handle<Map> map = maps[map_index]; |
1324 | 1324 |
1325 int expected_result; | 1325 int expected_result; |
1326 { | 1326 { |
1327 int primary_offset = StubCache::PrimaryOffsetForTesting(*name, *map); | 1327 int primary_offset = StubCache::PrimaryOffsetForTesting(*name, *map); |
1328 if (table == StubCache::kPrimary) { | 1328 if (table == StubCache::kPrimary) { |
1329 expected_result = primary_offset; | 1329 expected_result = primary_offset; |
1330 } else { | 1330 } else { |
1331 expected_result = | 1331 expected_result = |
1332 StubCache::SecondaryOffsetForTesting(*name, primary_offset); | 1332 StubCache::SecondaryOffsetForTesting(*name, primary_offset); |
(...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1658 handle(isolate->array_function()->initial_map(), isolate), | 1658 handle(isolate->array_function()->initial_map(), isolate), |
1659 }; | 1659 }; |
1660 | 1660 |
1661 #define VERIFY(result, map_value, properties_value, elements_value) \ | 1661 #define VERIFY(result, map_value, properties_value, elements_value) \ |
1662 CHECK_EQ(result->map(), map_value); \ | 1662 CHECK_EQ(result->map(), map_value); \ |
1663 CHECK_EQ(result->properties(), properties_value); \ | 1663 CHECK_EQ(result->properties(), properties_value); \ |
1664 CHECK_EQ(result->elements(), elements_value); | 1664 CHECK_EQ(result->elements(), elements_value); |
1665 | 1665 |
1666 { | 1666 { |
1667 Handle<Object> empty_fixed_array = factory->empty_fixed_array(); | 1667 Handle<Object> empty_fixed_array = factory->empty_fixed_array(); |
1668 for (int i = 0; i < arraysize(maps); i++) { | 1668 for (size_t i = 0; i < arraysize(maps); i++) { |
1669 Handle<Map> map = maps[i]; | 1669 Handle<Map> map = maps[i]; |
1670 Handle<JSObject> result = Handle<JSObject>::cast( | 1670 Handle<JSObject> result = Handle<JSObject>::cast( |
1671 ft.Call(map, empty_fixed_array, empty_fixed_array).ToHandleChecked()); | 1671 ft.Call(map, empty_fixed_array, empty_fixed_array).ToHandleChecked()); |
1672 VERIFY(result, *map, *empty_fixed_array, *empty_fixed_array); | 1672 VERIFY(result, *map, *empty_fixed_array, *empty_fixed_array); |
1673 CHECK(result->HasFastProperties()); | 1673 CHECK(result->HasFastProperties()); |
1674 #ifdef VERIFY_HEAP | 1674 #ifdef VERIFY_HEAP |
1675 isolate->heap()->Verify(); | 1675 isolate->heap()->Verify(); |
1676 #endif | 1676 #endif |
1677 } | 1677 } |
1678 } | 1678 } |
(...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1970 Handle<Object> result = ft.Call(isolate->factory()->undefined_value(), | 1970 Handle<Object> result = ft.Call(isolate->factory()->undefined_value(), |
1971 Handle<Smi>(Smi::FromInt(12), isolate), | 1971 Handle<Smi>(Smi::FromInt(12), isolate), |
1972 Handle<Smi>(Smi::FromInt(13), isolate), | 1972 Handle<Smi>(Smi::FromInt(13), isolate), |
1973 Handle<Smi>(Smi::FromInt(14), isolate)) | 1973 Handle<Smi>(Smi::FromInt(14), isolate)) |
1974 .ToHandleChecked(); | 1974 .ToHandleChecked(); |
1975 CHECK_EQ(Smi::FromInt(12 + 13 + 14), *result); | 1975 CHECK_EQ(Smi::FromInt(12 + 13 + 14), *result); |
1976 } | 1976 } |
1977 | 1977 |
1978 } // namespace internal | 1978 } // namespace internal |
1979 } // namespace v8 | 1979 } // namespace v8 |
OLD | NEW |