OSDN Git Service

4324f97f442b08ec1731ad996e28898a277766a4
[android-x86/external-swiftshader.git] / src / IceGlobalContext.cpp
1 //===- subzero/src/IceGlobalContext.cpp - Global context defs -------------===//
2 //
3 //                        The Subzero Code Generator
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 //
10 // This file defines aspects of the compilation that persist across
11 // multiple functions.
12 //
13 //===----------------------------------------------------------------------===//
14
15 #include <ctype.h> // isdigit(), isupper()
16 #include <locale>  // locale
17 #include <unordered_map>
18
19 #include "llvm/Support/Timer.h"
20
21 #include "IceCfg.h"
22 #include "IceClFlags.h"
23 #include "IceDefs.h"
24 #include "IceELFObjectWriter.h"
25 #include "IceGlobalContext.h"
26 #include "IceGlobalInits.h"
27 #include "IceOperand.h"
28 #include "IceTargetLowering.h"
29 #include "IceTimerTree.h"
30 #include "IceTypes.h"
31
32 namespace std {
33 template <> struct hash<Ice::RelocatableTuple> {
34   size_t operator()(const Ice::RelocatableTuple &Key) const {
35     return hash<Ice::IceString>()(Key.Name) +
36            hash<Ice::RelocOffsetT>()(Key.Offset);
37   }
38 };
39 } // end of namespace std
40
41 namespace Ice {
42
43 // TypePool maps constants of type KeyType (e.g. float) to pointers to
44 // type ValueType (e.g. ConstantFloat).
45 template <Type Ty, typename KeyType, typename ValueType> class TypePool {
46   TypePool(const TypePool &) = delete;
47   TypePool &operator=(const TypePool &) = delete;
48
49 public:
50   TypePool() : NextPoolID(0) {}
51   ValueType *getOrAdd(GlobalContext *Ctx, KeyType Key) {
52     auto Iter = Pool.find(Key);
53     if (Iter != Pool.end())
54       return Iter->second;
55     ValueType *Result = ValueType::create(Ctx, Ty, Key, NextPoolID++);
56     Pool[Key] = Result;
57     return Result;
58   }
59   ConstantList getConstantPool() const {
60     ConstantList Constants;
61     Constants.reserve(Pool.size());
62     for (auto &I : Pool)
63       Constants.push_back(I.second);
64     return Constants;
65   }
66
67 private:
68   typedef std::unordered_map<KeyType, ValueType *> ContainerType;
69   ContainerType Pool;
70   uint32_t NextPoolID;
71 };
72
73 // UndefPool maps ICE types to the corresponding ConstantUndef values.
74 class UndefPool {
75   UndefPool(const UndefPool &) = delete;
76   UndefPool &operator=(const UndefPool &) = delete;
77
78 public:
79   UndefPool() : NextPoolID(0), Pool(IceType_NUM) {}
80
81   ConstantUndef *getOrAdd(GlobalContext *Ctx, Type Ty) {
82     if (Pool[Ty] == nullptr)
83       Pool[Ty] = ConstantUndef::create(Ctx, Ty, NextPoolID++);
84     return Pool[Ty];
85   }
86
87 private:
88   uint32_t NextPoolID;
89   std::vector<ConstantUndef *> Pool;
90 };
91
92 // The global constant pool bundles individual pools of each type of
93 // interest.
94 class ConstantPool {
95   ConstantPool(const ConstantPool &) = delete;
96   ConstantPool &operator=(const ConstantPool &) = delete;
97
98 public:
99   ConstantPool() {}
100   TypePool<IceType_f32, float, ConstantFloat> Floats;
101   TypePool<IceType_f64, double, ConstantDouble> Doubles;
102   TypePool<IceType_i1, int8_t, ConstantInteger32> Integers1;
103   TypePool<IceType_i8, int8_t, ConstantInteger32> Integers8;
104   TypePool<IceType_i16, int16_t, ConstantInteger32> Integers16;
105   TypePool<IceType_i32, int32_t, ConstantInteger32> Integers32;
106   TypePool<IceType_i64, int64_t, ConstantInteger64> Integers64;
107   TypePool<IceType_i32, RelocatableTuple, ConstantRelocatable> Relocatables;
108   TypePool<IceType_i32, RelocatableTuple, ConstantRelocatable>
109       ExternRelocatables;
110   UndefPool Undefs;
111 };
112
113 void GlobalContext::CodeStats::dump(const IceString &Name, Ostream &Str) {
114   if (!ALLOW_DUMP)
115     return;
116 #define X(str, tag)                                                            \
117   Str << "|" << Name << "|" str "|" << Stats[CS_##tag] << "\n";
118   CODESTATS_TABLE
119 #undef X
120   Str << "|" << Name << "|Spills+Fills|"
121       << Stats[CS_NumSpills] + Stats[CS_NumFills] << "\n";
122   Str << "|" << Name << "|Memory Usage|";
123   if (ssize_t MemUsed = llvm::TimeRecord::getCurrentTime(false).getMemUsed())
124     Str << MemUsed;
125   else
126     Str << "(requires '-track-memory')";
127   Str << "\n";
128 }
129
130 GlobalContext::GlobalContext(Ostream *OsDump, Ostream *OsEmit,
131                              ELFStreamer *ELFStr, VerboseMask Mask,
132                              TargetArch Arch, OptLevel Opt,
133                              IceString TestPrefix, const ClFlags &Flags)
134     : ConstPool(new ConstantPool()), ErrorStatus(), StrDump(OsDump),
135       StrEmit(OsEmit), VMask(Mask), Arch(Arch), Opt(Opt),
136       TestPrefix(TestPrefix), Flags(Flags), RNG(""), ObjectWriter(),
137       CfgQ(/*MaxSize=*/Flags.NumTranslationThreads,
138            /*Sequential=*/(Flags.NumTranslationThreads == 0)) {
139   // Make sure thread_local fields are properly initialized before any
140   // accesses are made.  Do this here instead of at the start of
141   // main() so that all clients (e.g. unit tests) can benefit for
142   // free.
143   GlobalContext::TlsInit();
144   Cfg::TlsInit();
145   // Create a new ThreadContext for the current thread.  No need to
146   // lock AllThreadContexts at this point since no other threads have
147   // access yet to this GlobalContext object.
148   ThreadContext *MyTLS = new ThreadContext();
149   AllThreadContexts.push_back(MyTLS);
150   ICE_TLS_SET_FIELD(TLS, MyTLS);
151   // Pre-register built-in stack names.
152   if (ALLOW_DUMP) {
153     // TODO(stichnot): There needs to be a strong relationship between
154     // the newTimerStackID() return values and TSK_Default/TSK_Funcs.
155     newTimerStackID("Total across all functions");
156     newTimerStackID("Per-function summary");
157   }
158   Timers.initInto(MyTLS->Timers);
159   if (Flags.UseELFWriter) {
160     ObjectWriter.reset(new ELFObjectWriter(*this, *ELFStr));
161   }
162 }
163
164 void GlobalContext::translateFunctions() {
165   while (std::unique_ptr<Cfg> Func = cfgQueueBlockingPop()) {
166     // Install Func in TLS for Cfg-specific container allocators.
167     Cfg::setCurrentCfg(Func.get());
168     // Reset per-function stats being accumulated in TLS.
169     resetStats();
170     // Set verbose level to none if the current function does NOT
171     // match the -verbose-focus command-line option.
172     if (!matchSymbolName(Func->getFunctionName(), getFlags().VerboseFocusOn))
173       Func->setVerbose(IceV_None);
174     // Disable translation if -notranslate is specified, or if the
175     // current function matches the -translate-only option.  If
176     // translation is disabled, just dump the high-level IR and
177     // continue.
178     if (getFlags().DisableTranslation ||
179         !matchSymbolName(Func->getFunctionName(), getFlags().TranslateOnly)) {
180       Func->dump();
181     } else {
182       Func->translate();
183       if (Func->hasError()) {
184         getErrorStatus()->assign(EC_Translation);
185         OstreamLocker L(this);
186         getStrDump() << "ICE translation error: " << Func->getError() << "\n";
187       } else {
188         if (getFlags().UseIntegratedAssembler)
189           Func->emitIAS();
190         else
191           Func->emit();
192         // TODO(stichnot): actually add to emit queue
193       }
194       dumpStats(Func->getFunctionName());
195     }
196     Cfg::setCurrentCfg(nullptr);
197     // The Cfg now gets deleted as Func goes out of scope.
198   }
199 }
200
201 // Scan a string for S[0-9A-Z]*_ patterns and replace them with
202 // S<num>_ where <num> is the next base-36 value.  If a type name
203 // legitimately contains that pattern, then the substitution will be
204 // made in error and most likely the link will fail.  In this case,
205 // the test classes can be rewritten not to use that pattern, which is
206 // much simpler and more reliable than implementing a full demangling
207 // parser.  Another substitution-in-error may occur if a type
208 // identifier ends with the pattern S[0-9A-Z]*, because an immediately
209 // following substitution string like "S1_" or "PS1_" may be combined
210 // with the previous type.
211 void GlobalContext::incrementSubstitutions(ManglerVector &OldName) const {
212   const std::locale CLocale("C");
213   // Provide extra space in case the length of <num> increases.
214   ManglerVector NewName(OldName.size() * 2);
215   size_t OldPos = 0;
216   size_t NewPos = 0;
217   size_t OldLen = OldName.size();
218   for (; OldPos < OldLen; ++OldPos, ++NewPos) {
219     if (OldName[OldPos] == '\0')
220       break;
221     if (OldName[OldPos] == 'S') {
222       // Search forward until we find _ or invalid character (including \0).
223       bool AllZs = true;
224       bool Found = false;
225       size_t Last;
226       for (Last = OldPos + 1; Last < OldLen; ++Last) {
227         char Ch = OldName[Last];
228         if (Ch == '_') {
229           Found = true;
230           break;
231         } else if (std::isdigit(Ch) || std::isupper(Ch, CLocale)) {
232           if (Ch != 'Z')
233             AllZs = false;
234         } else {
235           // Invalid character, stop searching.
236           break;
237         }
238       }
239       if (Found) {
240         NewName[NewPos++] = OldName[OldPos++]; // 'S'
241         size_t Length = Last - OldPos;
242         // NewPos and OldPos point just past the 'S'.
243         assert(NewName[NewPos - 1] == 'S');
244         assert(OldName[OldPos - 1] == 'S');
245         assert(OldName[OldPos + Length] == '_');
246         if (AllZs) {
247           // Replace N 'Z' characters with a '0' (if N=0) or '1' (if
248           // N>0) followed by N '0' characters.
249           NewName[NewPos++] = (Length ? '1' : '0');
250           for (size_t i = 0; i < Length; ++i) {
251             NewName[NewPos++] = '0';
252           }
253         } else {
254           // Iterate right-to-left and increment the base-36 number.
255           bool Carry = true;
256           for (size_t i = 0; i < Length; ++i) {
257             size_t Offset = Length - 1 - i;
258             char Ch = OldName[OldPos + Offset];
259             if (Carry) {
260               Carry = false;
261               switch (Ch) {
262               case '9':
263                 Ch = 'A';
264                 break;
265               case 'Z':
266                 Ch = '0';
267                 Carry = true;
268                 break;
269               default:
270                 ++Ch;
271                 break;
272               }
273             }
274             NewName[NewPos + Offset] = Ch;
275           }
276           NewPos += Length;
277         }
278         OldPos = Last;
279         // Fall through and let the '_' be copied across.
280       }
281     }
282     NewName[NewPos] = OldName[OldPos];
283   }
284   assert(NewName[NewPos] == '\0');
285   OldName = NewName;
286 }
287
288 // In this context, name mangling means to rewrite a symbol using a
289 // given prefix.  For a C++ symbol, nest the original symbol inside
290 // the "prefix" namespace.  For other symbols, just prepend the
291 // prefix.
292 IceString GlobalContext::mangleName(const IceString &Name) const {
293   // An already-nested name like foo::bar() gets pushed down one
294   // level, making it equivalent to Prefix::foo::bar().
295   //   _ZN3foo3barExyz ==> _ZN6Prefix3foo3barExyz
296   // A non-nested but mangled name like bar() gets nested, making it
297   // equivalent to Prefix::bar().
298   //   _Z3barxyz ==> ZN6Prefix3barExyz
299   // An unmangled, extern "C" style name, gets a simple prefix:
300   //   bar ==> Prefixbar
301   if (!ALLOW_DUMP || getTestPrefix().empty())
302     return Name;
303
304   unsigned PrefixLength = getTestPrefix().length();
305   ManglerVector NameBase(1 + Name.length());
306   const size_t BufLen = 30 + Name.length() + PrefixLength;
307   ManglerVector NewName(BufLen);
308   uint32_t BaseLength = 0; // using uint32_t due to sscanf format string
309
310   int ItemsParsed = sscanf(Name.c_str(), "_ZN%s", NameBase.data());
311   if (ItemsParsed == 1) {
312     // Transform _ZN3foo3barExyz ==> _ZN6Prefix3foo3barExyz
313     //   (splice in "6Prefix")          ^^^^^^^
314     snprintf(NewName.data(), BufLen, "_ZN%u%s%s", PrefixLength,
315              getTestPrefix().c_str(), NameBase.data());
316     // We ignore the snprintf return value (here and below).  If we
317     // somehow miscalculated the output buffer length, the output will
318     // be truncated, but it will be truncated consistently for all
319     // mangleName() calls on the same input string.
320     incrementSubstitutions(NewName);
321     return NewName.data();
322   }
323
324   // Artificially limit BaseLength to 9 digits (less than 1 billion)
325   // because sscanf behavior is undefined on integer overflow.  If
326   // there are more than 9 digits (which we test by looking at the
327   // beginning of NameBase), then we consider this a failure to parse
328   // a namespace mangling, and fall back to the simple prefixing.
329   ItemsParsed = sscanf(Name.c_str(), "_Z%9u%s", &BaseLength, NameBase.data());
330   if (ItemsParsed == 2 && BaseLength <= strlen(NameBase.data()) &&
331       !isdigit(NameBase[0])) {
332     // Transform _Z3barxyz ==> _ZN6Prefix3barExyz
333     //                           ^^^^^^^^    ^
334     // (splice in "N6Prefix", and insert "E" after "3bar")
335     // But an "I" after the identifier indicates a template argument
336     // list terminated with "E"; insert the new "E" before/after the
337     // old "E".  E.g.:
338     // Transform _Z3barIabcExyz ==> _ZN6Prefix3barIabcEExyz
339     //                                ^^^^^^^^         ^
340     // (splice in "N6Prefix", and insert "E" after "3barIabcE")
341     ManglerVector OrigName(Name.length());
342     ManglerVector OrigSuffix(Name.length());
343     uint32_t ActualBaseLength = BaseLength;
344     if (NameBase[ActualBaseLength] == 'I') {
345       ++ActualBaseLength;
346       while (NameBase[ActualBaseLength] != 'E' &&
347              NameBase[ActualBaseLength] != '\0')
348         ++ActualBaseLength;
349     }
350     strncpy(OrigName.data(), NameBase.data(), ActualBaseLength);
351     OrigName[ActualBaseLength] = '\0';
352     strcpy(OrigSuffix.data(), NameBase.data() + ActualBaseLength);
353     snprintf(NewName.data(), BufLen, "_ZN%u%s%u%sE%s", PrefixLength,
354              getTestPrefix().c_str(), BaseLength, OrigName.data(),
355              OrigSuffix.data());
356     incrementSubstitutions(NewName);
357     return NewName.data();
358   }
359
360   // Transform bar ==> Prefixbar
361   //                   ^^^^^^
362   return getTestPrefix() + Name;
363 }
364
365 GlobalContext::~GlobalContext() {
366   llvm::DeleteContainerPointers(AllThreadContexts);
367 }
368
369 // TODO(stichnot): Consider adding thread-local caches of constant
370 // pool entries to reduce contention.
371
372 // All locking is done by the getConstantInt[0-9]+() target function.
373 Constant *GlobalContext::getConstantInt(Type Ty, int64_t Value) {
374   switch (Ty) {
375   case IceType_i1:
376     return getConstantInt1(Value);
377   case IceType_i8:
378     return getConstantInt8(Value);
379   case IceType_i16:
380     return getConstantInt16(Value);
381   case IceType_i32:
382     return getConstantInt32(Value);
383   case IceType_i64:
384     return getConstantInt64(Value);
385   default:
386     llvm_unreachable("Bad integer type for getConstant");
387   }
388   return nullptr;
389 }
390
391 Constant *GlobalContext::getConstantInt1(int8_t ConstantInt1) {
392   ConstantInt1 &= INT8_C(1);
393   return getConstPool()->Integers1.getOrAdd(this, ConstantInt1);
394 }
395
396 Constant *GlobalContext::getConstantInt8(int8_t ConstantInt8) {
397   return getConstPool()->Integers8.getOrAdd(this, ConstantInt8);
398 }
399
400 Constant *GlobalContext::getConstantInt16(int16_t ConstantInt16) {
401   return getConstPool()->Integers16.getOrAdd(this, ConstantInt16);
402 }
403
404 Constant *GlobalContext::getConstantInt32(int32_t ConstantInt32) {
405   return getConstPool()->Integers32.getOrAdd(this, ConstantInt32);
406 }
407
408 Constant *GlobalContext::getConstantInt64(int64_t ConstantInt64) {
409   return getConstPool()->Integers64.getOrAdd(this, ConstantInt64);
410 }
411
412 Constant *GlobalContext::getConstantFloat(float ConstantFloat) {
413   return getConstPool()->Floats.getOrAdd(this, ConstantFloat);
414 }
415
416 Constant *GlobalContext::getConstantDouble(double ConstantDouble) {
417   return getConstPool()->Doubles.getOrAdd(this, ConstantDouble);
418 }
419
420 Constant *GlobalContext::getConstantSym(RelocOffsetT Offset,
421                                         const IceString &Name,
422                                         bool SuppressMangling) {
423   return getConstPool()->Relocatables.getOrAdd(
424       this, RelocatableTuple(Offset, Name, SuppressMangling));
425 }
426
427 Constant *GlobalContext::getConstantExternSym(const IceString &Name) {
428   const RelocOffsetT Offset = 0;
429   const bool SuppressMangling = true;
430   return getConstPool()->ExternRelocatables.getOrAdd(
431       this, RelocatableTuple(Offset, Name, SuppressMangling));
432 }
433
434 Constant *GlobalContext::getConstantUndef(Type Ty) {
435   return getConstPool()->Undefs.getOrAdd(this, Ty);
436 }
437
438 // All locking is done by the getConstant*() target function.
439 Constant *GlobalContext::getConstantZero(Type Ty) {
440   switch (Ty) {
441   case IceType_i1:
442     return getConstantInt1(0);
443   case IceType_i8:
444     return getConstantInt8(0);
445   case IceType_i16:
446     return getConstantInt16(0);
447   case IceType_i32:
448     return getConstantInt32(0);
449   case IceType_i64:
450     return getConstantInt64(0);
451   case IceType_f32:
452     return getConstantFloat(0);
453   case IceType_f64:
454     return getConstantDouble(0);
455   case IceType_v4i1:
456   case IceType_v8i1:
457   case IceType_v16i1:
458   case IceType_v16i8:
459   case IceType_v8i16:
460   case IceType_v4i32:
461   case IceType_v4f32: {
462     IceString Str;
463     llvm::raw_string_ostream BaseOS(Str);
464     BaseOS << "Unsupported constant type: " << Ty;
465     llvm_unreachable(BaseOS.str().c_str());
466   } break;
467   case IceType_void:
468   case IceType_NUM:
469     break;
470   }
471   llvm_unreachable("Unknown type");
472 }
473
474 ConstantList GlobalContext::getConstantPool(Type Ty) {
475   switch (Ty) {
476   case IceType_i1:
477   case IceType_i8:
478   case IceType_i16:
479   case IceType_i32:
480     return getConstPool()->Integers32.getConstantPool();
481   case IceType_i64:
482     return getConstPool()->Integers64.getConstantPool();
483   case IceType_f32:
484     return getConstPool()->Floats.getConstantPool();
485   case IceType_f64:
486     return getConstPool()->Doubles.getConstantPool();
487   case IceType_v4i1:
488   case IceType_v8i1:
489   case IceType_v16i1:
490   case IceType_v16i8:
491   case IceType_v8i16:
492   case IceType_v4i32:
493   case IceType_v4f32: {
494     IceString Str;
495     llvm::raw_string_ostream BaseOS(Str);
496     BaseOS << "Unsupported constant type: " << Ty;
497     llvm_unreachable(BaseOS.str().c_str());
498   } break;
499   case IceType_void:
500   case IceType_NUM:
501     break;
502   }
503   llvm_unreachable("Unknown type");
504 }
505
506 ConstantList GlobalContext::getConstantExternSyms() {
507   return getConstPool()->ExternRelocatables.getConstantPool();
508 }
509
510 TimerStackIdT GlobalContext::newTimerStackID(const IceString &Name) {
511   if (!ALLOW_DUMP)
512     return 0;
513   auto Timers = getTimers();
514   TimerStackIdT NewID = Timers->size();
515   Timers->push_back(TimerStack(Name));
516   return NewID;
517 }
518
519 TimerIdT GlobalContext::getTimerID(TimerStackIdT StackID,
520                                    const IceString &Name) {
521   auto Timers = &ICE_TLS_GET_FIELD(TLS)->Timers;
522   assert(StackID < Timers->size());
523   return Timers->at(StackID).getTimerID(Name);
524 }
525
526 void GlobalContext::pushTimer(TimerIdT ID, TimerStackIdT StackID) {
527   auto Timers = &ICE_TLS_GET_FIELD(TLS)->Timers;
528   assert(StackID < Timers->size());
529   Timers->at(StackID).push(ID);
530 }
531
532 void GlobalContext::popTimer(TimerIdT ID, TimerStackIdT StackID) {
533   auto Timers = &ICE_TLS_GET_FIELD(TLS)->Timers;
534   assert(StackID < Timers->size());
535   Timers->at(StackID).pop(ID);
536 }
537
538 void GlobalContext::resetTimer(TimerStackIdT StackID) {
539   auto Timers = &ICE_TLS_GET_FIELD(TLS)->Timers;
540   assert(StackID < Timers->size());
541   Timers->at(StackID).reset();
542 }
543
544 void GlobalContext::setTimerName(TimerStackIdT StackID,
545                                  const IceString &NewName) {
546   auto Timers = &ICE_TLS_GET_FIELD(TLS)->Timers;
547   assert(StackID < Timers->size());
548   Timers->at(StackID).setName(NewName);
549 }
550
551 // Note: cfgQueueBlockingPush and cfgQueueBlockingPop use unique_ptr
552 // at the interface to take and transfer ownership, but they
553 // internally store the raw Cfg pointer in the work queue.  This
554 // allows e.g. future queue optimizations such as the use of atomics
555 // to modify queue elements.
556 void GlobalContext::cfgQueueBlockingPush(std::unique_ptr<Cfg> Func) {
557   CfgQ.blockingPush(Func.release());
558 }
559
560 std::unique_ptr<Cfg> GlobalContext::cfgQueueBlockingPop() {
561   return std::unique_ptr<Cfg>(CfgQ.blockingPop());
562 }
563
564 void GlobalContext::dumpStats(const IceString &Name, bool Final) {
565   if (!ALLOW_DUMP || !getFlags().DumpStats)
566     return;
567   OstreamLocker OL(this);
568   if (Final) {
569     getStatsCumulative()->dump(Name, getStrDump());
570   } else {
571     ICE_TLS_GET_FIELD(TLS)->StatsFunction.dump(Name, getStrDump());
572   }
573 }
574
575 void GlobalContext::dumpTimers(TimerStackIdT StackID, bool DumpCumulative) {
576   if (!ALLOW_DUMP)
577     return;
578   auto Timers = getTimers();
579   assert(Timers->size() > StackID);
580   OstreamLocker L(this);
581   Timers->at(StackID).dump(getStrDump(), DumpCumulative);
582 }
583
584 void TimerMarker::push() {
585   switch (StackID) {
586   case GlobalContext::TSK_Default:
587     Active = Ctx->getFlags().SubzeroTimingEnabled;
588     break;
589   case GlobalContext::TSK_Funcs:
590     Active = Ctx->getFlags().TimeEachFunction;
591     break;
592   default:
593     break;
594   }
595   if (Active)
596     Ctx->pushTimer(ID, StackID);
597 }
598
599 void TimerMarker::pushCfg(const Cfg *Func) {
600   Ctx = Func->getContext();
601   Active = Func->getFocusedTiming() || Ctx->getFlags().SubzeroTimingEnabled;
602   if (Active)
603     Ctx->pushTimer(ID, StackID);
604 }
605
606 ICE_TLS_DEFINE_FIELD(GlobalContext::ThreadContext *, GlobalContext, TLS);
607
608 } // end of namespace Ice