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

Side by Side Diff: src/api.cc

Issue 1159433003: Use GetProperty for getting elements. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Addressed comments Created 5 years, 6 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/array.js » ('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 6617 matching lines...) Expand 10 before | Expand all | Expand 10 after
6628 6628
6629 6629
6630 size_t v8::ArrayBufferView::ByteLength() { 6630 size_t v8::ArrayBufferView::ByteLength() {
6631 i::Handle<i::JSArrayBufferView> obj = Utils::OpenHandle(this); 6631 i::Handle<i::JSArrayBufferView> obj = Utils::OpenHandle(this);
6632 return static_cast<size_t>(obj->byte_length()->Number()); 6632 return static_cast<size_t>(obj->byte_length()->Number());
6633 } 6633 }
6634 6634
6635 6635
6636 size_t v8::TypedArray::Length() { 6636 size_t v8::TypedArray::Length() {
6637 i::Handle<i::JSTypedArray> obj = Utils::OpenHandle(this); 6637 i::Handle<i::JSTypedArray> obj = Utils::OpenHandle(this);
6638 return static_cast<size_t>(obj->length()->Number()); 6638 return static_cast<size_t>(obj->length_value());
6639 } 6639 }
6640 6640
6641 6641
6642 #define TYPED_ARRAY_NEW(Type, type, TYPE, ctype, size) \ 6642 #define TYPED_ARRAY_NEW(Type, type, TYPE, ctype, size) \
6643 Local<Type##Array> Type##Array::New(Handle<ArrayBuffer> array_buffer, \ 6643 Local<Type##Array> Type##Array::New(Handle<ArrayBuffer> array_buffer, \
6644 size_t byte_offset, size_t length) { \ 6644 size_t byte_offset, size_t length) { \
6645 i::Isolate* isolate = Utils::OpenHandle(*array_buffer)->GetIsolate(); \ 6645 i::Isolate* isolate = Utils::OpenHandle(*array_buffer)->GetIsolate(); \
6646 LOG_API(isolate, \ 6646 LOG_API(isolate, \
6647 "v8::" #Type "Array::New(Handle<ArrayBuffer>, size_t, size_t)"); \ 6647 "v8::" #Type "Array::New(Handle<ArrayBuffer>, size_t, size_t)"); \
6648 ENTER_V8(isolate); \ 6648 ENTER_V8(isolate); \
(...skipping 1713 matching lines...) Expand 10 before | Expand all | Expand 10 after
8362 Address callback_address = 8362 Address callback_address =
8363 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); 8363 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback));
8364 VMState<EXTERNAL> state(isolate); 8364 VMState<EXTERNAL> state(isolate);
8365 ExternalCallbackScope call_scope(isolate, callback_address); 8365 ExternalCallbackScope call_scope(isolate, callback_address);
8366 callback(info); 8366 callback(info);
8367 } 8367 }
8368 8368
8369 8369
8370 } // namespace internal 8370 } // namespace internal
8371 } // namespace v8 8371 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | src/array.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698