#include "src/codegen/code-factory.h"
#include "src/builtins/builtins-descriptors.h"
#include "src/builtins/builtins-inl.h"
#include "src/ic/ic.h"
#include "src/init/bootstrapper.h"
#include "src/objects/allocation-site-inl.h"
#include "src/objects/objects-inl.h"
namespace v8 {
namespace internal {
Handle<Code> CodeFactory::RuntimeCEntry(Isolate* isolate, int result_size,
bool switch_to_central_stack) { … }
Handle<Code> CodeFactory::CEntry(Isolate* isolate, int result_size,
ArgvMode argv_mode, bool builtin_exit_frame,
bool switch_to_central_stack) { … }
Callable CodeFactory::LoadGlobalIC(Isolate* isolate, TypeofMode typeof_mode) { … }
Callable CodeFactory::LoadGlobalICInOptimizedCode(Isolate* isolate,
TypeofMode typeof_mode) { … }
Callable CodeFactory::DefineNamedOwnIC(Isolate* isolate) { … }
Callable CodeFactory::DefineNamedOwnICInOptimizedCode(Isolate* isolate) { … }
Callable CodeFactory::StringAdd(Isolate* isolate, StringAddFlags flags) { … }
Callable CodeFactory::FastNewFunctionContext(Isolate* isolate,
ScopeType scope_type) { … }
Callable CodeFactory::Call(Isolate* isolate, ConvertReceiverMode mode) { … }
Callable CodeFactory::Call_WithFeedback(Isolate* isolate,
ConvertReceiverMode mode) { … }
Callable CodeFactory::CallWithArrayLike(Isolate* isolate) { … }
Callable CodeFactory::CallWithSpread(Isolate* isolate) { … }
Callable CodeFactory::CallFunction(Isolate* isolate, ConvertReceiverMode mode) { … }
Callable CodeFactory::CallForwardVarargs(Isolate* isolate) { … }
Callable CodeFactory::CallFunctionForwardVarargs(Isolate* isolate) { … }
Callable CodeFactory::Construct(Isolate* isolate) { … }
Callable CodeFactory::ConstructWithSpread(Isolate* isolate) { … }
Callable CodeFactory::ConstructForwardVarargs(Isolate* isolate) { … }
Callable CodeFactory::ConstructFunctionForwardVarargs(Isolate* isolate) { … }
Callable CodeFactory::ArrayNoArgumentConstructor(
Isolate* isolate, ElementsKind kind,
AllocationSiteOverrideMode override_mode) { … }
Callable CodeFactory::ArraySingleArgumentConstructor(
Isolate* isolate, ElementsKind kind,
AllocationSiteOverrideMode override_mode) { … }
#ifdef V8_IS_TSAN
Builtin CodeFactory::GetTSANStoreStub(SaveFPRegsMode fp_mode, int size,
std::memory_order order) {
if (order == std::memory_order_relaxed) {
if (size == kInt8Size) {
return fp_mode == SaveFPRegsMode::kIgnore
? Builtin::kTSANRelaxedStore8IgnoreFP
: Builtin::kTSANRelaxedStore8SaveFP;
} else if (size == kInt16Size) {
return fp_mode == SaveFPRegsMode::kIgnore
? Builtin::kTSANRelaxedStore16IgnoreFP
: Builtin::kTSANRelaxedStore16SaveFP;
} else if (size == kInt32Size) {
return fp_mode == SaveFPRegsMode::kIgnore
? Builtin::kTSANRelaxedStore32IgnoreFP
: Builtin::kTSANRelaxedStore32SaveFP;
} else {
CHECK_EQ(size, kInt64Size);
return fp_mode == SaveFPRegsMode::kIgnore
? Builtin::kTSANRelaxedStore64IgnoreFP
: Builtin::kTSANRelaxedStore64SaveFP;
}
} else {
DCHECK_EQ(order, std::memory_order_seq_cst);
if (size == kInt8Size) {
return fp_mode == SaveFPRegsMode::kIgnore
? Builtin::kTSANSeqCstStore8IgnoreFP
: Builtin::kTSANSeqCstStore8SaveFP;
} else if (size == kInt16Size) {
return fp_mode == SaveFPRegsMode::kIgnore
? Builtin::kTSANSeqCstStore16IgnoreFP
: Builtin::kTSANSeqCstStore16SaveFP;
} else if (size == kInt32Size) {
return fp_mode == SaveFPRegsMode::kIgnore
? Builtin::kTSANSeqCstStore32IgnoreFP
: Builtin::kTSANSeqCstStore32SaveFP;
} else {
CHECK_EQ(size, kInt64Size);
return fp_mode == SaveFPRegsMode::kIgnore
? Builtin::kTSANSeqCstStore64IgnoreFP
: Builtin::kTSANSeqCstStore64SaveFP;
}
}
}
Builtin CodeFactory::GetTSANRelaxedLoadStub(SaveFPRegsMode fp_mode, int size) {
if (size == kInt32Size) {
return fp_mode == SaveFPRegsMode::kIgnore
? Builtin::kTSANRelaxedLoad32IgnoreFP
: Builtin::kTSANRelaxedLoad32SaveFP;
} else {
CHECK_EQ(size, kInt64Size);
return fp_mode == SaveFPRegsMode::kIgnore
? Builtin::kTSANRelaxedLoad64IgnoreFP
: Builtin::kTSANRelaxedLoad64SaveFP;
}
}
#endif
}
}