summaryrefslogtreecommitdiff
path: root/Source/JavaScriptCore/ftl/FTLOSREntry.cpp
diff options
context:
space:
mode:
authorLorry Tar Creator <lorry-tar-importer@lorry>2017-06-27 06:07:23 +0000
committerLorry Tar Creator <lorry-tar-importer@lorry>2017-06-27 06:07:23 +0000
commit1bf1084f2b10c3b47fd1a588d85d21ed0eb41d0c (patch)
tree46dcd36c86e7fbc6e5df36deb463b33e9967a6f7 /Source/JavaScriptCore/ftl/FTLOSREntry.cpp
parent32761a6cee1d0dee366b885b7b9c777e67885688 (diff)
downloadWebKitGtk-tarball-1bf1084f2b10c3b47fd1a588d85d21ed0eb41d0c.tar.gz
Diffstat (limited to 'Source/JavaScriptCore/ftl/FTLOSREntry.cpp')
-rw-r--r--Source/JavaScriptCore/ftl/FTLOSREntry.cpp28
1 files changed, 20 insertions, 8 deletions
diff --git a/Source/JavaScriptCore/ftl/FTLOSREntry.cpp b/Source/JavaScriptCore/ftl/FTLOSREntry.cpp
index 185046054..9a391e34b 100644
--- a/Source/JavaScriptCore/ftl/FTLOSREntry.cpp
+++ b/Source/JavaScriptCore/ftl/FTLOSREntry.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2013 Apple Inc. All rights reserved.
+ * Copyright (C) 2013-2014, 2016 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -30,19 +30,22 @@
#include "CodeBlock.h"
#include "DFGJITCode.h"
#include "FTLForOSREntryJITCode.h"
-#include "JSStackInlines.h"
#include "OperandsInlines.h"
+#include "JSCInlines.h"
+#include "VMInlines.h"
#if ENABLE(FTL_JIT)
namespace JSC { namespace FTL {
+SUPPRESS_ASAN
void* prepareOSREntry(
ExecState* exec, CodeBlock* dfgCodeBlock, CodeBlock* entryCodeBlock,
unsigned bytecodeIndex, unsigned streamIndex)
{
VM& vm = exec->vm();
CodeBlock* baseline = dfgCodeBlock->baselineVersion();
+ ExecutableBase* executable = dfgCodeBlock->ownerExecutable();
DFG::JITCode* dfgCode = dfgCodeBlock->jitCode()->dfg();
ForOSREntryJITCode* entryCode = entryCodeBlock->jitCode()->ftlForOSREntry();
@@ -52,9 +55,12 @@ void* prepareOSREntry(
bytecodeIndex, ".\n");
}
+ if (bytecodeIndex)
+ jsCast<ScriptExecutable*>(executable)->setDidTryToEnterInLoop(true);
+
if (bytecodeIndex != entryCode->bytecodeIndex()) {
if (Options::verboseOSR())
- dataLog(" OSR failed because we don't have an entrypoint for bc#", bytecodeIndex, "; ours is for bc#", entryCode->bytecodeIndex());
+ dataLog(" OSR failed because we don't have an entrypoint for bc#", bytecodeIndex, "; ours is for bc#", entryCode->bytecodeIndex(), "\n");
return 0;
}
@@ -66,12 +72,18 @@ void* prepareOSREntry(
dataLog(" Values at entry: ", values, "\n");
for (int argument = values.numberOfArguments(); argument--;) {
- RELEASE_ASSERT(
- exec->r(virtualRegisterForArgument(argument).offset()).jsValue() == values.argument(argument));
+ JSValue valueOnStack = exec->r(virtualRegisterForArgument(argument).offset()).asanUnsafeJSValue();
+ JSValue reconstructedValue = values.argument(argument);
+ if (valueOnStack == reconstructedValue || !argument)
+ continue;
+ dataLog("Mismatch between reconstructed values and the the value on the stack for argument arg", argument, " for ", *entryCodeBlock, " at bc#", bytecodeIndex, ":\n");
+ dataLog(" Value on stack: ", valueOnStack, "\n");
+ dataLog(" Reconstructed value: ", reconstructedValue, "\n");
+ RELEASE_ASSERT_NOT_REACHED();
}
RELEASE_ASSERT(
- static_cast<int>(values.numberOfLocals()) == baseline->m_numCalleeRegisters);
+ static_cast<int>(values.numberOfLocals()) == baseline->m_numCalleeLocals);
EncodedJSValue* scratch = static_cast<EncodedJSValue*>(
entryCode->entryBuffer()->dataBuffer());
@@ -80,7 +92,7 @@ void* prepareOSREntry(
scratch[local] = JSValue::encode(values.local(local));
int stackFrameSize = entryCode->common.requiredRegisterCountForExecutionAndExit();
- if (!vm.interpreter->stack().grow(&exec->registers()[virtualRegisterForLocal(stackFrameSize).offset()])) {
+ if (UNLIKELY(!vm.ensureStackCapacityFor(&exec->registers()[virtualRegisterForLocal(stackFrameSize - 1).offset()]))) {
if (Options::verboseOSR())
dataLog(" OSR failed because stack growth failed.\n");
return 0;
@@ -88,7 +100,7 @@ void* prepareOSREntry(
exec->setCodeBlock(entryCodeBlock);
- void* result = entryCode->addressForCall().executableAddress();
+ void* result = entryCode->addressForCall(ArityCheckNotRequired).executableAddress();
if (Options::verboseOSR())
dataLog(" Entry will succeed, going to address", RawPointer(result), "\n");