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 "factory.h" | 5 #include "factory.h" |
6 | 6 |
7 #include "macro-assembler.h" | 7 #include "macro-assembler.h" |
8 #include "isolate-inl.h" | 8 #include "isolate-inl.h" |
9 #include "v8conversions.h" | 9 #include "v8conversions.h" |
10 | 10 |
(...skipping 1945 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1956 } | 1956 } |
1957 | 1957 |
1958 // We tenure the allocated string since it is referenced from the | 1958 // We tenure the allocated string since it is referenced from the |
1959 // number-string cache which lives in the old space. | 1959 // number-string cache which lives in the old space. |
1960 Handle<String> js_string = NewStringFromAsciiChecked(str, TENURED); | 1960 Handle<String> js_string = NewStringFromAsciiChecked(str, TENURED); |
1961 SetNumberStringCache(number, js_string); | 1961 SetNumberStringCache(number, js_string); |
1962 return js_string; | 1962 return js_string; |
1963 } | 1963 } |
1964 | 1964 |
1965 | 1965 |
| 1966 Handle<SeededNumberDictionary> Factory::DictionaryAtNumberPut( |
| 1967 Handle<SeededNumberDictionary> dictionary, |
| 1968 uint32_t key, |
| 1969 Handle<Object> value) { |
| 1970 CALL_HEAP_FUNCTION(isolate(), |
| 1971 dictionary->AtNumberPut(key, *value), |
| 1972 SeededNumberDictionary); |
| 1973 } |
| 1974 |
| 1975 |
| 1976 Handle<UnseededNumberDictionary> Factory::DictionaryAtNumberPut( |
| 1977 Handle<UnseededNumberDictionary> dictionary, |
| 1978 uint32_t key, |
| 1979 Handle<Object> value) { |
| 1980 CALL_HEAP_FUNCTION(isolate(), |
| 1981 dictionary->AtNumberPut(key, *value), |
| 1982 UnseededNumberDictionary); |
| 1983 } |
| 1984 |
| 1985 |
1966 void Factory::InitializeFunction(Handle<JSFunction> function, | 1986 void Factory::InitializeFunction(Handle<JSFunction> function, |
1967 Handle<SharedFunctionInfo> info, | 1987 Handle<SharedFunctionInfo> info, |
1968 Handle<Context> context, | 1988 Handle<Context> context, |
1969 MaybeHandle<Object> maybe_prototype) { | 1989 MaybeHandle<Object> maybe_prototype) { |
1970 function->initialize_properties(); | 1990 function->initialize_properties(); |
1971 function->initialize_elements(); | 1991 function->initialize_elements(); |
1972 function->set_shared(*info); | 1992 function->set_shared(*info); |
1973 function->set_code(info->code()); | 1993 function->set_code(info->code()); |
1974 function->set_context(*context); | 1994 function->set_context(*context); |
1975 Handle<Object> prototype; | 1995 Handle<Object> prototype; |
(...skipping 349 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2325 return Handle<Object>::null(); | 2345 return Handle<Object>::null(); |
2326 } | 2346 } |
2327 | 2347 |
2328 | 2348 |
2329 Handle<Object> Factory::ToBoolean(bool value) { | 2349 Handle<Object> Factory::ToBoolean(bool value) { |
2330 return value ? true_value() : false_value(); | 2350 return value ? true_value() : false_value(); |
2331 } | 2351 } |
2332 | 2352 |
2333 | 2353 |
2334 } } // namespace v8::internal | 2354 } } // namespace v8::internal |
OLD | NEW |