Skip to content

Commit

Permalink
Merge r228397 - Add more support for pointer preparations.
Browse files Browse the repository at this point in the history
https://bugs.webkit.org/show_bug.cgi?id=182703
<rdar://problem/37469451>

Reviewed by Saam Barati.

Source/JavaScriptCore:

* llint/LLIntData.h:
(JSC::LLInt::getCodePtr):
* llint/LLIntPCRanges.h:
(JSC::LLInt::isLLIntPC):
* runtime/Options.cpp:
(JSC::recomputeDependentOptions):

Source/WTF:

* wtf/PointerPreparations.h:
  • Loading branch information
Mark Lam authored and carlosgcampos committed Feb 20, 2018
1 parent 3eee377 commit 6c5dd71
Show file tree
Hide file tree
Showing 6 changed files with 46 additions and 6 deletions.
15 changes: 15 additions & 0 deletions Source/JavaScriptCore/ChangeLog
@@ -1,3 +1,18 @@
2018-02-12 Mark Lam <mark.lam@apple.com>

Add more support for pointer preparations.
https://bugs.webkit.org/show_bug.cgi?id=182703
<rdar://problem/37469451>

Reviewed by Saam Barati.

* llint/LLIntData.h:
(JSC::LLInt::getCodePtr):
* llint/LLIntPCRanges.h:
(JSC::LLInt::isLLIntPC):
* runtime/Options.cpp:
(JSC::recomputeDependentOptions):

2018-02-12 Mark Lam <mark.lam@apple.com>

Fix missing exception check in RegExpObject::matchGlobal().
Expand Down
5 changes: 3 additions & 2 deletions Source/JavaScriptCore/llint/LLIntData.h
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2011, 2016 Apple Inc. All rights reserved.
* Copyright (C) 2011-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
Expand Down Expand Up @@ -28,6 +28,7 @@
#include "JSCJSValue.h"
#include "Opcode.h"
#include <array>
#include <wtf/PointerPreparations.h>

namespace JSC {

Expand Down Expand Up @@ -112,7 +113,7 @@ ALWAYS_INLINE LLIntCode getCodeFunctionPtr(OpcodeID codeId)

ALWAYS_INLINE void* getCodePtr(JSC::EncodedJSValue glueHelper())
{
return bitwise_cast<void*>(glueHelper);
return WTF_PREPARE_FUNCTION_POINTER_FOR_EXECUTION(glueHelper);
}

} } // namespace JSC::LLInt
8 changes: 5 additions & 3 deletions Source/JavaScriptCore/llint/LLIntPCRanges.h
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2016 Apple Inc. All rights reserved.
* Copyright (C) 2016-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
Expand All @@ -25,6 +25,8 @@

#pragma once

#include <wtf/PointerPreparations.h>

namespace JSC {

namespace LLInt {
Expand All @@ -38,8 +40,8 @@ extern "C" {
ALWAYS_INLINE bool isLLIntPC(void* pc)
{
uintptr_t pcAsInt = bitwise_cast<uintptr_t>(pc);
uintptr_t llintStart = bitwise_cast<uintptr_t>(llintPCRangeStart);
uintptr_t llintEnd = bitwise_cast<uintptr_t>(llintPCRangeEnd);
uintptr_t llintStart = bitwise_cast<uintptr_t>(WTF_PREPARE_FUNCTION_POINTER_FOR_EXECUTION(llintPCRangeStart));
uintptr_t llintEnd = bitwise_cast<uintptr_t>(WTF_PREPARE_FUNCTION_POINTER_FOR_EXECUTION(llintPCRangeEnd));
RELEASE_ASSERT(llintStart < llintEnd);
return llintStart <= pcAsInt && pcAsInt <= llintEnd;
}
Expand Down
5 changes: 4 additions & 1 deletion Source/JavaScriptCore/runtime/Options.cpp
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2011-2017 Apple Inc. All rights reserved.
* Copyright (C) 2011-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
Expand Down Expand Up @@ -41,6 +41,7 @@
#include <wtf/Compiler.h>
#include <wtf/DataLog.h>
#include <wtf/NumberOfCores.h>
#include <wtf/PointerPreparations.h>
#include <wtf/StdLibExtras.h>
#include <wtf/text/StringBuilder.h>
#include <wtf/threads/Signals.h>
Expand Down Expand Up @@ -401,6 +402,8 @@ static void recomputeDependentOptions()
Options::useJIT() = false;
#endif

WTF_SET_POINTER_PREPARATION_OPTIONS();

if (!Options::useJIT())
Options::useWebAssembly() = false;

Expand Down
10 changes: 10 additions & 0 deletions Source/WTF/ChangeLog
@@ -1,3 +1,13 @@
2018-02-12 Mark Lam <mark.lam@apple.com>

Add more support for pointer preparations.
https://bugs.webkit.org/show_bug.cgi?id=182703
<rdar://problem/37469451>

Reviewed by Saam Barati.

* wtf/PointerPreparations.h:

2018-02-06 Fujii Hironori <Hironori.Fujii@sony.com>

[GTK] fast/events/message-channel-gc-4.html is flaky
Expand Down
9 changes: 9 additions & 0 deletions Source/WTF/wtf/PointerPreparations.h
Expand Up @@ -29,6 +29,15 @@
#include <WebKitAdditions/PointerPreparations.h>
#endif

#ifndef WTF_PREPARE_FUNCTION_POINTER_FOR_EXECUTION
#define WTF_PREPARE_FUNCTION_POINTER_FOR_EXECUTION(vtblPtr) (reinterpret_cast<void*>(vtblPtr))
#endif

#ifndef WTF_PREPARE_VTBL_POINTER_FOR_INSPECTION
#define WTF_PREPARE_VTBL_POINTER_FOR_INSPECTION(vtblPtr) (reinterpret_cast<void*>(vtblPtr))
#endif

#ifndef WTF_SET_POINTER_PREPARATION_OPTIONS
#define WTF_SET_POINTER_PREPARATION_OPTIONS() do { } while (false)
#endif

0 comments on commit 6c5dd71

Please sign in to comment.