Skip to content

Commit 3d2543f

Browse files
author
Matheus Marchini
committed
!fixup fix native context constant for v6.x
1 parent 63901e8 commit 3d2543f

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/llv8-constants.cc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -239,8 +239,13 @@ void Context::Load() {
239239
LoadConstant("class_Context__closure_index__int", "context_idx_closure");
240240
kPreviousIndex =
241241
LoadConstant("class_Context__previous_index__int", "context_idx_prev");
242+
// TODO (mmarchini) change LoadConstant to accept variable arguments, a list
243+
// of constants or a fallback list).
242244
kNativeIndex =
243245
LoadConstant("class_Context__native_index__int", "context_idx_native");
246+
if (kNativeIndex == -1) {
247+
kNativeIndex = LoadConstant("class_Context__native_context_index__int");
248+
}
244249
kEmbedderDataIndex = LoadConstant("context_idx_embedder_data", (int)5);
245250

246251
kMinContextSlots = LoadConstant("class_Context__min_context_slots__int",

0 commit comments

Comments
 (0)