diff options
Diffstat (limited to 'deps/v8/src/ic/handler-configuration-inl.h')
-rw-r--r-- | deps/v8/src/ic/handler-configuration-inl.h | 104 |
1 files changed, 102 insertions, 2 deletions
diff --git a/deps/v8/src/ic/handler-configuration-inl.h b/deps/v8/src/ic/handler-configuration-inl.h index 75bda11cd1..d5b432b363 100644 --- a/deps/v8/src/ic/handler-configuration-inl.h +++ b/deps/v8/src/ic/handler-configuration-inl.h @@ -5,9 +5,10 @@ #ifndef V8_IC_HANDLER_CONFIGURATION_INL_H_ #define V8_IC_HANDLER_CONFIGURATION_INL_H_ -#include "src/ic/handler-configuration.h" - +#include "src/builtins/builtins.h" +#include "src/execution/isolate.h" #include "src/handles/handles-inl.h" +#include "src/ic/handler-configuration.h" #include "src/objects/data-handler-inl.h" #include "src/objects/field-index-inl.h" #include "src/objects/objects-inl.h" @@ -19,6 +20,15 @@ namespace v8 { namespace internal { +inline Handle<Object> MakeCodeHandler(Isolate* isolate, Builtin builtin) { + if (V8_EXTERNAL_CODE_SPACE_BOOL) { + Code code = isolate->builtins()->code(builtin); + return handle(code.code_data_container(kAcquireLoad), isolate); + } else { + return isolate->builtins()->code_handle(builtin); + } +} + OBJECT_CONSTRUCTORS_IMPL(LoadHandler, DataHandler) CAST_ACCESSOR(LoadHandler) @@ -56,6 +66,14 @@ Handle<Smi> LoadHandler::LoadField(Isolate* isolate, FieldIndex field_index) { return handle(Smi::FromInt(config), isolate); } +Handle<Smi> LoadHandler::LoadWasmStructField(Isolate* isolate, + WasmValueType type, int offset) { + int config = KindBits::encode(kField) | IsWasmStructBits::encode(true) | + WasmFieldTypeBits::encode(type) | + WasmFieldOffsetBits::encode(offset); + return handle(Smi::FromInt(config), isolate); +} + Handle<Smi> LoadHandler::LoadConstantFromPrototype(Isolate* isolate) { int config = KindBits::encode(kConstantFromPrototype); return handle(Smi::FromInt(config), isolate); @@ -118,6 +136,13 @@ Handle<Smi> LoadHandler::LoadIndexedString(Isolate* isolate, return handle(Smi::FromInt(config), isolate); } +Handle<Smi> LoadHandler::LoadWasmArrayElement(Isolate* isolate, + WasmValueType type) { + int config = KindBits::encode(kElement) | IsWasmArrayBits::encode(true) | + WasmArrayTypeBits::encode(type); + return handle(Smi::FromInt(config), isolate); +} + OBJECT_CONSTRUCTORS_IMPL(StoreHandler, DataHandler) CAST_ACCESSOR(StoreHandler) @@ -137,6 +162,52 @@ Handle<Smi> StoreHandler::StoreInterceptor(Isolate* isolate) { return handle(Smi::FromInt(config), isolate); } +Builtin StoreHandler::StoreSloppyArgumentsBuiltin(KeyedAccessStoreMode mode) { + switch (mode) { + case STANDARD_STORE: + return Builtin::kKeyedStoreIC_SloppyArguments_Standard; + case STORE_AND_GROW_HANDLE_COW: + return Builtin::kKeyedStoreIC_SloppyArguments_GrowNoTransitionHandleCOW; + case STORE_IGNORE_OUT_OF_BOUNDS: + return Builtin::kKeyedStoreIC_SloppyArguments_NoTransitionIgnoreOOB; + case STORE_HANDLE_COW: + return Builtin::kKeyedStoreIC_SloppyArguments_NoTransitionHandleCOW; + default: + UNREACHABLE(); + } +} + +Builtin StoreHandler::StoreFastElementBuiltin(KeyedAccessStoreMode mode) { + switch (mode) { + case STANDARD_STORE: + return Builtin::kStoreFastElementIC_Standard; + case STORE_AND_GROW_HANDLE_COW: + return Builtin::kStoreFastElementIC_GrowNoTransitionHandleCOW; + case STORE_IGNORE_OUT_OF_BOUNDS: + return Builtin::kStoreFastElementIC_NoTransitionIgnoreOOB; + case STORE_HANDLE_COW: + return Builtin::kStoreFastElementIC_NoTransitionHandleCOW; + default: + UNREACHABLE(); + } +} + +Builtin StoreHandler::ElementsTransitionAndStoreBuiltin( + KeyedAccessStoreMode mode) { + switch (mode) { + case STANDARD_STORE: + return Builtin::kElementsTransitionAndStore_Standard; + case STORE_AND_GROW_HANDLE_COW: + return Builtin::kElementsTransitionAndStore_GrowNoTransitionHandleCOW; + case STORE_IGNORE_OUT_OF_BOUNDS: + return Builtin::kElementsTransitionAndStore_NoTransitionIgnoreOOB; + case STORE_HANDLE_COW: + return Builtin::kElementsTransitionAndStore_NoTransitionHandleCOW; + default: + UNREACHABLE(); + } +} + Handle<Smi> StoreHandler::StoreSlow(Isolate* isolate, KeyedAccessStoreMode store_mode) { int config = @@ -190,6 +261,35 @@ Handle<Smi> StoreHandler::StoreApiSetter(Isolate* isolate, return handle(Smi::FromInt(config), isolate); } +inline const char* WasmValueType2String(WasmValueType type) { + switch (type) { + case WasmValueType::kI8: + return "i8"; + case WasmValueType::kI16: + return "i16"; + case WasmValueType::kI32: + return "i32"; + case WasmValueType::kU32: + return "u32"; + case WasmValueType::kI64: + return "i64"; + case WasmValueType::kF32: + return "f32"; + case WasmValueType::kF64: + return "f64"; + case WasmValueType::kS128: + return "s128"; + + case WasmValueType::kRef: + return "Ref"; + case WasmValueType::kOptRef: + return "OptRef"; + + case WasmValueType::kNumTypes: + return "???"; + } +} + } // namespace internal } // namespace v8 |