V8 Project
runtime-typedarray.cc File Reference
#include "src/v8.h"
#include "src/arguments.h"
#include "src/runtime/runtime.h"
#include "src/runtime/runtime-utils.h"
+ Include dependency graph for runtime-typedarray.cc:

Go to the source code of this file.

Namespaces

 v8
 Debugger support for the V8 JavaScript engine.
 
 v8::internal
 

Macros

#define ARRAY_ID_CASE(Type, type, TYPE, ctype, size)
 
#define BUFFER_VIEW_GETTER(Type, getter, accessor)
 
#define DATA_VIEW_GETTER(TypeName, Type, Converter)
 
#define DATA_VIEW_SETTER(TypeName, Type)
 

Enumerations

enum  v8::internal::TypedArraySetResultCodes { v8::internal::TYPED_ARRAY_SET_TYPED_ARRAY_SAME_TYPE = 0 , v8::internal::TYPED_ARRAY_SET_TYPED_ARRAY_OVERLAPPING = 1 , v8::internal::TYPED_ARRAY_SET_TYPED_ARRAY_NONOVERLAPPING = 2 , v8::internal::TYPED_ARRAY_SET_NON_TYPED_ARRAY = 3 }
 

Functions

 v8::internal::RUNTIME_FUNCTION (Runtime_ArrayBufferInitialize)
 
 v8::internal::RUNTIME_FUNCTION (Runtime_ArrayBufferGetByteLength)
 
 v8::internal::RUNTIME_FUNCTION (Runtime_ArrayBufferSliceImpl)
 
 v8::internal::RUNTIME_FUNCTION (Runtime_ArrayBufferIsView)
 
 v8::internal::RUNTIME_FUNCTION (Runtime_ArrayBufferNeuter)
 
 v8::internal::RUNTIME_FUNCTION (Runtime_TypedArrayInitialize)
 
 v8::internal::RUNTIME_FUNCTION (Runtime_TypedArrayInitializeFromArrayLike)
 
 v8::internal::RUNTIME_FUNCTION (Runtime_TypedArrayGetBuffer)
 
 v8::internal::RUNTIME_FUNCTION (Runtime_TypedArraySetFastCases)
 
 v8::internal::RUNTIME_FUNCTION (Runtime_TypedArrayMaxSizeInHeap)
 
 v8::internal::RUNTIME_FUNCTION (Runtime_DataViewInitialize)
 
static bool v8::internal::NeedToFlipBytes (bool is_little_endian)
 
template<int n>
void v8::internal::CopyBytes (uint8_t *target, uint8_t *source)
 
template<int n>
void v8::internal::FlipBytes (uint8_t *target, uint8_t *source)
 
template<typename T >
static bool v8::internal::DataViewGetValue (Isolate *isolate, Handle< JSDataView > data_view, Handle< Object > byte_offset_obj, bool is_little_endian, T *result)
 
template<typename T >
static bool v8::internal::DataViewSetValue (Isolate *isolate, Handle< JSDataView > data_view, Handle< Object > byte_offset_obj, bool is_little_endian, T data)
 
template<typename T >
static T v8::internal::DataViewConvertValue (double value)
 
template<>
int8_t v8::internal::DataViewConvertValue< int8_t > (double value)
 
template<>
int16_t v8::internal::DataViewConvertValue< int16_t > (double value)
 
template<>
int32_t v8::internal::DataViewConvertValue< int32_t > (double value)
 
template<>
uint8_t v8::internal::DataViewConvertValue< uint8_t > (double value)
 
template<>
uint16_t v8::internal::DataViewConvertValue< uint16_t > (double value)
 
template<>
uint32_t v8::internal::DataViewConvertValue< uint32_t > (double value)
 
template<>
float v8::internal::DataViewConvertValue< float > (double value)
 
template<>
double v8::internal::DataViewConvertValue< double > (double value)
 

Macro Definition Documentation

◆ ARRAY_ID_CASE

#define ARRAY_ID_CASE (   Type,
  type,
  TYPE,
  ctype,
  size 
)
Value:
case ARRAY_ID_##TYPE: \
*array_type = kExternal##Type##Array; \
*external_elements_kind = EXTERNAL_##TYPE##_ELEMENTS; \
*fixed_elements_kind = TYPE##_ELEMENTS; \
*element_size = size; \
break;
enable harmony numeric enable harmony object literal extensions Optimize object size
TypeImpl< ZoneTypeConfig > Type

