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 383 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 int descriptor = | 402 int descriptor = |
403 map->instance_descriptors()->SearchWithCache(isolate, *name, *map); | 403 map->instance_descriptors()->SearchWithCache(isolate, *name, *map); |
404 map = Map::TransitionToAccessorProperty( | 404 map = Map::TransitionToAccessorProperty(isolate, map, name, descriptor, |
405 map, name, descriptor, ACCESSOR_GETTER, getter, attributes); | 405 getter, setter, attributes); |
406 CHECK(!map->is_deprecated()); | |
407 CHECK(!map->is_dictionary_map()); | |
408 | |
409 descriptor = | |
410 map->instance_descriptors()->SearchWithCache(isolate, *name, *map); | |
411 map = Map::TransitionToAccessorProperty( | |
412 map, name, descriptor, ACCESSOR_SETTER, setter, attributes); | |
413 CHECK(!map->is_deprecated()); | 406 CHECK(!map->is_deprecated()); |
414 CHECK(!map->is_dictionary_map()); | 407 CHECK(!map->is_dictionary_map()); |
415 return map; | 408 return map; |
416 } | 409 } |
417 }; | 410 }; |
418 | 411 |
419 | 412 |
420 //////////////////////////////////////////////////////////////////////////////// | 413 //////////////////////////////////////////////////////////////////////////////// |
421 // A set of tests for property reconfiguration that makes new transition tree | 414 // A set of tests for property reconfiguration that makes new transition tree |
422 // branch. | 415 // branch. |
(...skipping 1699 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2122 Handle<AccessorPair> pair = CreateAccessorPair(true, true); | 2115 Handle<AccessorPair> pair = CreateAccessorPair(true, true); |
2123 TransitionToAccessorConstantOperator transition_op(pair); | 2116 TransitionToAccessorConstantOperator transition_op(pair); |
2124 | 2117 |
2125 SameMapChecker checker; | 2118 SameMapChecker checker; |
2126 TestTransitionTo(transition_op, transition_op, checker); | 2119 TestTransitionTo(transition_op, transition_op, checker); |
2127 } | 2120 } |
2128 | 2121 |
2129 | 2122 |
2130 // TODO(ishell): add this test once IS_ACCESSOR_FIELD_SUPPORTED is supported. | 2123 // TODO(ishell): add this test once IS_ACCESSOR_FIELD_SUPPORTED is supported. |
2131 // TEST(TransitionAccessorConstantToAnotherAccessorConstant) | 2124 // TEST(TransitionAccessorConstantToAnotherAccessorConstant) |
OLD | NEW |