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 "src/v8.h" | 8 #include "src/v8.h" |
9 | 9 |
10 #include "src/code-stubs.h" | 10 #include "src/code-stubs.h" |
(...skipping 490 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
501 | 501 |
502 Handle<Object> obj_value = | 502 Handle<Object> obj_value = |
503 Object::GetProperty(isolate->global_object(), obj_name).ToHandleChecked(); | 503 Object::GetProperty(isolate->global_object(), obj_name).ToHandleChecked(); |
504 CHECK(obj_value->IsJSObject()); | 504 CHECK(obj_value->IsJSObject()); |
505 Handle<JSObject> obj = Handle<JSObject>::cast(obj_value); | 505 Handle<JSObject> obj = Handle<JSObject>::cast(obj_value); |
506 | 506 |
507 CHECK_EQ(1, obj->map()->NumberOfOwnDescriptors()); | 507 CHECK_EQ(1, obj->map()->NumberOfOwnDescriptors()); |
508 CHECK(obj->map()->instance_descriptors()->GetValue(0)->IsAccessorPair()); | 508 CHECK(obj->map()->instance_descriptors()->GetValue(0)->IsAccessorPair()); |
509 | 509 |
510 Handle<Object> value(Smi::FromInt(42), isolate); | 510 Handle<Object> value(Smi::FromInt(42), isolate); |
511 JSObject::SetOwnPropertyIgnoreAttributes( | 511 JSObject::SetOwnPropertyIgnoreAttributes(obj, foo_str, value, NONE).Check(); |
512 obj, foo_str, value, NONE, JSObject::DONT_FORCE_FIELD).ToHandleChecked(); | |
513 | 512 |
514 // Check that the property contains |value|. | 513 // Check that the property contains |value|. |
515 CHECK_EQ(1, obj->map()->NumberOfOwnDescriptors()); | 514 CHECK_EQ(1, obj->map()->NumberOfOwnDescriptors()); |
516 FieldIndex index = FieldIndex::ForDescriptor(obj->map(), 0); | 515 FieldIndex index = FieldIndex::ForDescriptor(obj->map(), 0); |
517 Object* the_value = obj->RawFastPropertyAt(index); | 516 Object* the_value = obj->RawFastPropertyAt(index); |
518 CHECK(the_value->IsSmi()); | 517 CHECK(the_value->IsSmi()); |
519 CHECK_EQ(42, Smi::cast(the_value)->value()); | 518 CHECK_EQ(42, Smi::cast(the_value)->value()); |
520 } | 519 } |
521 | 520 |
522 | 521 |
(...skipping 1551 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2074 Handle<AccessorPair> pair = CreateAccessorPair(true, true); | 2073 Handle<AccessorPair> pair = CreateAccessorPair(true, true); |
2075 TransitionToAccessorConstantOperator transition_op(pair); | 2074 TransitionToAccessorConstantOperator transition_op(pair); |
2076 | 2075 |
2077 SameMapChecker checker; | 2076 SameMapChecker checker; |
2078 TestTransitionTo(transition_op, transition_op, checker); | 2077 TestTransitionTo(transition_op, transition_op, checker); |
2079 } | 2078 } |
2080 | 2079 |
2081 | 2080 |
2082 // TODO(ishell): add this test once IS_ACCESSOR_FIELD_SUPPORTED is supported. | 2081 // TODO(ishell): add this test once IS_ACCESSOR_FIELD_SUPPORTED is supported. |
2083 // TEST(TransitionAccessorConstantToAnotherAccessorConstant) | 2082 // TEST(TransitionAccessorConstantToAnotherAccessorConstant) |
OLD | NEW |