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

Side by Side Diff: src/runtime/runtime-forin.cc

Issue 2684043002: [turbofan] Use fast stub for ForInPrepare and ForInNext (Closed)
Patch Set: add missing SmiUntag and remove ForInNext RT function Created 3 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
« src/builtins/builtins-object.cc ('K') | « src/runtime/runtime.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 the V8 project authors. All rights reserved. 1 // Copyright 2015 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/runtime/runtime-utils.h" 5 #include "src/runtime/runtime-utils.h"
6 6
7 #include "src/arguments.h" 7 #include "src/arguments.h"
8 #include "src/elements.h" 8 #include "src/elements.h"
9 #include "src/factory.h" 9 #include "src/factory.h"
10 #include "src/isolate-inl.h" 10 #include "src/isolate-inl.h"
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after
153 153
154 RUNTIME_FUNCTION(Runtime_ForInFilter) { 154 RUNTIME_FUNCTION(Runtime_ForInFilter) {
155 HandleScope scope(isolate); 155 HandleScope scope(isolate);
156 DCHECK_EQ(2, args.length()); 156 DCHECK_EQ(2, args.length());
157 CONVERT_ARG_HANDLE_CHECKED(JSReceiver, receiver, 0); 157 CONVERT_ARG_HANDLE_CHECKED(JSReceiver, receiver, 0);
158 CONVERT_ARG_HANDLE_CHECKED(Object, key, 1); 158 CONVERT_ARG_HANDLE_CHECKED(Object, key, 1);
159 RETURN_RESULT_OR_FAILURE(isolate, 159 RETURN_RESULT_OR_FAILURE(isolate,
160 HasEnumerableProperty(isolate, receiver, key)); 160 HasEnumerableProperty(isolate, receiver, key));
161 } 161 }
162 162
163
164 RUNTIME_FUNCTION(Runtime_ForInNext) {
165 HandleScope scope(isolate);
166 DCHECK_EQ(4, args.length());
167 CONVERT_ARG_HANDLE_CHECKED(JSReceiver, receiver, 0);
168 CONVERT_ARG_HANDLE_CHECKED(FixedArray, cache_array, 1);
169 CONVERT_ARG_HANDLE_CHECKED(Object, cache_type, 2);
170 CONVERT_SMI_ARG_CHECKED(index, 3);
171 Handle<Object> key = handle(cache_array->get(index), isolate);
172 // Don't need filtering if expected map still matches that of the receiver.
173 if (receiver->map() == *cache_type) {
174 return *key;
175 }
176 RETURN_RESULT_OR_FAILURE(isolate,
177 HasEnumerableProperty(isolate, receiver, key));
178 }
179
180 } // namespace internal 163 } // namespace internal
181 } // namespace v8 164 } // namespace v8
OLDNEW
« src/builtins/builtins-object.cc ('K') | « src/runtime/runtime.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698