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

Unified 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: 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 side-by-side diff with in-line comments
Download patch
Index: src/runtime/runtime-object.cc
diff --git a/src/runtime/runtime-object.cc b/src/runtime/runtime-object.cc
index 6287c98f3eb00e43a783a9df1edfe6d59301c246..ba76a3d1c13a6dbe569a9f21eb4f7f6d687b08a0 100644
--- a/src/runtime/runtime-object.cc
+++ b/src/runtime/runtime-object.cc
@@ -182,8 +182,7 @@ MaybeHandle<Object> Runtime::GetPrototype(Isolate* isolate,
PrototypeIterator iter(isolate, obj, PrototypeIterator::START_AT_RECEIVER);
do {
if (PrototypeIterator::GetCurrent(iter)->IsAccessCheckNeeded() &&
- !isolate->MayAccess(
- Handle<JSObject>::cast(PrototypeIterator::GetCurrent(iter)))) {
+ !isolate->MayAccess(PrototypeIterator::GetCurrent<JSObject>(iter))) {
return isolate->factory()->null_value();
}
iter.AdvanceIgnoringProxies();
@@ -694,14 +693,13 @@ static Object* HasOwnPropertyImplementation(Isolate* isolate,
// look like they are on this object.
PrototypeIterator iter(isolate, object);
if (!iter.IsAtEnd() &&
- Handle<JSObject>::cast(PrototypeIterator::GetCurrent(iter))
+ PrototypeIterator::GetCurrent<JSObject>(iter)
->map()
->is_hidden_prototype()) {
// TODO(verwaest): The recursion is not necessary for keys that are array
// indices. Removing this.
return HasOwnPropertyImplementation(
- isolate, Handle<JSObject>::cast(PrototypeIterator::GetCurrent(iter)),
- key);
+ isolate, PrototypeIterator::GetCurrent<JSObject>(iter), key);
}
RETURN_FAILURE_IF_SCHEDULED_EXCEPTION(isolate);
return isolate->heap()->false_value();
@@ -839,8 +837,7 @@ RUNTIME_FUNCTION(Runtime_GetOwnPropertyNames) {
for (PrototypeIterator iter(isolate, object,
PrototypeIterator::START_AT_RECEIVER);
!iter.IsAtEnd(PrototypeIterator::END_AT_NON_HIDDEN); iter.Advance()) {
- Handle<JSObject> jsproto =
- Handle<JSObject>::cast(PrototypeIterator::GetCurrent(iter));
+ Handle<JSObject> jsproto = PrototypeIterator::GetCurrent<JSObject>(iter);
total_property_count += jsproto->NumberOfOwnProperties(filter);
}
@@ -855,8 +852,7 @@ RUNTIME_FUNCTION(Runtime_GetOwnPropertyNames) {
for (PrototypeIterator iter(isolate, object,
PrototypeIterator::START_AT_RECEIVER);
!iter.IsAtEnd(PrototypeIterator::END_AT_NON_HIDDEN); iter.Advance()) {
- Handle<JSObject> jsproto =
- Handle<JSObject>::cast(PrototypeIterator::GetCurrent(iter));
+ Handle<JSObject> jsproto = PrototypeIterator::GetCurrent<JSObject>(iter);
int own = jsproto->GetOwnPropertyNames(*names, next_copy_index, filter);
// Names from hidden prototypes may already have been added
// for inherited function template instances. Count the duplicates
« src/prototype.h ('K') | « 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