Skip to content

Commit 601d2a1

Browse files
authored
More prohibition of fp register use (#194)
1 parent 7b9cc3b commit 601d2a1

File tree

3 files changed

+18
-13
lines changed

3 files changed

+18
-13
lines changed

bindings/translate-heap-profile.cc

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ class HeapProfileTranslator : ProfileTranslator {
4141

4242
public:
4343
v8::Local<v8::Value> TranslateAllocationProfile(
44-
v8::AllocationProfile::Node* node) {
44+
v8::AllocationProfile::Node* node) GENERAL_REGS_ONLY {
4545
v8::Local<v8::Array> children = NewArray(node->children.size());
4646
for (size_t i = 0; i < node->children.size(); i++) {
4747
Set(children, i, TranslateAllocationProfile(node->children[i]));
@@ -71,7 +71,8 @@ class HeapProfileTranslator : ProfileTranslator {
7171
v8::Local<v8::Integer> lineNumber,
7272
v8::Local<v8::Integer> columnNumber,
7373
v8::Local<v8::Array> children,
74-
v8::Local<v8::Array> allocations) {
74+
v8::Local<v8::Array> allocations)
75+
GENERAL_REGS_ONLY {
7576
v8::Local<v8::Object> js_node = NewObject();
7677
#define X(name) Set(js_node, str_##name, name);
7778
NODE_FIELDS
@@ -81,7 +82,8 @@ class HeapProfileTranslator : ProfileTranslator {
8182
}
8283

8384
v8::Local<v8::Object> CreateAllocation(v8::Local<v8::Number> count,
84-
v8::Local<v8::Number> sizeBytes) {
85+
v8::Local<v8::Number> sizeBytes)
86+
GENERAL_REGS_ONLY {
8587
v8::Local<v8::Object> js_alloc = NewObject();
8688
#define X(name) Set(js_alloc, str_##name, name);
8789
ALLOCATION_FIELDS

bindings/translate-time-profile.cc

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
*/
1616

1717
#include "translate-time-profile.hh"
18-
#include "general-regs-only.hh"
1918
#include "profile-translator.hh"
2019

2120
namespace dd {
@@ -41,8 +40,8 @@ class TimeProfileTranslator : ProfileTranslator {
4140
FIELDS
4241
#undef X
4342

44-
v8::Local<v8::Array> getContextsForNode(const v8::CpuProfileNode* node,
45-
uint32_t& hitcount) {
43+
v8::Local<v8::Array> getContextsForNode(
44+
const v8::CpuProfileNode* node, uint32_t& hitcount) GENERAL_REGS_ONLY {
4645
hitcount = node->GetHitCount();
4746
if (!contextsByNode) {
4847
// custom contexts are not enabled, keep the node hitcount and return
@@ -71,7 +70,8 @@ class TimeProfileTranslator : ProfileTranslator {
7170
v8::Local<v8::Integer> columnNumber,
7271
v8::Local<v8::Integer> hitCount,
7372
v8::Local<v8::Array> children,
74-
v8::Local<v8::Array> contexts) {
73+
v8::Local<v8::Array> contexts)
74+
GENERAL_REGS_ONLY {
7575
v8::Local<v8::Object> js_node = NewObject();
7676
#define X(name) Set(js_node, str_##name, name);
7777
FIELDS
@@ -133,7 +133,8 @@ class TimeProfileTranslator : ProfileTranslator {
133133
}
134134

135135
v8::Local<v8::Object> TranslateLineNumbersTimeProfileNode(
136-
const v8::CpuProfileNode* parent, const v8::CpuProfileNode* node) {
136+
const v8::CpuProfileNode* parent,
137+
const v8::CpuProfileNode* node) GENERAL_REGS_ONLY {
137138
return CreateTimeNode(parent->GetFunctionName(),
138139
parent->GetScriptResourceName(),
139140
NewInteger(parent->GetScriptId()),
@@ -148,7 +149,7 @@ class TimeProfileTranslator : ProfileTranslator {
148149
// and column number refer to the line/column from which the function was
149150
// called.
150151
v8::Local<v8::Value> TranslateLineNumbersTimeProfileRoot(
151-
const v8::CpuProfileNode* node) {
152+
const v8::CpuProfileNode* node) GENERAL_REGS_ONLY {
152153
int32_t count = node->GetChildrenCount();
153154
std::vector<v8::Local<v8::Array>> childrenArrs(count);
154155
int32_t childCount = 0;
@@ -179,8 +180,8 @@ class TimeProfileTranslator : ProfileTranslator {
179180
emptyArray);
180181
}
181182

182-
v8::Local<v8::Value> TranslateTimeProfileNode(
183-
const v8::CpuProfileNode* node) {
183+
v8::Local<v8::Value> TranslateTimeProfileNode(const v8::CpuProfileNode* node)
184+
GENERAL_REGS_ONLY {
184185
int32_t count = node->GetChildrenCount();
185186
v8::Local<v8::Array> children = NewArray(count);
186187
for (int32_t i = 0; i < count; i++) {
@@ -207,7 +208,8 @@ class TimeProfileTranslator : ProfileTranslator {
207208
v8::Local<v8::Value> TranslateTimeProfile(const v8::CpuProfile* profile,
208209
bool includeLineInfo,
209210
bool hasCpuTime,
210-
int64_t nonJSThreadsCpuTime) {
211+
int64_t nonJSThreadsCpuTime)
212+
GENERAL_REGS_ONLY {
211213
v8::Local<v8::Object> js_profile = NewObject();
212214

213215
if (includeLineInfo) {

bindings/translate-time-profile.hh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818

1919
#include <v8-profiler.h>
2020
#include "contexts.hh"
21+
#include "general-regs-only.hh"
2122

2223
namespace dd {
2324

@@ -26,6 +27,6 @@ v8::Local<v8::Value> TranslateTimeProfile(
2627
bool includeLineInfo,
2728
std::shared_ptr<ContextsByNode> contextsByNode = nullptr,
2829
bool hasCpuTime = false,
29-
int64_t nonJSThreadsCpuTime = 0);
30+
int64_t nonJSThreadsCpuTime = 0) GENERAL_REGS_ONLY;
3031

3132
} // namespace dd

0 commit comments

Comments
 (0)