OLD | NEW |
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 687 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
698 } | 698 } |
699 | 699 |
700 | 700 |
701 Handle<Symbol> Factory::NewPrivateSymbol() { | 701 Handle<Symbol> Factory::NewPrivateSymbol() { |
702 Handle<Symbol> symbol = NewSymbol(); | 702 Handle<Symbol> symbol = NewSymbol(); |
703 symbol->set_is_private(true); | 703 symbol->set_is_private(true); |
704 return symbol; | 704 return symbol; |
705 } | 705 } |
706 | 706 |
707 | 707 |
708 Handle<Symbol> Factory::NewPrivateOwnSymbol() { | 708 Handle<Symbol> Factory::NewPrivateOwnSymbol(Handle<Object> name) { |
709 Handle<Symbol> symbol = NewSymbol(); | 709 Handle<Symbol> symbol = NewSymbol(); |
710 symbol->set_is_private(true); | 710 symbol->set_is_private(true); |
711 symbol->set_is_own(true); | 711 symbol->set_is_own(true); |
| 712 if (name->IsString()) { |
| 713 symbol->set_name(*name); |
| 714 } else { |
| 715 DCHECK(name->IsUndefined()); |
| 716 } |
712 return symbol; | 717 return symbol; |
713 } | 718 } |
714 | 719 |
715 | 720 |
716 Handle<Context> Factory::NewNativeContext() { | 721 Handle<Context> Factory::NewNativeContext() { |
717 Handle<FixedArray> array = NewFixedArray(Context::NATIVE_CONTEXT_SLOTS); | 722 Handle<FixedArray> array = NewFixedArray(Context::NATIVE_CONTEXT_SLOTS); |
718 array->set_map_no_write_barrier(*native_context_map()); | 723 array->set_map_no_write_barrier(*native_context_map()); |
719 Handle<Context> context = Handle<Context>::cast(array); | 724 Handle<Context> context = Handle<Context>::cast(array); |
720 context->set_js_array_maps(*undefined_value()); | 725 context->set_js_array_maps(*undefined_value()); |
721 DCHECK(context->IsNativeContext()); | 726 DCHECK(context->IsNativeContext()); |
(...skipping 1721 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2443 return Handle<Object>::null(); | 2448 return Handle<Object>::null(); |
2444 } | 2449 } |
2445 | 2450 |
2446 | 2451 |
2447 Handle<Object> Factory::ToBoolean(bool value) { | 2452 Handle<Object> Factory::ToBoolean(bool value) { |
2448 return value ? true_value() : false_value(); | 2453 return value ? true_value() : false_value(); |
2449 } | 2454 } |
2450 | 2455 |
2451 | 2456 |
2452 } } // namespace v8::internal | 2457 } } // namespace v8::internal |
OLD | NEW |