Skip to content

Commit 82ba2ce

Browse files
targosnodejs-ci
authored andcommitted
[HACK] fix SmartOS compilation
Ref: #8
1 parent 5e39093 commit 82ba2ce

File tree

3 files changed

+20
-10
lines changed

3 files changed

+20
-10
lines changed

deps/v8/tools/gen-postmortem-metadata.py

+1
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,7 @@
266266
'SeqTwoByteString, chars, char, kHeaderSize',
267267
'SharedFunctionInfo, code, Code, kCodeOffset',
268268
'SharedFunctionInfo, scope_info, ScopeInfo, kScopeInfoOffset',
269+
'SharedFunctionInfo, function_token_position, int, kFunctionTokenPositionOffset',
269270
'SlicedString, parent, String, kParentOffset',
270271
'Code, instruction_start, uintptr_t, kHeaderSize',
271272
'Code, instruction_size, int, kInstructionSizeOffset',

src/v8abbr.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -85,14 +85,14 @@
8585

8686
#define V8_OFF_FUNC_SHARED \
8787
V8_OFF_HEAP(V8DBG_CLASS_JSFUNCTION__SHARED__SHAREDFUNCTIONINFO)
88-
#define V8_OFF_SHARED_NAME \
89-
V8_OFF_HEAP(V8DBG_CLASS_SHAREDFUNCTIONINFO__NAME__OBJECT)
88+
#define V8_OFF_RAW_NAME \
89+
V8_OFF_HEAP(V8DBG_CLASS_SHAREDFUNCTIONINFO__RAW_NAME__OBJECT)
9090
#define V8_OFF_SHARED_IDENT \
9191
V8_OFF_HEAP(V8DBG_CLASS_SHAREDFUNCTIONINFO__FUNCTION_IDENTIFIER__OBJECT)
9292
#define V8_OFF_SHARED_SCRIPT \
9393
V8_OFF_HEAP(V8DBG_CLASS_SHAREDFUNCTIONINFO__SCRIPT__OBJECT)
9494
#define V8_OFF_SHARED_FUNTOK \
95-
V8_OFF_HEAP(V8DBG_CLASS_SHAREDFUNCTIONINFO__FUNCTION_TOKEN_POSITION__SMI)
95+
V8_OFF_HEAP(V8DBG_CLASS_SHAREDFUNCTIONINFO__FUNCTION_TOKEN_POSITION__INT)
9696
#define V8_OFF_SCRIPT_NAME \
9797
V8_OFF_HEAP(V8DBG_CLASS_SCRIPT__NAME__OBJECT)
9898
#define V8_OFF_SCRIPT_LENDS \

src/v8ustack.d

+16-7
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
((value & V8_SmiTagMask) == V8_SmiTag)
2222
#define SMI_VALUE(value) \
2323
((uint32_t) ((value) >> V8_SmiValueShift))
24+
#define NO_SHARED_FUNCTION_NAME_SENTINEL NULL
2425

2526
/*
2627
* Heap objects usually start off with a Map pointer, itself another heap
@@ -372,7 +373,8 @@ dtrace:helper:ustack:
372373
this->shared = (off_t) 0;
373374
this->map = (off_t) 0;
374375
this->attrs = 0;
375-
this->funcnamestr = (off_t) 0;
376+
this->funcrawnamestr = (off_t) 0;
377+
this->hassharedname = 0;
376378
this->funcnamelen = 0;
377379
this->funcnameattrs = 0;
378380
this->script = (off_t) 0;
@@ -515,9 +517,16 @@ dtrace:helper:ustack:
515517
this->attrs = 0;
516518

517519
this->shared = COPYIN_PTR(this->func + V8_OFF_FUNC_SHARED);
518-
this->funcnamestr = COPYIN_PTR(this->shared + V8_OFF_SHARED_NAME);
519-
LOAD_STRFIELDS(this->funcnamestr, this->funcnamelen,
520-
this->funcnameattrs);
520+
this->funcrawnamestr = COPYIN_PTR(this->shared + V8_OFF_RAW_NAME);
521+
this->hassharedname = this->funcrawnamestr !=
522+
NO_SHARED_FUNCTION_NAME_SENTINEL;
523+
}
524+
525+
dtracr:helper:ustack:
526+
/!this->done && this->hassharedname/
527+
{
528+
LOAD_STRFIELDS(this->funcrawnamestr, this->funcnamelen,
529+
this->funcnameattrs);
521530
}
522531

523532
dtrace:helper:ustack:
@@ -532,8 +541,8 @@ dtrace:helper:ustack:
532541
APPEND_CHR('s');
533542
APPEND_CHR(' ');
534543

535-
this->funcnamestr = COPYIN_PTR(this->shared + V8_OFF_SHARED_IDENT);
536-
LOAD_STRFIELDS(this->funcnamestr, this->funcnamelen,
544+
this->funcrawnamestr = COPYIN_PTR(this->shared + V8_OFF_SHARED_IDENT);
545+
LOAD_STRFIELDS(this->funcrawnamestr, this->funcnamelen,
537546
this->funcnameattrs);
538547
}
539548

@@ -545,7 +554,7 @@ dtrace:helper:ustack:
545554
APPEND_CHR(')');
546555
}
547556

548-
APPEND_V8STR(this->funcnamestr, this->funcnamelen, this->funcnameattrs)
557+
APPEND_V8STR(this->funcrawnamestr, this->funcnamelen, this->funcnameattrs)
549558

550559
/*
551560
* Now look for the name of the script where the function was defined. The

0 commit comments

Comments
 (0)