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

Side by Side Diff: src/accessors.cc

Issue 2505853003: Refactor SharedFunctionInfo::IsBuiltin. (Closed)
Patch Set: rebase Created 4 years, 1 month 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
« no previous file with comments | « no previous file | src/api.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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/accessors.h" 5 #include "src/accessors.h"
6 6
7 #include "src/api.h" 7 #include "src/api.h"
8 #include "src/contexts.h" 8 #include "src/contexts.h"
9 #include "src/deoptimizer.h" 9 #include "src/deoptimizer.h"
10 #include "src/execution.h" 10 #include "src/execution.h"
(...skipping 1006 matching lines...) Expand 10 before | Expand all | Expand 10 after
1017 // No frame corresponding to the given function found. Return null. 1017 // No frame corresponding to the given function found. Return null.
1018 return MaybeHandle<JSFunction>(); 1018 return MaybeHandle<JSFunction>();
1019 } 1019 }
1020 // Find previously called non-toplevel function. 1020 // Find previously called non-toplevel function.
1021 JSFunction* caller; 1021 JSFunction* caller;
1022 do { 1022 do {
1023 caller = it.next(); 1023 caller = it.next();
1024 if (caller == NULL) return MaybeHandle<JSFunction>(); 1024 if (caller == NULL) return MaybeHandle<JSFunction>();
1025 } while (caller->shared()->is_toplevel()); 1025 } while (caller->shared()->is_toplevel());
1026 1026
1027 // If caller is a built-in function and caller's caller is also built-in, 1027 // If caller is not user code and caller's caller is also not user code,
1028 // use that instead. 1028 // use that instead.
1029 JSFunction* potential_caller = caller; 1029 JSFunction* potential_caller = caller;
1030 while (potential_caller != NULL && potential_caller->shared()->IsBuiltin()) { 1030 while (potential_caller != NULL &&
1031 !potential_caller->shared()->IsUserJavaScript()) {
1031 caller = potential_caller; 1032 caller = potential_caller;
1032 potential_caller = it.next(); 1033 potential_caller = it.next();
1033 } 1034 }
1034 if (!caller->shared()->native() && potential_caller != NULL) { 1035 if (!caller->shared()->native() && potential_caller != NULL) {
1035 caller = potential_caller; 1036 caller = potential_caller;
1036 } 1037 }
1037 // Censor if the caller is not a sloppy mode function. 1038 // Censor if the caller is not a sloppy mode function.
1038 // Change from ES5, which used to throw, see: 1039 // Change from ES5, which used to throw, see:
1039 // https://bugs.ecmascript.org/show_bug.cgi?id=310 1040 // https://bugs.ecmascript.org/show_bug.cgi?id=310
1040 if (is_strict(caller->shared()->language_mode())) { 1041 if (is_strict(caller->shared()->language_mode())) {
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after
1250 Handle<AccessorInfo> Accessors::ErrorStackInfo(Isolate* isolate, 1251 Handle<AccessorInfo> Accessors::ErrorStackInfo(Isolate* isolate,
1251 PropertyAttributes attributes) { 1252 PropertyAttributes attributes) {
1252 Handle<AccessorInfo> info = 1253 Handle<AccessorInfo> info =
1253 MakeAccessor(isolate, isolate->factory()->stack_string(), 1254 MakeAccessor(isolate, isolate->factory()->stack_string(),
1254 &ErrorStackGetter, &ErrorStackSetter, attributes); 1255 &ErrorStackGetter, &ErrorStackSetter, attributes);
1255 return info; 1256 return info;
1256 } 1257 }
1257 1258
1258 } // namespace internal 1259 } // namespace internal
1259 } // namespace v8 1260 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | src/api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698