◆ BUFFER_VIEW_GETTER

#define BUFFER_VIEW_GETTER (   Type,
  getter,
  accessor 
)
Value:
RUNTIME_FUNCTION(Runtime_##Type##Get##getter) { \
HandleScope scope(isolate); \
DCHECK(args.length() == 1); \
CONVERT_ARG_HANDLE_CHECKED(JS##Type, holder, 0); \
return holder->accessor(); \
}
#define RUNTIME_FUNCTION(Name)
Definition: arguments.h:296

Definition at line 395 of file runtime-typedarray.cc.

◆ DATA_VIEW_GETTER

#define DATA_VIEW_GETTER (   TypeName,
  Type,
  Converter 
)
Value:
RUNTIME_FUNCTION(Runtime_DataViewGet##TypeName) { \
HandleScope scope(isolate); \
DCHECK(args.length() == 3); \
CONVERT_ARG_HANDLE_CHECKED(JSDataView, holder, 0); \
CONVERT_NUMBER_ARG_HANDLE_CHECKED(offset, 1); \
CONVERT_BOOLEAN_ARG_CHECKED(is_little_endian, 2); \
Type result; \
if (DataViewGetValue(isolate, holder, offset, is_little_endian, \
&result)) { \
return *isolate->factory()->Converter(result); \
} else { \
THROW_NEW_ERROR_RETURN_FAILURE( \
isolate, NewRangeError("invalid_data_view_accessor_offset", \
HandleVector<Object>(NULL, 0))); \
} \
}
enable harmony numeric enable harmony object literal extensions Optimize object Array DOM strings and string trace pretenuring decisions of HAllocate instructions Enables optimizations which favor memory size over execution speed maximum source size in bytes considered for a single inlining maximum cumulative number of AST nodes considered for inlining trace the tracking of allocation sites deoptimize every n garbage collections perform array bounds checks elimination analyze liveness of environment slots and zap dead values flushes the cache of optimized code for closures on every GC allow uint32 values on optimize frames if they are used only in safe operations track concurrent recompilation artificial compilation delay in ms do not emit check maps for constant values that have a leaf deoptimize the optimized code if the layout of the maps changes enable context specialization in TurboFan execution budget before interrupt is triggered max percentage of megamorphic generic ICs to allow optimization enable use of SAHF instruction if enable use of VFP3 instructions if available enable use of NEON instructions if enable use of SDIV and UDIV instructions if enable use of MLS instructions if enable loading bit constant by means of movw movt instruction enable unaligned accesses for enable use of d16 d31 registers on ARM this requires VFP3 force all emitted branches to be in long enable alignment of csp to bytes on platforms which prefer the register to always be NULL
static bool DataViewGetValue(Isolate *isolate, Handle< JSDataView > data_view, Handle< Object > byte_offset_obj, bool is_little_endian, T *result)

Definition at line 649 of file runtime-typedarray.cc.

◆ DATA_VIEW_SETTER

#define DATA_VIEW_SETTER (   TypeName,
  Type 
)
Value:
RUNTIME_FUNCTION(Runtime_DataViewSet##TypeName) { \
HandleScope scope(isolate); \
DCHECK(args.length() == 4); \
CONVERT_ARG_HANDLE_CHECKED(JSDataView, holder, 0); \
CONVERT_NUMBER_ARG_HANDLE_CHECKED(offset, 1); \
CONVERT_NUMBER_ARG_HANDLE_CHECKED(value, 2); \
CONVERT_BOOLEAN_ARG_CHECKED(is_little_endian, 3); \
Type v = DataViewConvertValue<Type>(value->Number()); \
if (DataViewSetValue(isolate, holder, offset, is_little_endian, v)) { \
return isolate->heap()->undefined_value(); \
} else { \
THROW_NEW_ERROR_RETURN_FAILURE( \
isolate, NewRangeError("invalid_data_view_accessor_offset", \
HandleVector<Object>(NULL, 0))); \
} \
}
static bool DataViewSetValue(Isolate *isolate, Handle< JSDataView > data_view, Handle< Object > byte_offset_obj, bool is_little_endian, T data)

Definition at line 731 of file runtime-typedarray.cc.