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

Side by Side Diff: src/api-natives.cc

Issue 1675223002: Mark maps having a hidden prototype rather than maps of hidden prototypes. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Addressed comment Created 4 years, 10 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 | « no previous file | src/arm/builtins-arm.cc » ('j') | 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 "src/api-natives.h" 5 #include "src/api-natives.h"
6 6
7 #include "src/api.h" 7 #include "src/api.h"
8 #include "src/isolate-inl.h" 8 #include "src/isolate-inl.h"
9 #include "src/lookup.h" 9 #include "src/lookup.h"
10 #include "src/messages.h" 10 #include "src/messages.h"
(...skipping 566 matching lines...) Expand 10 before | Expand all | Expand 10 after
577 // Down from here is only valid for API functions that can be used as a 577 // Down from here is only valid for API functions that can be used as a
578 // constructor (don't set the "remove prototype" flag). 578 // constructor (don't set the "remove prototype" flag).
579 579
580 Handle<Map> map(result->initial_map()); 580 Handle<Map> map(result->initial_map());
581 581
582 // Mark as undetectable if needed. 582 // Mark as undetectable if needed.
583 if (obj->undetectable()) { 583 if (obj->undetectable()) {
584 map->set_is_undetectable(); 584 map->set_is_undetectable();
585 } 585 }
586 586
587 // Mark as hidden for the __proto__ accessor if needed.
588 if (obj->hidden_prototype()) {
589 map->set_is_hidden_prototype();
590 }
591
592 // Mark as needs_access_check if needed. 587 // Mark as needs_access_check if needed.
593 if (obj->needs_access_check()) { 588 if (obj->needs_access_check()) {
594 map->set_is_access_check_needed(true); 589 map->set_is_access_check_needed(true);
595 } 590 }
596 591
597 // Set interceptor information in the map. 592 // Set interceptor information in the map.
598 if (!obj->named_property_handler()->IsUndefined()) { 593 if (!obj->named_property_handler()->IsUndefined()) {
599 map->set_has_named_interceptor(); 594 map->set_has_named_interceptor();
600 } 595 }
601 if (!obj->indexed_property_handler()->IsUndefined()) { 596 if (!obj->indexed_property_handler()->IsUndefined()) {
602 map->set_has_indexed_interceptor(); 597 map->set_has_indexed_interceptor();
603 } 598 }
604 599
605 // Mark instance as callable in the map. 600 // Mark instance as callable in the map.
606 if (!obj->instance_call_handler()->IsUndefined()) { 601 if (!obj->instance_call_handler()->IsUndefined()) {
607 map->set_is_callable(); 602 map->set_is_callable();
608 map->set_is_constructor(true); 603 map->set_is_constructor(true);
609 } 604 }
610 605
611 DCHECK(result->shared()->IsApiFunction()); 606 DCHECK(result->shared()->IsApiFunction());
612 return result; 607 return result;
613 } 608 }
614 609
615 } // namespace internal 610 } // namespace internal
616 } // namespace v8 611 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | src/arm/builtins-arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698