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

Side by Side Diff: src/ic/ic.cc

Issue 1190023002: Use output parameter to distinguish error from absent result (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 6 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
« no previous file with comments | « no previous file | src/objects.h » ('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/v8.h" 5 #include "src/v8.h"
6 6
7 #include "src/accessors.h" 7 #include "src/accessors.h"
8 #include "src/api.h" 8 #include "src/api.h"
9 #include "src/arguments.h" 9 #include "src/arguments.h"
10 #include "src/base/bits.h" 10 #include "src/base/bits.h"
(...skipping 2753 matching lines...) Expand 10 before | Expand all | Expand 10 after
2764 RUNTIME_FUNCTION(LoadPropertyWithInterceptorOnly) { 2764 RUNTIME_FUNCTION(LoadPropertyWithInterceptorOnly) {
2765 DCHECK(args.length() == NamedLoadHandlerCompiler::kInterceptorArgsLength); 2765 DCHECK(args.length() == NamedLoadHandlerCompiler::kInterceptorArgsLength);
2766 Handle<Name> name = 2766 Handle<Name> name =
2767 args.at<Name>(NamedLoadHandlerCompiler::kInterceptorArgsNameIndex); 2767 args.at<Name>(NamedLoadHandlerCompiler::kInterceptorArgsNameIndex);
2768 Handle<JSObject> receiver = 2768 Handle<JSObject> receiver =
2769 args.at<JSObject>(NamedLoadHandlerCompiler::kInterceptorArgsThisIndex); 2769 args.at<JSObject>(NamedLoadHandlerCompiler::kInterceptorArgsThisIndex);
2770 Handle<JSObject> holder = 2770 Handle<JSObject> holder =
2771 args.at<JSObject>(NamedLoadHandlerCompiler::kInterceptorArgsHolderIndex); 2771 args.at<JSObject>(NamedLoadHandlerCompiler::kInterceptorArgsHolderIndex);
2772 HandleScope scope(isolate); 2772 HandleScope scope(isolate);
2773 LookupIterator it(receiver, name, holder, LookupIterator::OWN); 2773 LookupIterator it(receiver, name, holder, LookupIterator::OWN);
2774 auto res = JSObject::GetPropertyWithInterceptor(&it); 2774 bool done;
2775 RETURN_FAILURE_IF_SCHEDULED_EXCEPTION(isolate);
2776 Handle<Object> result; 2775 Handle<Object> result;
2777 if (res.ToHandle(&result)) return *result; 2776 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(
2777 isolate, result, JSObject::GetPropertyWithInterceptor(&it, &done));
2778 if (done) return *result;
2778 return isolate->heap()->no_interceptor_result_sentinel(); 2779 return isolate->heap()->no_interceptor_result_sentinel();
2779 } 2780 }
2780 2781
2781 2782
2782 static Object* ThrowReferenceError(Isolate* isolate, Name* name) { 2783 static Object* ThrowReferenceError(Isolate* isolate, Name* name) {
2783 // If the load is non-contextual, just return the undefined result. 2784 // If the load is non-contextual, just return the undefined result.
2784 // Note that both keyed and non-keyed loads may end up here. 2785 // Note that both keyed and non-keyed loads may end up here.
2785 HandleScope scope(isolate); 2786 HandleScope scope(isolate);
2786 LoadIC ic(IC::NO_EXTRA_FRAME, isolate, true); 2787 LoadIC ic(IC::NO_EXTRA_FRAME, isolate, true);
2787 if (ic.contextual_mode() != CONTEXTUAL) { 2788 if (ic.contextual_mode() != CONTEXTUAL) {
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
2896 static const Address IC_utilities[] = { 2897 static const Address IC_utilities[] = {
2897 #define ADDR(name) FUNCTION_ADDR(name), 2898 #define ADDR(name) FUNCTION_ADDR(name),
2898 IC_UTIL_LIST(ADDR) NULL 2899 IC_UTIL_LIST(ADDR) NULL
2899 #undef ADDR 2900 #undef ADDR
2900 }; 2901 };
2901 2902
2902 2903
2903 Address IC::AddressFromUtilityId(IC::UtilityId id) { return IC_utilities[id]; } 2904 Address IC::AddressFromUtilityId(IC::UtilityId id) { return IC_utilities[id]; }
2904 } // namespace internal 2905 } // namespace internal
2905 } // namespace v8 2906 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | src/objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698