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

Side by Side Diff: src/factory.cc

Issue 1182303004: All private symbols are own symbols (Closed) Base URL: https://chromium.googlesource.com/v8/v8@master
Patch Set: Fix nits Created 5 years, 6 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/factory.h ('k') | src/heap/heap.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 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 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/factory.h" 5 #include "src/factory.h"
6 6
7 #include "src/allocation-site-scopes.h" 7 #include "src/allocation-site-scopes.h"
8 #include "src/base/bits.h" 8 #include "src/base/bits.h"
9 #include "src/bootstrapper.h" 9 #include "src/bootstrapper.h"
10 #include "src/conversions.h" 10 #include "src/conversions.h"
(...skipping 658 matching lines...) Expand 10 before | Expand all | Expand 10 after
669 669
670 670
671 Handle<Symbol> Factory::NewSymbol() { 671 Handle<Symbol> Factory::NewSymbol() {
672 CALL_HEAP_FUNCTION( 672 CALL_HEAP_FUNCTION(
673 isolate(), 673 isolate(),
674 isolate()->heap()->AllocateSymbol(), 674 isolate()->heap()->AllocateSymbol(),
675 Symbol); 675 Symbol);
676 } 676 }
677 677
678 678
679 Handle<Symbol> Factory::NewPrivateSymbol() { 679 Handle<Symbol> Factory::NewPrivateSymbol(Handle<Object> name) {
680 Handle<Symbol> symbol = NewSymbol(); 680 Handle<Symbol> symbol = NewSymbol();
681 symbol->set_is_private(true); 681 symbol->set_is_private(true);
682 return symbol;
683 }
684
685
686 Handle<Symbol> Factory::NewPrivateOwnSymbol(Handle<Object> name) {
687 Handle<Symbol> symbol = NewSymbol();
688 symbol->set_is_private(true);
689 symbol->set_is_own(true);
690 if (name->IsString()) { 682 if (name->IsString()) {
691 symbol->set_name(*name); 683 symbol->set_name(*name);
692 } else { 684 } else {
693 DCHECK(name->IsUndefined()); 685 DCHECK(name->IsUndefined());
694 } 686 }
695 return symbol; 687 return symbol;
696 } 688 }
697 689
698 690
699 Handle<Context> Factory::NewNativeContext() { 691 Handle<Context> Factory::NewNativeContext() {
(...skipping 1737 matching lines...) Expand 10 before | Expand all | Expand 10 after
2437 } 2429 }
2438 2430
2439 2431
2440 Handle<Object> Factory::ToBoolean(bool value) { 2432 Handle<Object> Factory::ToBoolean(bool value) {
2441 return value ? true_value() : false_value(); 2433 return value ? true_value() : false_value();
2442 } 2434 }
2443 2435
2444 2436
2445 } // namespace internal 2437 } // namespace internal
2446 } // namespace v8 2438 } // namespace v8
OLDNEW
« no previous file with comments | « src/factory.h ('k') | src/heap/heap.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698