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 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
156 bool* pending_exception, | 156 bool* pending_exception, |
157 bool convert_receiver) { | 157 bool convert_receiver) { |
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 non-strict 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_classic_mode()) { | 168 !func->shared()->native() && func->shared()->is_sloppy_mode()) { |
169 if (receiver->IsUndefined() || receiver->IsNull()) { | 169 if (receiver->IsUndefined() || receiver->IsNull()) { |
170 Object* global = func->context()->global_object()->global_receiver(); | 170 Object* global = func->context()->global_object()->global_receiver(); |
171 // Under some circumstances, 'global' can be the JSBuiltinsObject | 171 // Under some circumstances, 'global' can be the JSBuiltinsObject |
172 // In that case, don't rewrite. (FWIW, the same holds for | 172 // In that case, don't rewrite. (FWIW, the same holds for |
173 // GetIsolate()->global_object()->global_receiver().) | 173 // GetIsolate()->global_object()->global_receiver().) |
174 if (!global->IsJSBuiltinsObject()) { | 174 if (!global->IsJSBuiltinsObject()) { |
175 receiver = Handle<Object>(global, func->GetIsolate()); | 175 receiver = Handle<Object>(global, func->GetIsolate()); |
176 } | 176 } |
177 } else { | 177 } else { |
178 receiver = ToObject(isolate, receiver, pending_exception); | 178 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()); | 1048 ASSERT(isolate->concurrent_recompilation_enabled()); |
1049 stack_guard->Continue(INSTALL_CODE); | 1049 stack_guard->Continue(INSTALL_CODE); |
1050 isolate->optimizing_compiler_thread()->InstallOptimizedFunctions(); | 1050 isolate->optimizing_compiler_thread()->InstallOptimizedFunctions(); |
1051 } | 1051 } |
1052 isolate->runtime_profiler()->OptimizeNow(); | 1052 isolate->runtime_profiler()->OptimizeNow(); |
1053 return isolate->heap()->undefined_value(); | 1053 return isolate->heap()->undefined_value(); |
1054 } | 1054 } |
1055 | 1055 |
1056 | 1056 |
1057 } } // namespace v8::internal | 1057 } } // namespace v8::internal |
OLD | NEW |