39 entries_stack_(10, zone),
40 names_stack_(5, zone),
41 funcs_to_infer_(4, zone),
51 isolate()->runtime_state(), name->Get(0))) {
52 names_stack_.
Add(Name(name, kEnclosingConstructorName), zone());
58 if (
IsOpen() && !isolate()->heap()->prototype_symbol()->Equals(*name)) {
59 names_stack_.
Add(Name(name, kLiteralName), zone());
65 if (
IsOpen() && !isolate()->heap()->result_symbol()->Equals(*name)) {
66 names_stack_.
Add(Name(name, kVariableName), zone());
72 return MakeNameFromStackHelper(0, isolate()->factory()->empty_string());
78 if (pos >= names_stack_.length())
return prev;
79 if (pos < names_stack_.length() - 1 &&
80 names_stack_.
at(pos).type == kVariableName &&
81 names_stack_.
at(pos + 1).type == kVariableName) {
83 return MakeNameFromStackHelper(pos + 1, prev);
86 Factory* factory = isolate()->
factory();
88 factory->dot_symbol(), names_stack_.
at(pos).name);
89 return MakeNameFromStackHelper(pos + 1,
90 factory->NewConsString(prev, curr));
92 return MakeNameFromStackHelper(pos + 1, names_stack_.
at(pos).name);
98 void FuncNameInferrer::InferFunctionsNames() {
99 Handle<String> func_name = MakeNameFromStack();
100 for (
int i = 0; i < funcs_to_infer_.length(); ++i) {
101 funcs_to_infer_[i]->set_inferred_name(func_name);
103 funcs_to_infer_.Rewind(0);
void PushVariableName(Handle< String > name)
FuncNameInferrer(Isolate *isolate, Zone *zone)
void PushEnclosingName(Handle< String > name)
void PushLiteralName(Handle< String > name)
static bool IsUpperCaseChar(RuntimeState *runtime_state, uint16_t ch)
void Add(const T &element, AllocationPolicy allocator=AllocationPolicy())
Handle< String > NewConsString(Handle< String > first, Handle< String > second)