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 #ifndef V8_FACTORY_H_ | 5 #ifndef V8_FACTORY_H_ |
6 #define V8_FACTORY_H_ | 6 #define V8_FACTORY_H_ |
7 | 7 |
8 #include "src/isolate.h" | 8 #include "src/isolate.h" |
9 | 9 |
10 namespace v8 { | 10 namespace v8 { |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 // | 103 // |
104 // ASCII strings are pretenured when used as keys in the SourceCodeCache. | 104 // ASCII strings are pretenured when used as keys in the SourceCodeCache. |
105 MUST_USE_RESULT MaybeHandle<String> NewStringFromOneByte( | 105 MUST_USE_RESULT MaybeHandle<String> NewStringFromOneByte( |
106 Vector<const uint8_t> str, | 106 Vector<const uint8_t> str, |
107 PretenureFlag pretenure = NOT_TENURED); | 107 PretenureFlag pretenure = NOT_TENURED); |
108 | 108 |
109 template<size_t N> | 109 template<size_t N> |
110 inline Handle<String> NewStringFromStaticAscii( | 110 inline Handle<String> NewStringFromStaticAscii( |
111 const char (&str)[N], | 111 const char (&str)[N], |
112 PretenureFlag pretenure = NOT_TENURED) { | 112 PretenureFlag pretenure = NOT_TENURED) { |
113 ASSERT(N == StrLength(str) + 1); | 113 DCHECK(N == StrLength(str) + 1); |
114 return NewStringFromOneByte( | 114 return NewStringFromOneByte( |
115 STATIC_ASCII_VECTOR(str), pretenure).ToHandleChecked(); | 115 STATIC_ASCII_VECTOR(str), pretenure).ToHandleChecked(); |
116 } | 116 } |
117 | 117 |
118 inline Handle<String> NewStringFromAsciiChecked( | 118 inline Handle<String> NewStringFromAsciiChecked( |
119 const char* str, | 119 const char* str, |
120 PretenureFlag pretenure = NOT_TENURED) { | 120 PretenureFlag pretenure = NOT_TENURED) { |
121 return NewStringFromOneByte( | 121 return NewStringFromOneByte( |
122 OneByteVector(str), pretenure).ToHandleChecked(); | 122 OneByteVector(str), pretenure).ToHandleChecked(); |
123 } | 123 } |
(...skipping 577 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
701 PretenureFlag pretenure = TENURED); | 701 PretenureFlag pretenure = TENURED); |
702 | 702 |
703 Handle<JSFunction> NewFunction(Handle<Map> map, | 703 Handle<JSFunction> NewFunction(Handle<Map> map, |
704 Handle<String> name, | 704 Handle<String> name, |
705 MaybeHandle<Code> maybe_code); | 705 MaybeHandle<Code> maybe_code); |
706 }; | 706 }; |
707 | 707 |
708 } } // namespace v8::internal | 708 } } // namespace v8::internal |
709 | 709 |
710 #endif // V8_FACTORY_H_ | 710 #endif // V8_FACTORY_H_ |
OLD | NEW |