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 2201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2212 | 2212 |
2213 // Link debug info to function. | 2213 // Link debug info to function. |
2214 shared->set_debug_info(*debug_info); | 2214 shared->set_debug_info(*debug_info); |
2215 | 2215 |
2216 return debug_info; | 2216 return debug_info; |
2217 } | 2217 } |
2218 | 2218 |
2219 | 2219 |
2220 Handle<JSObject> Factory::NewArgumentsObject(Handle<JSFunction> callee, | 2220 Handle<JSObject> Factory::NewArgumentsObject(Handle<JSFunction> callee, |
2221 int length) { | 2221 int length) { |
2222 bool strict_mode_callee = is_strict(callee->shared()->language_mode()); | 2222 bool strict_mode_callee = is_strict(callee->shared()->language_mode()) || |
| 2223 !callee->is_simple_parameter_list(); |
2223 Handle<Map> map = strict_mode_callee ? isolate()->strict_arguments_map() | 2224 Handle<Map> map = strict_mode_callee ? isolate()->strict_arguments_map() |
2224 : isolate()->sloppy_arguments_map(); | 2225 : isolate()->sloppy_arguments_map(); |
2225 | 2226 |
2226 AllocationSiteUsageContext context(isolate(), Handle<AllocationSite>(), | 2227 AllocationSiteUsageContext context(isolate(), Handle<AllocationSite>(), |
2227 false); | 2228 false); |
2228 DCHECK(!isolate()->has_pending_exception()); | 2229 DCHECK(!isolate()->has_pending_exception()); |
2229 Handle<JSObject> result = NewJSObjectFromMap(map); | 2230 Handle<JSObject> result = NewJSObjectFromMap(map); |
2230 Handle<Smi> value(Smi::FromInt(length), isolate()); | 2231 Handle<Smi> value(Smi::FromInt(length), isolate()); |
2231 Object::SetProperty(result, length_string(), value, STRICT).Assert(); | 2232 Object::SetProperty(result, length_string(), value, STRICT).Assert(); |
2232 if (!strict_mode_callee) { | 2233 if (!strict_mode_callee) { |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2328 return Handle<Object>::null(); | 2329 return Handle<Object>::null(); |
2329 } | 2330 } |
2330 | 2331 |
2331 | 2332 |
2332 Handle<Object> Factory::ToBoolean(bool value) { | 2333 Handle<Object> Factory::ToBoolean(bool value) { |
2333 return value ? true_value() : false_value(); | 2334 return value ? true_value() : false_value(); |
2334 } | 2335 } |
2335 | 2336 |
2336 | 2337 |
2337 } } // namespace v8::internal | 2338 } } // namespace v8::internal |
OLD | NEW |