Title: [229302] trunk/Source/_javascript_Core
Revision
229302
Author
[email protected]
Date
2018-03-05 19:03:01 -0800 (Mon, 05 Mar 2018)

Log Message

JITThunk functions should only be called when the JIT is enabled.
https://bugs.webkit.org/show_bug.cgi?id=183351
<rdar://problem/38160091>

Reviewed by Keith Miller.

* jit/JITThunks.cpp:
(JSC::JITThunks::ctiNativeCall):
(JSC::JITThunks::ctiNativeConstruct):
(JSC::JITThunks::ctiInternalFunctionCall):
(JSC::JITThunks::ctiInternalFunctionConstruct):
* runtime/VM.cpp:
(JSC::VM::VM):
(JSC::VM::getCTIInternalFunctionTrampolineFor):

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (229301 => 229302)


--- trunk/Source/_javascript_Core/ChangeLog	2018-03-06 02:34:09 UTC (rev 229301)
+++ trunk/Source/_javascript_Core/ChangeLog	2018-03-06 03:03:01 UTC (rev 229302)
@@ -1,5 +1,22 @@
 2018-03-05  Mark Lam  <[email protected]>
 
+        JITThunk functions should only be called when the JIT is enabled.
+        https://bugs.webkit.org/show_bug.cgi?id=183351
+        <rdar://problem/38160091>
+
+        Reviewed by Keith Miller.
+
+        * jit/JITThunks.cpp:
+        (JSC::JITThunks::ctiNativeCall):
+        (JSC::JITThunks::ctiNativeConstruct):
+        (JSC::JITThunks::ctiInternalFunctionCall):
+        (JSC::JITThunks::ctiInternalFunctionConstruct):
+        * runtime/VM.cpp:
+        (JSC::VM::VM):
+        (JSC::VM::getCTIInternalFunctionTrampolineFor):
+
+2018-03-05  Mark Lam  <[email protected]>
+
         Gardening: build fix.
 
         Not reviewed.

Modified: trunk/Source/_javascript_Core/jit/JITThunks.cpp (229301 => 229302)


--- trunk/Source/_javascript_Core/jit/JITThunks.cpp	2018-03-06 02:34:09 UTC (rev 229301)
+++ trunk/Source/_javascript_Core/jit/JITThunks.cpp	2018-03-06 03:03:01 UTC (rev 229302)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2012, 2013, 2015-2016 Apple Inc. All rights reserved.
+ * Copyright (C) 2012-2018 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -47,15 +47,13 @@
 
 MacroAssemblerCodePtr JITThunks::ctiNativeCall(VM* vm)
 {
-    if (!VM::canUseJIT())
-        return MacroAssemblerCodePtr::createLLIntCodePtr(llint_native_call_trampoline);
+    ASSERT(VM::canUseJIT());
     return ctiStub(vm, nativeCallGenerator).code();
 }
 
 MacroAssemblerCodePtr JITThunks::ctiNativeConstruct(VM* vm)
 {
-    if (!VM::canUseJIT())
-        return MacroAssemblerCodePtr::createLLIntCodePtr(llint_native_construct_trampoline);
+    ASSERT(VM::canUseJIT());
     return ctiStub(vm, nativeConstructGenerator).code();
 }
 
@@ -73,15 +71,13 @@
 
 MacroAssemblerCodePtr JITThunks::ctiInternalFunctionCall(VM* vm)
 {
-    if (!VM::canUseJIT())
-        return MacroAssemblerCodePtr::createLLIntCodePtr(llint_internal_function_call_trampoline);
+    ASSERT(VM::canUseJIT());
     return ctiStub(vm, internalFunctionCallGenerator).code();
 }
 
 MacroAssemblerCodePtr JITThunks::ctiInternalFunctionConstruct(VM* vm)
 {
-    if (!VM::canUseJIT())
-        return MacroAssemblerCodePtr::createLLIntCodePtr(llint_internal_function_construct_trampoline);
+    ASSERT(VM::canUseJIT());
     return ctiStub(vm, internalFunctionConstructGenerator).code();
 }
 

Modified: trunk/Source/_javascript_Core/runtime/VM.cpp (229301 => 229302)


--- trunk/Source/_javascript_Core/runtime/VM.cpp	2018-03-06 02:34:09 UTC (rev 229301)
+++ trunk/Source/_javascript_Core/runtime/VM.cpp	2018-03-06 03:03:01 UTC (rev 229302)
@@ -453,9 +453,13 @@
         watchdog.setTimeLimit(Seconds::fromMilliseconds(Options::watchdog()));
     }
 
+#if ENABLE(JIT)
     // Make sure that any stubs that the JIT is going to use are initialized in non-compilation threads.
-    getCTIInternalFunctionTrampolineFor(CodeForCall);
-    getCTIInternalFunctionTrampolineFor(CodeForConstruct);
+    if (canUseJIT()) {
+        getCTIInternalFunctionTrampolineFor(CodeForCall);
+        getCTIInternalFunctionTrampolineFor(CodeForConstruct);
+    }
+#endif
 
     VMInspector::instance().add(this);
 }
@@ -692,14 +696,15 @@
 MacroAssemblerCodePtr VM::getCTIInternalFunctionTrampolineFor(CodeSpecializationKind kind)
 {
 #if ENABLE(JIT)
+    if (canUseJIT()) {
+        if (kind == CodeForCall)
+            return jitStubs->ctiInternalFunctionCall(this);
+        return jitStubs->ctiInternalFunctionConstruct(this);
+    }
+#endif
     if (kind == CodeForCall)
-        return jitStubs->ctiInternalFunctionCall(this);
-    return jitStubs->ctiInternalFunctionConstruct(this);
-#else
-    if (kind == CodeForCall)
         return MacroAssemblerCodePtr::createLLIntCodePtr(llint_internal_function_call_trampoline);
     return MacroAssemblerCodePtr::createLLIntCodePtr(llint_internal_function_construct_trampoline);
-#endif
 }
 
 VM::ClientData::~ClientData()
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to