summaryrefslogtreecommitdiff
path: root/Source/JavaScriptCore/ftl/FTLOutput.cpp
diff options
context:
space:
mode:
authorLorry Tar Creator <lorry-tar-importer@lorry>2015-05-20 09:56:07 +0000
committerLorry Tar Creator <lorry-tar-importer@lorry>2015-05-20 09:56:07 +0000
commit41386e9cb918eed93b3f13648cbef387e371e451 (patch)
treea97f9d7bd1d9d091833286085f72da9d83fd0606 /Source/JavaScriptCore/ftl/FTLOutput.cpp
parente15dd966d523731101f70ccf768bba12435a0208 (diff)
downloadWebKitGtk-tarball-41386e9cb918eed93b3f13648cbef387e371e451.tar.gz
webkitgtk-2.4.9webkitgtk-2.4.9
Diffstat (limited to 'Source/JavaScriptCore/ftl/FTLOutput.cpp')
-rw-r--r--Source/JavaScriptCore/ftl/FTLOutput.cpp107
1 files changed, 1 insertions, 106 deletions
diff --git a/Source/JavaScriptCore/ftl/FTLOutput.cpp b/Source/JavaScriptCore/ftl/FTLOutput.cpp
index 30d5fbd50..fb2fc93b1 100644
--- a/Source/JavaScriptCore/ftl/FTLOutput.cpp
+++ b/Source/JavaScriptCore/ftl/FTLOutput.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved.
+ * Copyright (C) 2013 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -45,111 +45,6 @@ Output::~Output()
llvm->DisposeBuilder(m_builder);
}
-void Output::initialize(LModule module, LValue function, AbstractHeapRepository& heaps)
-{
- IntrinsicRepository::initialize(module);
- m_function = function;
- m_heaps = &heaps;
-}
-
-LBasicBlock Output::appendTo(LBasicBlock block, LBasicBlock nextBlock)
-{
- appendTo(block);
- return insertNewBlocksBefore(nextBlock);
-}
-
-void Output::appendTo(LBasicBlock block)
-{
- m_block = block;
-
- llvm->PositionBuilderAtEnd(m_builder, block);
-}
-
-LBasicBlock Output::newBlock(const char* name)
-{
- if (!m_nextBlock)
- return appendBasicBlock(m_context, m_function, name);
- return insertBasicBlock(m_context, m_nextBlock, name);
-}
-
-LValue Output::sensibleDoubleToInt(LValue value)
-{
- RELEASE_ASSERT(isX86());
- return call(
- x86SSE2CvtTSD2SIIntrinsic(),
- insertElement(
- insertElement(getUndef(vectorType(doubleType, 2)), value, int32Zero),
- doubleZero, int32One));
-}
-
-LValue Output::load(TypedPointer pointer, LType refType)
-{
- LValue result = get(intToPtr(pointer.value(), refType));
- pointer.heap().decorateInstruction(result, *m_heaps);
- return result;
-}
-
-void Output::store(LValue value, TypedPointer pointer, LType refType)
-{
- LValue result = set(value, intToPtr(pointer.value(), refType));
- pointer.heap().decorateInstruction(result, *m_heaps);
-}
-
-LValue Output::baseIndex(LValue base, LValue index, Scale scale, ptrdiff_t offset)
-{
- LValue accumulatedOffset;
-
- switch (scale) {
- case ScaleOne:
- accumulatedOffset = index;
- break;
- case ScaleTwo:
- accumulatedOffset = shl(index, intPtrOne);
- break;
- case ScaleFour:
- accumulatedOffset = shl(index, intPtrTwo);
- break;
- case ScaleEight:
- case ScalePtr:
- accumulatedOffset = shl(index, intPtrThree);
- break;
- }
-
- if (offset)
- accumulatedOffset = add(accumulatedOffset, constIntPtr(offset));
-
- return add(base, accumulatedOffset);
-}
-
-void Output::branch(LValue condition, LBasicBlock taken, Weight takenWeight, LBasicBlock notTaken, Weight notTakenWeight)
-{
- LValue branch = buildCondBr(m_builder, condition, taken, notTaken);
-
- if (!takenWeight || !notTakenWeight)
- return;
-
- double total = takenWeight.value() + notTakenWeight.value();
-
- setMetadata(
- branch, profKind,
- mdNode(
- m_context, branchWeights,
- constInt32(takenWeight.scaleToTotal(total)),
- constInt32(notTakenWeight.scaleToTotal(total))));
-}
-
-void Output::check(LValue condition, WeightedTarget taken, Weight notTakenWeight)
-{
- LBasicBlock continuation = FTL_NEW_BLOCK(*this, ("Output::check continuation"));
- branch(condition, taken, WeightedTarget(continuation, notTakenWeight));
- appendTo(continuation);
-}
-
-void Output::check(LValue condition, WeightedTarget taken)
-{
- check(condition, taken, taken.weight().inverse());
-}
-
} } // namespace JSC::FTL
#endif // ENABLE(FTL_JIT)