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

Side by Side Diff: src/api.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 | « no previous file | src/builtins.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 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/api.h" 5 #include "src/api.h"
6 6
7 #include <string.h> // For memcpy, strlen. 7 #include <string.h> // For memcpy, strlen.
8 #ifdef V8_USE_ADDRESS_SANITIZER 8 #ifdef V8_USE_ADDRESS_SANITIZER
9 #include <sanitizer/asan_interface.h> 9 #include <sanitizer/asan_interface.h>
10 #endif // V8_USE_ADDRESS_SANITIZER 10 #endif // V8_USE_ADDRESS_SANITIZER
(...skipping 3684 matching lines...) Expand 10 before | Expand all | Expand 10 after
3695 auto isolate = Utils::OpenHandle(this)->GetIsolate(); 3695 auto isolate = Utils::OpenHandle(this)->GetIsolate();
3696 i::PrototypeIterator iter(isolate, *Utils::OpenHandle(this), 3696 i::PrototypeIterator iter(isolate, *Utils::OpenHandle(this),
3697 i::PrototypeIterator::START_AT_RECEIVER); 3697 i::PrototypeIterator::START_AT_RECEIVER);
3698 auto tmpl_info = *Utils::OpenHandle(*tmpl); 3698 auto tmpl_info = *Utils::OpenHandle(*tmpl);
3699 while (!tmpl_info->IsTemplateFor(iter.GetCurrent())) { 3699 while (!tmpl_info->IsTemplateFor(iter.GetCurrent())) {
3700 iter.Advance(); 3700 iter.Advance();
3701 if (iter.IsAtEnd()) { 3701 if (iter.IsAtEnd()) {
3702 return Local<Object>(); 3702 return Local<Object>();
3703 } 3703 }
3704 } 3704 }
3705 return Utils::ToLocal( 3705 return Utils::ToLocal(i::handle(iter.GetCurrent<i::JSObject>(), isolate));
3706 i::handle(i::JSObject::cast(iter.GetCurrent()), isolate));
3707 } 3706 }
3708 3707
3709 3708
3710 MaybeLocal<Array> v8::Object::GetPropertyNames(Local<Context> context) { 3709 MaybeLocal<Array> v8::Object::GetPropertyNames(Local<Context> context) {
3711 PREPARE_FOR_EXECUTION(context, "v8::Object::GetPropertyNames()", Array); 3710 PREPARE_FOR_EXECUTION(context, "v8::Object::GetPropertyNames()", Array);
3712 auto self = Utils::OpenHandle(this); 3711 auto self = Utils::OpenHandle(this);
3713 i::Handle<i::FixedArray> value; 3712 i::Handle<i::FixedArray> value;
3714 has_pending_exception = !i::JSReceiver::GetKeys( 3713 has_pending_exception = !i::JSReceiver::GetKeys(
3715 self, i::JSReceiver::INCLUDE_PROTOS).ToHandle(&value); 3714 self, i::JSReceiver::INCLUDE_PROTOS).ToHandle(&value);
3716 RETURN_ON_FAILED_EXECUTION(Array); 3715 RETURN_ON_FAILED_EXECUTION(Array);
(...skipping 4686 matching lines...) Expand 10 before | Expand all | Expand 10 after
8403 Address callback_address = 8402 Address callback_address =
8404 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); 8403 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback));
8405 VMState<EXTERNAL> state(isolate); 8404 VMState<EXTERNAL> state(isolate);
8406 ExternalCallbackScope call_scope(isolate, callback_address); 8405 ExternalCallbackScope call_scope(isolate, callback_address);
8407 callback(info); 8406 callback(info);
8408 } 8407 }
8409 8408
8410 8409
8411 } // namespace internal 8410 } // namespace internal
8412 } // namespace v8 8411 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | src/builtins.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698