| 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 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 158 *pending_exception = false; | 158 *pending_exception = false; |
| 159 | 159 |
| 160 if (!callable->IsJSFunction()) { | 160 if (!callable->IsJSFunction()) { |
| 161 callable = TryGetFunctionDelegate(isolate, callable, pending_exception); | 161 callable = TryGetFunctionDelegate(isolate, callable, pending_exception); |
| 162 if (*pending_exception) return callable; | 162 if (*pending_exception) return callable; |
| 163 } | 163 } |
| 164 Handle<JSFunction> func = Handle<JSFunction>::cast(callable); | 164 Handle<JSFunction> func = Handle<JSFunction>::cast(callable); |
| 165 | 165 |
| 166 // In sloppy mode, convert receiver. | 166 // In sloppy mode, convert receiver. |
| 167 if (convert_receiver && !receiver->IsJSReceiver() && | 167 if (convert_receiver && !receiver->IsJSReceiver() && |
| 168 !func->shared()->native() && func->shared()->is_sloppy_mode()) { | 168 !func->shared()->native() && |
| 169 func->shared()->strict_mode() == SLOPPY) { |
| 169 if (receiver->IsUndefined() || receiver->IsNull()) { | 170 if (receiver->IsUndefined() || receiver->IsNull()) { |
| 170 Object* global = func->context()->global_object()->global_receiver(); | 171 Object* global = func->context()->global_object()->global_receiver(); |
| 171 // Under some circumstances, 'global' can be the JSBuiltinsObject | 172 // Under some circumstances, 'global' can be the JSBuiltinsObject |
| 172 // In that case, don't rewrite. (FWIW, the same holds for | 173 // In that case, don't rewrite. (FWIW, the same holds for |
| 173 // GetIsolate()->global_object()->global_receiver().) | 174 // GetIsolate()->global_object()->global_receiver().) |
| 174 if (!global->IsJSBuiltinsObject()) { | 175 if (!global->IsJSBuiltinsObject()) { |
| 175 receiver = Handle<Object>(global, func->GetIsolate()); | 176 receiver = Handle<Object>(global, func->GetIsolate()); |
| 176 } | 177 } |
| 177 } else { | 178 } else { |
| 178 receiver = ToObject(isolate, receiver, pending_exception); | 179 receiver = ToObject(isolate, receiver, pending_exception); |
| (...skipping 869 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1048 ASSERT(isolate->concurrent_recompilation_enabled()); | 1049 ASSERT(isolate->concurrent_recompilation_enabled()); |
| 1049 stack_guard->Continue(INSTALL_CODE); | 1050 stack_guard->Continue(INSTALL_CODE); |
| 1050 isolate->optimizing_compiler_thread()->InstallOptimizedFunctions(); | 1051 isolate->optimizing_compiler_thread()->InstallOptimizedFunctions(); |
| 1051 } | 1052 } |
| 1052 isolate->runtime_profiler()->OptimizeNow(); | 1053 isolate->runtime_profiler()->OptimizeNow(); |
| 1053 return isolate->heap()->undefined_value(); | 1054 return isolate->heap()->undefined_value(); |
| 1054 } | 1055 } |
| 1055 | 1056 |
| 1056 | 1057 |
| 1057 } } // namespace v8::internal | 1058 } } // namespace v8::internal |
| OLD | NEW |