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 2260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2271 // Link debug info to function. | 2271 // Link debug info to function. |
2272 shared->set_debug_info(*debug_info); | 2272 shared->set_debug_info(*debug_info); |
2273 | 2273 |
2274 return debug_info; | 2274 return debug_info; |
2275 } | 2275 } |
2276 | 2276 |
2277 | 2277 |
2278 Handle<JSObject> Factory::NewArgumentsObject(Handle<JSFunction> callee, | 2278 Handle<JSObject> Factory::NewArgumentsObject(Handle<JSFunction> callee, |
2279 int length) { | 2279 int length) { |
2280 bool strict_mode_callee = is_strict(callee->shared()->language_mode()) || | 2280 bool strict_mode_callee = is_strict(callee->shared()->language_mode()) || |
2281 !callee->has_simple_parameters(); | 2281 !callee->shared()->has_simple_parameters(); |
2282 Handle<Map> map = strict_mode_callee ? isolate()->strict_arguments_map() | 2282 Handle<Map> map = strict_mode_callee ? isolate()->strict_arguments_map() |
2283 : isolate()->sloppy_arguments_map(); | 2283 : isolate()->sloppy_arguments_map(); |
2284 AllocationSiteUsageContext context(isolate(), Handle<AllocationSite>(), | 2284 AllocationSiteUsageContext context(isolate(), Handle<AllocationSite>(), |
2285 false); | 2285 false); |
2286 DCHECK(!isolate()->has_pending_exception()); | 2286 DCHECK(!isolate()->has_pending_exception()); |
2287 Handle<JSObject> result = NewJSObjectFromMap(map); | 2287 Handle<JSObject> result = NewJSObjectFromMap(map); |
2288 Handle<Smi> value(Smi::FromInt(length), isolate()); | 2288 Handle<Smi> value(Smi::FromInt(length), isolate()); |
2289 Object::SetProperty(result, length_string(), value, STRICT).Assert(); | 2289 Object::SetProperty(result, length_string(), value, STRICT).Assert(); |
2290 if (!strict_mode_callee) { | 2290 if (!strict_mode_callee) { |
2291 Object::SetProperty(result, callee_string(), callee, STRICT).Assert(); | 2291 Object::SetProperty(result, callee_string(), callee, STRICT).Assert(); |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2402 } | 2402 } |
2403 | 2403 |
2404 | 2404 |
2405 Handle<Object> Factory::ToBoolean(bool value) { | 2405 Handle<Object> Factory::ToBoolean(bool value) { |
2406 return value ? true_value() : false_value(); | 2406 return value ? true_value() : false_value(); |
2407 } | 2407 } |
2408 | 2408 |
2409 | 2409 |
2410 } // namespace internal | 2410 } // namespace internal |
2411 } // namespace v8 | 2411 } // namespace v8 |
OLD | NEW |