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 <stdlib.h> | 5 #include <stdlib.h> |
6 #include <utility> | 6 #include <utility> |
7 | 7 |
8 #include "test/cctest/test-api.h" | 8 #include "test/cctest/test-api.h" |
9 | 9 |
10 #include "src/v8.h" | 10 #include "src/v8.h" |
(...skipping 381 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
392 CHECK_EQ(number_of_properties_, map->NumberOfOwnDescriptors()); | 392 CHECK_EQ(number_of_properties_, map->NumberOfOwnDescriptors()); |
393 int property_index = number_of_properties_++; | 393 int property_index = number_of_properties_++; |
394 SetAccessorConstant(property_index, attributes, pair); | 394 SetAccessorConstant(property_index, attributes, pair); |
395 | 395 |
396 Handle<String> name = MakeName("prop", property_index); | 396 Handle<String> name = MakeName("prop", property_index); |
397 | 397 |
398 Isolate* isolate = CcTest::i_isolate(); | 398 Isolate* isolate = CcTest::i_isolate(); |
399 Handle<Object> getter(pair->getter(), isolate); | 399 Handle<Object> getter(pair->getter(), isolate); |
400 Handle<Object> setter(pair->setter(), isolate); | 400 Handle<Object> setter(pair->setter(), isolate); |
401 | 401 |
402 map = Map::TransitionToAccessorProperty(map, name, ACCESSOR_GETTER, getter, | 402 int descriptor = |
403 attributes); | 403 map->instance_descriptors()->SearchWithCache(isolate, *name, *map); |
| 404 map = Map::TransitionToAccessorProperty( |
| 405 map, name, descriptor, ACCESSOR_GETTER, getter, attributes); |
404 CHECK(!map->is_deprecated()); | 406 CHECK(!map->is_deprecated()); |
405 CHECK(!map->is_dictionary_map()); | 407 CHECK(!map->is_dictionary_map()); |
406 | 408 |
407 map = Map::TransitionToAccessorProperty(map, name, ACCESSOR_SETTER, setter, | 409 descriptor = |
408 attributes); | 410 map->instance_descriptors()->SearchWithCache(isolate, *name, *map); |
| 411 map = Map::TransitionToAccessorProperty( |
| 412 map, name, descriptor, ACCESSOR_SETTER, setter, attributes); |
409 CHECK(!map->is_deprecated()); | 413 CHECK(!map->is_deprecated()); |
410 CHECK(!map->is_dictionary_map()); | 414 CHECK(!map->is_dictionary_map()); |
411 return map; | 415 return map; |
412 } | 416 } |
413 }; | 417 }; |
414 | 418 |
415 | 419 |
416 //////////////////////////////////////////////////////////////////////////////// | 420 //////////////////////////////////////////////////////////////////////////////// |
417 // A set of tests for property reconfiguration that makes new transition tree | 421 // A set of tests for property reconfiguration that makes new transition tree |
418 // branch. | 422 // branch. |
(...skipping 1756 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2175 Handle<AccessorPair> pair = CreateAccessorPair(true, true); | 2179 Handle<AccessorPair> pair = CreateAccessorPair(true, true); |
2176 TransitionToAccessorConstantOperator transition_op(pair); | 2180 TransitionToAccessorConstantOperator transition_op(pair); |
2177 | 2181 |
2178 SameMapChecker checker; | 2182 SameMapChecker checker; |
2179 TestTransitionTo(transition_op, transition_op, checker); | 2183 TestTransitionTo(transition_op, transition_op, checker); |
2180 } | 2184 } |
2181 | 2185 |
2182 | 2186 |
2183 // TODO(ishell): add this test once IS_ACCESSOR_FIELD_SUPPORTED is supported. | 2187 // TODO(ishell): add this test once IS_ACCESSOR_FIELD_SUPPORTED is supported. |
2184 // TEST(TransitionAccessorConstantToAnotherAccessorConstant) | 2188 // TEST(TransitionAccessorConstantToAnotherAccessorConstant) |
OLD | NEW |