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

Side by Side Diff: src/api.cc

Issue 1138723003: Fix has_pending_exception logic in API's Array::CloneElementAt (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 7 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 | 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 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 6054 matching lines...) Expand 10 before | Expand all | Expand 10 after
6065 MaybeLocal<Object> Array::CloneElementAt(Local<Context> context, 6065 MaybeLocal<Object> Array::CloneElementAt(Local<Context> context,
6066 uint32_t index) { 6066 uint32_t index) {
6067 PREPARE_FOR_EXECUTION(context, "v8::Array::CloneElementAt()", Object); 6067 PREPARE_FOR_EXECUTION(context, "v8::Array::CloneElementAt()", Object);
6068 auto self = Utils::OpenHandle(this); 6068 auto self = Utils::OpenHandle(this);
6069 if (!self->HasFastObjectElements()) return Local<Object>(); 6069 if (!self->HasFastObjectElements()) return Local<Object>();
6070 i::FixedArray* elms = i::FixedArray::cast(self->elements()); 6070 i::FixedArray* elms = i::FixedArray::cast(self->elements());
6071 i::Object* paragon = elms->get(index); 6071 i::Object* paragon = elms->get(index);
6072 if (!paragon->IsJSObject()) return Local<Object>(); 6072 if (!paragon->IsJSObject()) return Local<Object>();
6073 i::Handle<i::JSObject> paragon_handle(i::JSObject::cast(paragon)); 6073 i::Handle<i::JSObject> paragon_handle(i::JSObject::cast(paragon));
6074 Local<Object> result; 6074 Local<Object> result;
6075 has_pending_exception = ToLocal<Object>( 6075 has_pending_exception =
6076 isolate->factory()->CopyJSObject(paragon_handle), &result); 6076 !ToLocal<Object>(isolate->factory()->CopyJSObject(paragon_handle),
6077 &result);
6077 RETURN_ON_FAILED_EXECUTION(Object); 6078 RETURN_ON_FAILED_EXECUTION(Object);
6078 RETURN_ESCAPED(result); 6079 RETURN_ESCAPED(result);
6079 } 6080 }
6080 6081
6081 6082
6082 Local<Object> Array::CloneElementAt(uint32_t index) { 6083 Local<Object> Array::CloneElementAt(uint32_t index) {
6083 auto context = ContextFromHeapObject(Utils::OpenHandle(this)); 6084 auto context = ContextFromHeapObject(Utils::OpenHandle(this));
6084 RETURN_TO_LOCAL_UNCHECKED(CloneElementAt(context, index), Object); 6085 RETURN_TO_LOCAL_UNCHECKED(CloneElementAt(context, index), Object);
6085 } 6086 }
6086 6087
(...skipping 1945 matching lines...) Expand 10 before | Expand all | Expand 10 after
8032 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate()); 8033 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate());
8033 Address callback_address = 8034 Address callback_address =
8034 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); 8035 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback));
8035 VMState<EXTERNAL> state(isolate); 8036 VMState<EXTERNAL> state(isolate);
8036 ExternalCallbackScope call_scope(isolate, callback_address); 8037 ExternalCallbackScope call_scope(isolate, callback_address);
8037 callback(info); 8038 callback(info);
8038 } 8039 }
8039 8040
8040 8041
8041 } } // namespace v8::internal 8042 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698