| 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 <sstream> | 6 #include <sstream> |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "src/api.h" | 9 #include "src/api.h" |
| 10 #include "src/objects.h" | 10 #include "src/objects.h" |
| (...skipping 594 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 605 CHECK_EQ(Map::kSlackTrackingCounterStart - 1, | 605 CHECK_EQ(Map::kSlackTrackingCounterStart - 1, |
| 606 initial_map->construction_counter()); | 606 initial_map->construction_counter()); |
| 607 CHECK(initial_map->IsInobjectSlackTrackingInProgress()); | 607 CHECK(initial_map->IsInobjectSlackTrackingInProgress()); |
| 608 | 608 |
| 609 // Create several instances to complete the tracking. | 609 // Create several instances to complete the tracking. |
| 610 for (int i = 1; i < Map::kGenerousAllocationCount; i++) { | 610 for (int i = 1; i < Map::kGenerousAllocationCount; i++) { |
| 611 CHECK(initial_map->IsInobjectSlackTrackingInProgress()); | 611 CHECK(initial_map->IsInobjectSlackTrackingInProgress()); |
| 612 Handle<JSObject> tmp = Run<JSObject>(new_script); | 612 Handle<JSObject> tmp = Run<JSObject>(new_script); |
| 613 CHECK_EQ(initial_map->IsInobjectSlackTrackingInProgress(), | 613 CHECK_EQ(initial_map->IsInobjectSlackTrackingInProgress(), |
| 614 IsObjectShrinkable(*tmp)); | 614 IsObjectShrinkable(*tmp)); |
| 615 CHECK_EQ(Map::kSlackTrackingCounterStart - i - 1, |
| 616 initial_map->construction_counter()); |
| 615 } | 617 } |
| 616 CHECK(!initial_map->IsInobjectSlackTrackingInProgress()); | 618 CHECK(!initial_map->IsInobjectSlackTrackingInProgress()); |
| 617 CHECK(!IsObjectShrinkable(*obj)); | 619 CHECK(!IsObjectShrinkable(*obj)); |
| 618 | 620 |
| 619 // No slack left. | 621 // No slack left. |
| 620 CHECK_EQ(fields_count, obj->map()->GetInObjectProperties()); | 622 CHECK_EQ(fields_count, obj->map()->GetInObjectProperties()); |
| 621 } | 623 } |
| 622 } | 624 } |
| 623 | 625 |
| 624 | 626 |
| (...skipping 477 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1102 TestSubclassBuiltin("A1", JS_PROMISE_TYPE, "Promise", | 1104 TestSubclassBuiltin("A1", JS_PROMISE_TYPE, "Promise", |
| 1103 "function(resolve, reject) { resolve('ok'); }", | 1105 "function(resolve, reject) { resolve('ok'); }", |
| 1104 first_field); | 1106 first_field); |
| 1105 } | 1107 } |
| 1106 | 1108 |
| 1107 | 1109 |
| 1108 TEST(SubclassPromiseBuiltinNoInlineNew) { | 1110 TEST(SubclassPromiseBuiltinNoInlineNew) { |
| 1109 FLAG_inline_new = false; | 1111 FLAG_inline_new = false; |
| 1110 TestSubclassPromiseBuiltin(); | 1112 TestSubclassPromiseBuiltin(); |
| 1111 } | 1113 } |
| OLD | NEW |