Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(116)

Side by Side Diff: test/cctest/test-inobject-slack-tracking.cc

Issue 1798373002: [turbofan] Fix double object allocation when inlining a construct call of a derived class.... (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/compiler/js-inlining.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « src/compiler/js-inlining.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698