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

Side by Side Diff: src/api.cc

Issue 1221303019: Fix keyed access of primitive objects in the runtime. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix Created 5 years, 5 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/execution.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 3440 matching lines...) Expand 10 before | Expand all | Expand 10 after
3451 auto context = ContextFromHeapObject(Utils::OpenHandle(this)); 3451 auto context = ContextFromHeapObject(Utils::OpenHandle(this));
3452 return Set(context, key, value).FromMaybe(false); 3452 return Set(context, key, value).FromMaybe(false);
3453 } 3453 }
3454 3454
3455 3455
3456 Maybe<bool> v8::Object::Set(v8::Local<v8::Context> context, uint32_t index, 3456 Maybe<bool> v8::Object::Set(v8::Local<v8::Context> context, uint32_t index,
3457 v8::Local<Value> value) { 3457 v8::Local<Value> value) {
3458 PREPARE_FOR_EXECUTION_PRIMITIVE(context, "v8::Object::Set()", bool); 3458 PREPARE_FOR_EXECUTION_PRIMITIVE(context, "v8::Object::Set()", bool);
3459 auto self = Utils::OpenHandle(this); 3459 auto self = Utils::OpenHandle(this);
3460 auto value_obj = Utils::OpenHandle(*value); 3460 auto value_obj = Utils::OpenHandle(*value);
3461 has_pending_exception = 3461 has_pending_exception = i::Object::SetElement(isolate, self, index, value_obj,
3462 i::JSReceiver::SetElement(self, index, value_obj, i::SLOPPY).is_null(); 3462 i::SLOPPY).is_null();
3463 RETURN_ON_FAILED_EXECUTION_PRIMITIVE(bool); 3463 RETURN_ON_FAILED_EXECUTION_PRIMITIVE(bool);
3464 return Just(true); 3464 return Just(true);
3465 } 3465 }
3466 3466
3467 3467
3468 bool v8::Object::Set(uint32_t index, v8::Local<Value> value) { 3468 bool v8::Object::Set(uint32_t index, v8::Local<Value> value) {
3469 auto context = ContextFromHeapObject(Utils::OpenHandle(this)); 3469 auto context = ContextFromHeapObject(Utils::OpenHandle(this));
3470 return Set(context, index, value).FromMaybe(false); 3470 return Set(context, index, value).FromMaybe(false);
3471 } 3471 }
3472 3472
(...skipping 4938 matching lines...) Expand 10 before | Expand all | Expand 10 after
8411 Address callback_address = 8411 Address callback_address =
8412 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); 8412 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback));
8413 VMState<EXTERNAL> state(isolate); 8413 VMState<EXTERNAL> state(isolate);
8414 ExternalCallbackScope call_scope(isolate, callback_address); 8414 ExternalCallbackScope call_scope(isolate, callback_address);
8415 callback(info); 8415 callback(info);
8416 } 8416 }
8417 8417
8418 8418
8419 } // namespace internal 8419 } // namespace internal
8420 } // namespace v8 8420 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | src/execution.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698