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 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
105 Handle<ScopeInfo> scope_info, Handle<JSObject> extension) { | 105 Handle<ScopeInfo> scope_info, Handle<JSObject> extension) { |
106 DCHECK(scope_info->is_declaration_scope()); | 106 DCHECK(scope_info->is_declaration_scope()); |
107 Handle<SloppyBlockWithEvalContextExtension> result = | 107 Handle<SloppyBlockWithEvalContextExtension> result = |
108 Handle<SloppyBlockWithEvalContextExtension>::cast( | 108 Handle<SloppyBlockWithEvalContextExtension>::cast( |
109 NewStruct(SLOPPY_BLOCK_WITH_EVAL_CONTEXT_EXTENSION_TYPE)); | 109 NewStruct(SLOPPY_BLOCK_WITH_EVAL_CONTEXT_EXTENSION_TYPE)); |
110 result->set_scope_info(*scope_info); | 110 result->set_scope_info(*scope_info); |
111 result->set_extension(*extension); | 111 result->set_extension(*extension); |
112 return result; | 112 return result; |
113 } | 113 } |
114 | 114 |
115 | |
116 Handle<Oddball> Factory::NewOddball(Handle<Map> map, const char* to_string, | 115 Handle<Oddball> Factory::NewOddball(Handle<Map> map, const char* to_string, |
117 Handle<Object> to_number, | 116 Handle<Object> to_number, bool to_boolean, |
118 const char* type_of, byte kind) { | 117 const char* type_of, byte kind) { |
119 Handle<Oddball> oddball = New<Oddball>(map, OLD_SPACE); | 118 Handle<Oddball> oddball = New<Oddball>(map, OLD_SPACE); |
120 Oddball::Initialize(isolate(), oddball, to_string, to_number, type_of, kind); | 119 Oddball::Initialize(isolate(), oddball, to_string, to_number, to_boolean, |
| 120 type_of, kind); |
121 return oddball; | 121 return oddball; |
122 } | 122 } |
123 | 123 |
124 | 124 |
125 Handle<FixedArray> Factory::NewFixedArray(int size, PretenureFlag pretenure) { | 125 Handle<FixedArray> Factory::NewFixedArray(int size, PretenureFlag pretenure) { |
126 DCHECK(0 <= size); | 126 DCHECK(0 <= size); |
127 CALL_HEAP_FUNCTION( | 127 CALL_HEAP_FUNCTION( |
128 isolate(), | 128 isolate(), |
129 isolate()->heap()->AllocateFixedArray(size, pretenure), | 129 isolate()->heap()->AllocateFixedArray(size, pretenure), |
130 FixedArray); | 130 FixedArray); |
(...skipping 2266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2397 } | 2397 } |
2398 | 2398 |
2399 | 2399 |
2400 Handle<Object> Factory::ToBoolean(bool value) { | 2400 Handle<Object> Factory::ToBoolean(bool value) { |
2401 return value ? true_value() : false_value(); | 2401 return value ? true_value() : false_value(); |
2402 } | 2402 } |
2403 | 2403 |
2404 | 2404 |
2405 } // namespace internal | 2405 } // namespace internal |
2406 } // namespace v8 | 2406 } // namespace v8 |
OLD | NEW |