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/ic/ic.cc

Issue 1775973002: Add GetProperty/GetElement to JSReceiver and use it where possible (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 9 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 | « src/i18n.cc ('k') | src/json-stringifier.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/ic/ic.h" 5 #include "src/ic/ic.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 2796 matching lines...) Expand 10 before | Expand all | Expand 10 after
2807 Handle<Name> name = 2807 Handle<Name> name =
2808 args.at<Name>(NamedLoadHandlerCompiler::kInterceptorArgsNameIndex); 2808 args.at<Name>(NamedLoadHandlerCompiler::kInterceptorArgsNameIndex);
2809 Handle<JSObject> receiver = 2809 Handle<JSObject> receiver =
2810 args.at<JSObject>(NamedLoadHandlerCompiler::kInterceptorArgsThisIndex); 2810 args.at<JSObject>(NamedLoadHandlerCompiler::kInterceptorArgsThisIndex);
2811 Handle<JSObject> holder = 2811 Handle<JSObject> holder =
2812 args.at<JSObject>(NamedLoadHandlerCompiler::kInterceptorArgsHolderIndex); 2812 args.at<JSObject>(NamedLoadHandlerCompiler::kInterceptorArgsHolderIndex);
2813 2813
2814 Handle<Object> result; 2814 Handle<Object> result;
2815 LookupIterator it(receiver, name, holder); 2815 LookupIterator it(receiver, name, holder);
2816 // TODO(conradw): Investigate strong mode semantics for this. 2816 // TODO(conradw): Investigate strong mode semantics for this.
2817 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, result, 2817 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, result, Object::GetProperty(&it));
2818 JSObject::GetProperty(&it));
2819 2818
2820 if (it.IsFound()) return *result; 2819 if (it.IsFound()) return *result;
2821 2820
2822 // Return the undefined result if the reference error should not be thrown. 2821 // Return the undefined result if the reference error should not be thrown.
2823 // Note that both keyed and non-keyed loads may end up here. 2822 // Note that both keyed and non-keyed loads may end up here.
2824 LoadICNexus nexus(isolate); 2823 LoadICNexus nexus(isolate);
2825 LoadIC ic(IC::NO_EXTRA_FRAME, isolate, &nexus); 2824 LoadIC ic(IC::NO_EXTRA_FRAME, isolate, &nexus);
2826 if (!ic.ShouldThrowReferenceError(it.GetReceiver())) { 2825 if (!ic.ShouldThrowReferenceError(it.GetReceiver())) {
2827 return isolate->heap()->undefined_value(); 2826 return isolate->heap()->undefined_value();
2828 } 2827 }
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
2903 KeyedLoadICNexus nexus(vector, vector_slot); 2902 KeyedLoadICNexus nexus(vector, vector_slot);
2904 KeyedLoadIC ic(IC::EXTRA_CALL_FRAME, isolate, &nexus); 2903 KeyedLoadIC ic(IC::EXTRA_CALL_FRAME, isolate, &nexus);
2905 ic.UpdateState(receiver, key); 2904 ic.UpdateState(receiver, key);
2906 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, result, ic.Load(receiver, key)); 2905 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, result, ic.Load(receiver, key));
2907 } 2906 }
2908 2907
2909 return *result; 2908 return *result;
2910 } 2909 }
2911 } // namespace internal 2910 } // namespace internal
2912 } // namespace v8 2911 } // namespace v8
OLDNEW
« no previous file with comments | « src/i18n.cc ('k') | src/json-stringifier.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698