OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 2041 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2052 InstallBuiltin(isolate, holder, "shift", Builtins::kArrayShift); | 2052 InstallBuiltin(isolate, holder, "shift", Builtins::kArrayShift); |
2053 InstallBuiltin(isolate, holder, "unshift", Builtins::kArrayUnshift); | 2053 InstallBuiltin(isolate, holder, "unshift", Builtins::kArrayUnshift); |
2054 InstallBuiltin(isolate, holder, "slice", Builtins::kArraySlice); | 2054 InstallBuiltin(isolate, holder, "slice", Builtins::kArraySlice); |
2055 InstallBuiltin(isolate, holder, "splice", Builtins::kArraySplice); | 2055 InstallBuiltin(isolate, holder, "splice", Builtins::kArraySplice); |
2056 InstallBuiltin(isolate, holder, "concat", Builtins::kArrayConcat); | 2056 InstallBuiltin(isolate, holder, "concat", Builtins::kArrayConcat); |
2057 | 2057 |
2058 return *holder; | 2058 return *holder; |
2059 } | 2059 } |
2060 | 2060 |
2061 | 2061 |
| 2062 RUNTIME_FUNCTION(MaybeObject*, Runtime_IsClassicModeFunction) { |
| 2063 NoHandleAllocation ha(isolate); |
| 2064 ASSERT(args.length() == 1); |
| 2065 CONVERT_ARG_CHECKED(JSReceiver, callable, 0); |
| 2066 if (!callable->IsJSFunction()) { |
| 2067 HandleScope scope(isolate); |
| 2068 bool threw = false; |
| 2069 Handle<Object> delegate = |
| 2070 Execution::TryGetFunctionDelegate(Handle<JSReceiver>(callable), &threw); |
| 2071 if (threw) return Failure::Exception(); |
| 2072 callable = JSFunction::cast(*delegate); |
| 2073 } |
| 2074 JSFunction* function = JSFunction::cast(callable); |
| 2075 SharedFunctionInfo* shared = function->shared(); |
| 2076 return isolate->heap()->ToBoolean(shared->is_classic_mode()); |
| 2077 } |
| 2078 |
| 2079 |
2062 RUNTIME_FUNCTION(MaybeObject*, Runtime_GetDefaultReceiver) { | 2080 RUNTIME_FUNCTION(MaybeObject*, Runtime_GetDefaultReceiver) { |
2063 NoHandleAllocation ha(isolate); | 2081 NoHandleAllocation ha(isolate); |
2064 ASSERT(args.length() == 1); | 2082 ASSERT(args.length() == 1); |
2065 CONVERT_ARG_CHECKED(JSReceiver, callable, 0); | 2083 CONVERT_ARG_CHECKED(JSReceiver, callable, 0); |
2066 | 2084 |
2067 if (!callable->IsJSFunction()) { | 2085 if (!callable->IsJSFunction()) { |
2068 HandleScope scope(isolate); | 2086 HandleScope scope(isolate); |
2069 bool threw = false; | 2087 bool threw = false; |
2070 Handle<Object> delegate = | 2088 Handle<Object> delegate = |
2071 Execution::TryGetFunctionDelegate(Handle<JSReceiver>(callable), &threw); | 2089 Execution::TryGetFunctionDelegate(Handle<JSReceiver>(callable), &threw); |
(...skipping 11078 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
13150 // Handle last resort GC and make sure to allow future allocations | 13168 // Handle last resort GC and make sure to allow future allocations |
13151 // to grow the heap without causing GCs (if possible). | 13169 // to grow the heap without causing GCs (if possible). |
13152 isolate->counters()->gc_last_resort_from_js()->Increment(); | 13170 isolate->counters()->gc_last_resort_from_js()->Increment(); |
13153 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags, | 13171 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags, |
13154 "Runtime::PerformGC"); | 13172 "Runtime::PerformGC"); |
13155 } | 13173 } |
13156 } | 13174 } |
13157 | 13175 |
13158 | 13176 |
13159 } } // namespace v8::internal | 13177 } } // namespace v8::internal |
OLD | NEW |