Skip to content

Commit

Permalink
More prohibition of fp register use (#194)
Browse files Browse the repository at this point in the history
  • Loading branch information
szegedi committed Jan 27, 2025
1 parent b3d5ee2 commit b467f2b
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 13 deletions.
8 changes: 5 additions & 3 deletions bindings/translate-heap-profile.cc
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class HeapProfileTranslator : ProfileTranslator {

public:
v8::Local<v8::Value> TranslateAllocationProfile(
v8::AllocationProfile::Node* node) {
v8::AllocationProfile::Node* node) GENERAL_REGS_ONLY {
v8::Local<v8::Array> children = NewArray(node->children.size());
for (size_t i = 0; i < node->children.size(); i++) {
Set(children, i, TranslateAllocationProfile(node->children[i]));
Expand Down Expand Up @@ -71,7 +71,8 @@ class HeapProfileTranslator : ProfileTranslator {
v8::Local<v8::Integer> lineNumber,
v8::Local<v8::Integer> columnNumber,
v8::Local<v8::Array> children,
v8::Local<v8::Array> allocations) {
v8::Local<v8::Array> allocations)
GENERAL_REGS_ONLY {
v8::Local<v8::Object> js_node = NewObject();
#define X(name) Set(js_node, str_##name, name);
NODE_FIELDS
Expand All @@ -81,7 +82,8 @@ class HeapProfileTranslator : ProfileTranslator {
}

v8::Local<v8::Object> CreateAllocation(v8::Local<v8::Number> count,
v8::Local<v8::Number> sizeBytes) {
v8::Local<v8::Number> sizeBytes)
GENERAL_REGS_ONLY {
v8::Local<v8::Object> js_alloc = NewObject();
#define X(name) Set(js_alloc, str_##name, name);
ALLOCATION_FIELDS
Expand Down
20 changes: 11 additions & 9 deletions bindings/translate-time-profile.cc
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
*/

#include "translate-time-profile.hh"
#include "general-regs-only.hh"
#include "profile-translator.hh"

namespace dd {
Expand All @@ -41,8 +40,8 @@ class TimeProfileTranslator : ProfileTranslator {
FIELDS
#undef X

v8::Local<v8::Array> getContextsForNode(const v8::CpuProfileNode* node,
uint32_t& hitcount) {
v8::Local<v8::Array> getContextsForNode(
const v8::CpuProfileNode* node, uint32_t& hitcount) GENERAL_REGS_ONLY {
hitcount = node->GetHitCount();
if (!contextsByNode) {
// custom contexts are not enabled, keep the node hitcount and return
Expand Down Expand Up @@ -71,7 +70,8 @@ class TimeProfileTranslator : ProfileTranslator {
v8::Local<v8::Integer> columnNumber,
v8::Local<v8::Integer> hitCount,
v8::Local<v8::Array> children,
v8::Local<v8::Array> contexts) {
v8::Local<v8::Array> contexts)
GENERAL_REGS_ONLY {
v8::Local<v8::Object> js_node = NewObject();
#define X(name) Set(js_node, str_##name, name);
FIELDS
Expand Down Expand Up @@ -133,7 +133,8 @@ class TimeProfileTranslator : ProfileTranslator {
}

v8::Local<v8::Object> TranslateLineNumbersTimeProfileNode(
const v8::CpuProfileNode* parent, const v8::CpuProfileNode* node) {
const v8::CpuProfileNode* parent,
const v8::CpuProfileNode* node) GENERAL_REGS_ONLY {
return CreateTimeNode(parent->GetFunctionName(),
parent->GetScriptResourceName(),
NewInteger(parent->GetScriptId()),
Expand All @@ -148,7 +149,7 @@ class TimeProfileTranslator : ProfileTranslator {
// and column number refer to the line/column from which the function was
// called.
v8::Local<v8::Value> TranslateLineNumbersTimeProfileRoot(
const v8::CpuProfileNode* node) {
const v8::CpuProfileNode* node) GENERAL_REGS_ONLY {
int32_t count = node->GetChildrenCount();
std::vector<v8::Local<v8::Array>> childrenArrs(count);
int32_t childCount = 0;
Expand Down Expand Up @@ -179,8 +180,8 @@ class TimeProfileTranslator : ProfileTranslator {
emptyArray);
}

v8::Local<v8::Value> TranslateTimeProfileNode(
const v8::CpuProfileNode* node) {
v8::Local<v8::Value> TranslateTimeProfileNode(const v8::CpuProfileNode* node)
GENERAL_REGS_ONLY {
int32_t count = node->GetChildrenCount();
v8::Local<v8::Array> children = NewArray(count);
for (int32_t i = 0; i < count; i++) {
Expand All @@ -207,7 +208,8 @@ class TimeProfileTranslator : ProfileTranslator {
v8::Local<v8::Value> TranslateTimeProfile(const v8::CpuProfile* profile,
bool includeLineInfo,
bool hasCpuTime,
int64_t nonJSThreadsCpuTime) {
int64_t nonJSThreadsCpuTime)
GENERAL_REGS_ONLY {
v8::Local<v8::Object> js_profile = NewObject();

if (includeLineInfo) {
Expand Down
3 changes: 2 additions & 1 deletion bindings/translate-time-profile.hh
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

#include <v8-profiler.h>
#include "contexts.hh"
#include "general-regs-only.hh"

namespace dd {

Expand All @@ -26,6 +27,6 @@ v8::Local<v8::Value> TranslateTimeProfile(
bool includeLineInfo,
std::shared_ptr<ContextsByNode> contextsByNode = nullptr,
bool hasCpuTime = false,
int64_t nonJSThreadsCpuTime = 0);
int64_t nonJSThreadsCpuTime = 0) GENERAL_REGS_ONLY;

} // namespace dd

0 comments on commit b467f2b

Please sign in to comment.