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/conversions.h" | 8 #include "src/conversions.h" |
9 #include "src/isolate-inl.h" | 9 #include "src/isolate-inl.h" |
10 #include "src/macro-assembler.h" | 10 #include "src/macro-assembler.h" |
(...skipping 2080 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2091 int length) { | 2091 int length) { |
2092 bool strict_mode_callee = callee->shared()->strict_mode() == STRICT; | 2092 bool strict_mode_callee = callee->shared()->strict_mode() == STRICT; |
2093 Handle<Map> map = strict_mode_callee ? isolate()->strict_arguments_map() | 2093 Handle<Map> map = strict_mode_callee ? isolate()->strict_arguments_map() |
2094 : isolate()->sloppy_arguments_map(); | 2094 : isolate()->sloppy_arguments_map(); |
2095 | 2095 |
2096 AllocationSiteUsageContext context(isolate(), Handle<AllocationSite>(), | 2096 AllocationSiteUsageContext context(isolate(), Handle<AllocationSite>(), |
2097 false); | 2097 false); |
2098 ASSERT(!isolate()->has_pending_exception()); | 2098 ASSERT(!isolate()->has_pending_exception()); |
2099 Handle<JSObject> result = NewJSObjectFromMap(map); | 2099 Handle<JSObject> result = NewJSObjectFromMap(map); |
2100 Handle<Smi> value(Smi::FromInt(length), isolate()); | 2100 Handle<Smi> value(Smi::FromInt(length), isolate()); |
2101 JSReceiver::SetProperty(result, length_string(), value, NONE, STRICT) | 2101 JSReceiver::SetProperty(result, length_string(), value, STRICT).Assert(); |
2102 .Assert(); | |
2103 if (!strict_mode_callee) { | 2102 if (!strict_mode_callee) { |
2104 JSReceiver::SetProperty(result, callee_string(), callee, NONE, STRICT) | 2103 JSReceiver::SetProperty(result, callee_string(), callee, STRICT).Assert(); |
2105 .Assert(); | |
2106 } | 2104 } |
2107 return result; | 2105 return result; |
2108 } | 2106 } |
2109 | 2107 |
2110 | 2108 |
2111 Handle<JSFunction> Factory::CreateApiFunction( | 2109 Handle<JSFunction> Factory::CreateApiFunction( |
2112 Handle<FunctionTemplateInfo> obj, | 2110 Handle<FunctionTemplateInfo> obj, |
2113 Handle<Object> prototype, | 2111 Handle<Object> prototype, |
2114 ApiInstanceType instance_type) { | 2112 ApiInstanceType instance_type) { |
2115 Handle<Code> code = isolate()->builtins()->HandleApiCall(); | 2113 Handle<Code> code = isolate()->builtins()->HandleApiCall(); |
(...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2381 return Handle<Object>::null(); | 2379 return Handle<Object>::null(); |
2382 } | 2380 } |
2383 | 2381 |
2384 | 2382 |
2385 Handle<Object> Factory::ToBoolean(bool value) { | 2383 Handle<Object> Factory::ToBoolean(bool value) { |
2386 return value ? true_value() : false_value(); | 2384 return value ? true_value() : false_value(); |
2387 } | 2385 } |
2388 | 2386 |
2389 | 2387 |
2390 } } // namespace v8::internal | 2388 } } // namespace v8::internal |
OLD | NEW |