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/conversions.h" | 9 #include "src/conversions.h" |
10 #include "src/isolate-inl.h" | 10 #include "src/isolate-inl.h" |
(...skipping 2207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2218 | 2218 |
2219 // Link debug info to function. | 2219 // Link debug info to function. |
2220 shared->set_debug_info(*debug_info); | 2220 shared->set_debug_info(*debug_info); |
2221 | 2221 |
2222 return debug_info; | 2222 return debug_info; |
2223 } | 2223 } |
2224 | 2224 |
2225 | 2225 |
2226 Handle<JSObject> Factory::NewArgumentsObject(Handle<JSFunction> callee, | 2226 Handle<JSObject> Factory::NewArgumentsObject(Handle<JSFunction> callee, |
2227 int length) { | 2227 int length) { |
2228 bool strict_mode_callee = is_strict(callee->shared()->language_mode()); | 2228 bool strict_mode_callee = is_strict(callee->shared()->language_mode()) || |
| 2229 !callee->is_simple_parameter_list(); |
2229 Handle<Map> map = strict_mode_callee ? isolate()->strict_arguments_map() | 2230 Handle<Map> map = strict_mode_callee ? isolate()->strict_arguments_map() |
2230 : isolate()->sloppy_arguments_map(); | 2231 : isolate()->sloppy_arguments_map(); |
2231 | 2232 |
2232 AllocationSiteUsageContext context(isolate(), Handle<AllocationSite>(), | 2233 AllocationSiteUsageContext context(isolate(), Handle<AllocationSite>(), |
2233 false); | 2234 false); |
2234 DCHECK(!isolate()->has_pending_exception()); | 2235 DCHECK(!isolate()->has_pending_exception()); |
2235 Handle<JSObject> result = NewJSObjectFromMap(map); | 2236 Handle<JSObject> result = NewJSObjectFromMap(map); |
2236 Handle<Smi> value(Smi::FromInt(length), isolate()); | 2237 Handle<Smi> value(Smi::FromInt(length), isolate()); |
2237 Object::SetProperty(result, length_string(), value, STRICT).Assert(); | 2238 Object::SetProperty(result, length_string(), value, STRICT).Assert(); |
2238 if (!strict_mode_callee) { | 2239 if (!strict_mode_callee) { |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2334 return Handle<Object>::null(); | 2335 return Handle<Object>::null(); |
2335 } | 2336 } |
2336 | 2337 |
2337 | 2338 |
2338 Handle<Object> Factory::ToBoolean(bool value) { | 2339 Handle<Object> Factory::ToBoolean(bool value) { |
2339 return value ? true_value() : false_value(); | 2340 return value ? true_value() : false_value(); |
2340 } | 2341 } |
2341 | 2342 |
2342 | 2343 |
2343 } } // namespace v8::internal | 2344 } } // namespace v8::internal |
OLD | NEW |