Skip to content

Commit

Permalink
[HACK] fix SmartOS compilation
Browse files Browse the repository at this point in the history
Ref: #8
  • Loading branch information
targos authored and nodejs-ci committed Sep 9, 2017
1 parent 67da503 commit b139d4e
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 10 deletions.
1 change: 1 addition & 0 deletions deps/v8/tools/gen-postmortem-metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,7 @@
'SeqTwoByteString, chars, char, kHeaderSize',
'SharedFunctionInfo, code, Code, kCodeOffset',
'SharedFunctionInfo, scope_info, ScopeInfo, kScopeInfoOffset',
'SharedFunctionInfo, function_token_position, int, kFunctionTokenPositionOffset',
'SlicedString, parent, String, kParentOffset',
'Code, instruction_start, uintptr_t, kHeaderSize',
'Code, instruction_size, int, kInstructionSizeOffset',
Expand Down
6 changes: 3 additions & 3 deletions src/v8abbr.h
Original file line number Diff line number Diff line change
Expand Up @@ -85,14 +85,14 @@

#define V8_OFF_FUNC_SHARED \
V8_OFF_HEAP(V8DBG_CLASS_JSFUNCTION__SHARED__SHAREDFUNCTIONINFO)
#define V8_OFF_SHARED_NAME \
V8_OFF_HEAP(V8DBG_CLASS_SHAREDFUNCTIONINFO__NAME__OBJECT)
#define V8_OFF_RAW_NAME \
V8_OFF_HEAP(V8DBG_CLASS_SHAREDFUNCTIONINFO__RAW_NAME__OBJECT)
#define V8_OFF_SHARED_IDENT \
V8_OFF_HEAP(V8DBG_CLASS_SHAREDFUNCTIONINFO__FUNCTION_IDENTIFIER__OBJECT)
#define V8_OFF_SHARED_SCRIPT \
V8_OFF_HEAP(V8DBG_CLASS_SHAREDFUNCTIONINFO__SCRIPT__OBJECT)
#define V8_OFF_SHARED_FUNTOK \
V8_OFF_HEAP(V8DBG_CLASS_SHAREDFUNCTIONINFO__FUNCTION_TOKEN_POSITION__SMI)
V8_OFF_HEAP(V8DBG_CLASS_SHAREDFUNCTIONINFO__FUNCTION_TOKEN_POSITION__INT)
#define V8_OFF_SCRIPT_NAME \
V8_OFF_HEAP(V8DBG_CLASS_SCRIPT__NAME__OBJECT)
#define V8_OFF_SCRIPT_LENDS \
Expand Down
23 changes: 16 additions & 7 deletions src/v8ustack.d
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
((value & V8_SmiTagMask) == V8_SmiTag)
#define SMI_VALUE(value) \
((uint32_t) ((value) >> V8_SmiValueShift))
#define NO_SHARED_FUNCTION_NAME_SENTINEL NULL

/*
* Heap objects usually start off with a Map pointer, itself another heap
Expand Down Expand Up @@ -372,7 +373,8 @@ dtrace:helper:ustack:
this->shared = (off_t) 0;
this->map = (off_t) 0;
this->attrs = 0;
this->funcnamestr = (off_t) 0;
this->funcrawnamestr = (off_t) 0;
this->hassharedname = 0;
this->funcnamelen = 0;
this->funcnameattrs = 0;
this->script = (off_t) 0;
Expand Down Expand Up @@ -515,9 +517,16 @@ dtrace:helper:ustack:
this->attrs = 0;

this->shared = COPYIN_PTR(this->func + V8_OFF_FUNC_SHARED);
this->funcnamestr = COPYIN_PTR(this->shared + V8_OFF_SHARED_NAME);
LOAD_STRFIELDS(this->funcnamestr, this->funcnamelen,
this->funcnameattrs);
this->funcrawnamestr = COPYIN_PTR(this->shared + V8_OFF_RAW_NAME);
this->hassharedname = this->funcrawnamestr !=
NO_SHARED_FUNCTION_NAME_SENTINEL;
}

dtracr:helper:ustack:
/!this->done && this->hassharedname/
{
LOAD_STRFIELDS(this->funcrawnamestr, this->funcnamelen,
this->funcnameattrs);
}

dtrace:helper:ustack:
Expand All @@ -532,8 +541,8 @@ dtrace:helper:ustack:
APPEND_CHR('s');
APPEND_CHR(' ');

this->funcnamestr = COPYIN_PTR(this->shared + V8_OFF_SHARED_IDENT);
LOAD_STRFIELDS(this->funcnamestr, this->funcnamelen,
this->funcrawnamestr = COPYIN_PTR(this->shared + V8_OFF_SHARED_IDENT);
LOAD_STRFIELDS(this->funcrawnamestr, this->funcnamelen,
this->funcnameattrs);
}

Expand All @@ -545,7 +554,7 @@ dtrace:helper:ustack:
APPEND_CHR(')');
}

APPEND_V8STR(this->funcnamestr, this->funcnamelen, this->funcnameattrs)
APPEND_V8STR(this->funcrawnamestr, this->funcnamelen, this->funcnameattrs)

/*
* Now look for the name of the script where the function was defined. The
Expand Down

0 comments on commit b139d4e

Please sign in to comment.