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

Side by Side Diff: src/accessors.cc

Issue 2512463002: Revert of Refactor SharedFunctionInfo::IsBuiltin. (Closed)
Patch Set: 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 1007 matching lines...) Expand 10 before | Expand all | Expand 10 after
1018 // No frame corresponding to the given function found. Return null. 1018 // No frame corresponding to the given function found. Return null.
1019 return MaybeHandle<JSFunction>(); 1019 return MaybeHandle<JSFunction>();
1020 } 1020 }
1021 // Find previously called non-toplevel function. 1021 // Find previously called non-toplevel function.
1022 JSFunction* caller; 1022 JSFunction* caller;
1023 do { 1023 do {
1024 caller = it.next(); 1024 caller = it.next();
1025 if (caller == NULL) return MaybeHandle<JSFunction>(); 1025 if (caller == NULL) return MaybeHandle<JSFunction>();
1026 } while (caller->shared()->is_toplevel()); 1026 } while (caller->shared()->is_toplevel());
1027 1027
1028 // If caller is not user code and caller's caller is also not user code, 1028 // If caller is a built-in function and caller's caller is also built-in,
1029 // use that instead. 1029 // use that instead.
1030 JSFunction* potential_caller = caller; 1030 JSFunction* potential_caller = caller;
1031 while (potential_caller != NULL && 1031 while (potential_caller != NULL && potential_caller->shared()->IsBuiltin()) {
1032 !potential_caller->shared()->IsUserJavaScript()) {
1033 caller = potential_caller; 1032 caller = potential_caller;
1034 potential_caller = it.next(); 1033 potential_caller = it.next();
1035 } 1034 }
1036 if (!caller->shared()->native() && potential_caller != NULL) { 1035 if (!caller->shared()->native() && potential_caller != NULL) {
1037 caller = potential_caller; 1036 caller = potential_caller;
1038 } 1037 }
1039 // Censor if the caller is not a sloppy mode function. 1038 // Censor if the caller is not a sloppy mode function.
1040 // Change from ES5, which used to throw, see: 1039 // Change from ES5, which used to throw, see:
1041 // https://bugs.ecmascript.org/show_bug.cgi?id=310 1040 // https://bugs.ecmascript.org/show_bug.cgi?id=310
1042 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
1252 Handle<AccessorInfo> Accessors::ErrorStackInfo(Isolate* isolate, 1251 Handle<AccessorInfo> Accessors::ErrorStackInfo(Isolate* isolate,
1253 PropertyAttributes attributes) { 1252 PropertyAttributes attributes) {
1254 Handle<AccessorInfo> info = 1253 Handle<AccessorInfo> info =
1255 MakeAccessor(isolate, isolate->factory()->stack_string(), 1254 MakeAccessor(isolate, isolate->factory()->stack_string(),
1256 &ErrorStackGetter, &ErrorStackSetter, attributes); 1255 &ErrorStackGetter, &ErrorStackSetter, attributes);
1257 return info; 1256 return info;
1258 } 1257 }
1259 1258
1260 } // namespace internal 1259 } // namespace internal
1261 } // 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