Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(79)

Side by Side Diff: src/execution.cc

Issue 177683002: Mode clean-up pt 1: rename classic/non-strict mode to sloppy mode (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « src/elements-kind.cc ('k') | src/factory.cc » ('j') | src/globals.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698