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

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

Issue 1330153003: Adding template parameter to PrototypeIterator GetCurrent for casting (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: simplifications Created 5 years, 3 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/runtime/runtime-array.cc ('k') | src/string-stream.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 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 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/bootstrapper.h" 8 #include "src/bootstrapper.h"
9 #include "src/debug/debug.h" 9 #include "src/debug/debug.h"
10 #include "src/isolate-inl.h" 10 #include "src/isolate-inl.h"
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
177 177
178 RUNTIME_FUNCTION(Runtime_GetPrototype) { 178 RUNTIME_FUNCTION(Runtime_GetPrototype) {
179 HandleScope scope(isolate); 179 HandleScope scope(isolate);
180 DCHECK(args.length() == 1); 180 DCHECK(args.length() == 1);
181 CONVERT_ARG_HANDLE_CHECKED(Object, obj, 0); 181 CONVERT_ARG_HANDLE_CHECKED(Object, obj, 0);
182 // We don't expect access checks to be needed on JSProxy objects. 182 // We don't expect access checks to be needed on JSProxy objects.
183 DCHECK(!obj->IsAccessCheckNeeded() || obj->IsJSObject()); 183 DCHECK(!obj->IsAccessCheckNeeded() || obj->IsJSObject());
184 PrototypeIterator iter(isolate, obj, PrototypeIterator::START_AT_RECEIVER); 184 PrototypeIterator iter(isolate, obj, PrototypeIterator::START_AT_RECEIVER);
185 do { 185 do {
186 if (PrototypeIterator::GetCurrent(iter)->IsAccessCheckNeeded() && 186 if (PrototypeIterator::GetCurrent(iter)->IsAccessCheckNeeded() &&
187 !isolate->MayAccess( 187 !isolate->MayAccess(PrototypeIterator::GetCurrent<JSObject>(iter))) {
188 Handle<JSObject>::cast(PrototypeIterator::GetCurrent(iter)))) {
189 return isolate->heap()->null_value(); 188 return isolate->heap()->null_value();
190 } 189 }
191 iter.AdvanceIgnoringProxies(); 190 iter.AdvanceIgnoringProxies();
192 if (PrototypeIterator::GetCurrent(iter)->IsJSProxy()) { 191 if (PrototypeIterator::GetCurrent(iter)->IsJSProxy()) {
193 return *PrototypeIterator::GetCurrent(iter); 192 return *PrototypeIterator::GetCurrent(iter);
194 } 193 }
195 } while (!iter.IsAtEnd(PrototypeIterator::END_AT_NON_HIDDEN)); 194 } while (!iter.IsAtEnd(PrototypeIterator::END_AT_NON_HIDDEN));
196 return *PrototypeIterator::GetCurrent(iter); 195 return *PrototypeIterator::GetCurrent(iter);
197 } 196 }
198 197
(...skipping 1355 matching lines...) Expand 10 before | Expand all | Expand 10 after
1554 RUNTIME_FUNCTION(Runtime_CreateIterResultObject) { 1553 RUNTIME_FUNCTION(Runtime_CreateIterResultObject) {
1555 HandleScope scope(isolate); 1554 HandleScope scope(isolate);
1556 DCHECK_EQ(2, args.length()); 1555 DCHECK_EQ(2, args.length());
1557 CONVERT_ARG_HANDLE_CHECKED(Object, value, 0); 1556 CONVERT_ARG_HANDLE_CHECKED(Object, value, 0);
1558 CONVERT_ARG_HANDLE_CHECKED(Object, done, 1); 1557 CONVERT_ARG_HANDLE_CHECKED(Object, done, 1);
1559 return *isolate->factory()->NewJSIteratorResult(value, done); 1558 return *isolate->factory()->NewJSIteratorResult(value, done);
1560 } 1559 }
1561 1560
1562 } // namespace internal 1561 } // namespace internal
1563 } // namespace v8 1562 } // namespace v8
OLDNEW
« no previous file with comments | « src/runtime/runtime-array.cc ('k') | src/string-stream.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698