30fabc4cdf
This ensures that there is only one entrance point from C++ to generated code, hence only one method has to be excluded from CFI. It also introduces type safety by only allowing the code to be called with the right arguments. This CL includes minor drive-by fixes in the tests, like removing unused dummy variables. R=mstarzinger@chromium.org Bug: v8:7182 Change-Id: Ied9164a2497db9e7c032324c5e082094fdffc72d Reviewed-on: https://chromium-review.googlesource.com/852213 Reviewed-by: Jakob Gruber <jgruber@chromium.org> Reviewed-by: Michael Starzinger <mstarzinger@chromium.org> Commit-Queue: Clemens Hammacher <clemensh@chromium.org> Cr-Commit-Position: refs/heads/master@{#50426}
36 lines
1.2 KiB
C++
36 lines
1.2 KiB
C++
// Copyright 2017 the V8 project authors. All rights reserved.
|
|
// Use of this source code is governed by a BSD-style license that can be
|
|
// found in the LICENSE file.
|
|
|
|
#ifndef V8_CCTEST_ASSEMBLER_HELPER_ARM_H_
|
|
#define V8_CCTEST_ASSEMBLER_HELPER_ARM_H_
|
|
|
|
#include <functional>
|
|
|
|
#include "src/handles.h"
|
|
#include "src/simulator.h"
|
|
|
|
namespace v8 {
|
|
namespace internal {
|
|
|
|
// TODO(arm): Refine these signatures per test case, they can have arbitrary
|
|
// return and argument types and arbitrary number of arguments.
|
|
using F_iiiii = Object*(int x, int p1, int p2, int p3, int p4);
|
|
using F_piiii = Object*(void* p0, int p1, int p2, int p3, int p4);
|
|
using F_ppiii = Object*(void* p0, void* p1, int p2, int p3, int p4);
|
|
using F_pppii = Object*(void* p0, void* p1, void* p2, int p3, int p4);
|
|
using F_ippii = Object*(int p0, void* p1, void* p2, int p3, int p4);
|
|
|
|
Handle<Code> AssembleCodeImpl(std::function<void(Assembler&)> assemble);
|
|
|
|
template <typename Signature>
|
|
GeneratedCode<Signature> AssembleCode(
|
|
std::function<void(Assembler&)> assemble) {
|
|
return GeneratedCode<Signature>::FromCode(*AssembleCodeImpl(assemble));
|
|
}
|
|
|
|
} // namespace internal
|
|
} // namespace v8
|
|
|
|
#endif // V8_CCTEST_ASSEMBLER_HELPER_ARM_H_
|