Home | History | Annotate | Download | only in interpreter

Lines Matching refs:VARIABLE

756   Variable* rest_parameter = closure_scope()->rest_parameter();
759 // Build assignment to {.this_function} variable if it is used.
762 // Build assignment to {new.target} variable if it is used.
885 Variable* variable = decl->proxy()->var();
886 switch (variable->location()) {
888 DCHECK(!variable->binding_needs_init());
890 globals_builder()->AddUndefinedDeclaration(variable->raw_name(), slot);
894 if (variable->binding_needs_init()) {
895 Register destination(builder()->Local(variable->index()));
900 if (variable->binding_needs_init()) {
901 // The parameter indices are shifted by 1 (receiver is variable
903 Register destination(builder()->Parameter(variable->index() + 1));
908 if (variable->binding_needs_init()) {
909 DCHECK_EQ(0, execution_context()->ContextChainDepth(variable->scope()));
911 variable->index(), 0);
915 DCHECK_EQ(VAR, variable->mode());
916 DCHECK(!variable->binding_needs_init());
921 ->LoadLiteral(variable->raw_name())
927 if (variable->IsExport() && variable->binding_needs_init()) {
929 BuildVariableAssignment(variable, Token::INIT, FeedbackSlot::Invalid(),
938 Variable* variable = decl->proxy()->var();
939 DCHECK(variable->mode() == LET || variable->mode() == VAR);
940 switch (variable->location()) {
944 variable->raw_name(), slot, decl->fun()->LiteralFeedbackSlot(),
951 BuildVariableAssignment(variable, Token::INIT, FeedbackSlot::Invalid(),
956 DCHECK_EQ(0, execution_context()->ContextChainDepth(variable->scope()));
958 builder()->StoreContextSlot(execution_context()->reg(), variable->index(),
965 ->LoadLiteral(variable->raw_name())
973 DCHECK_EQ(variable->mode(), LET);
974 DCHECK(variable->IsExport());
976 BuildVariableAssignment(variable, Token::INIT, FeedbackSlot::Invalid(),
994 Variable* var = closure_scope()->LookupLocal(entry->local_name);
1253 case VARIABLE: {
1395 BuildNewLocalCatchContext(stmt->variable(), stmt->scope());
1514 // Assign to class variable.
1916 void BytecodeGenerator::BuildVariableLoad(Variable* variable, FeedbackSlot slot,
1919 switch (variable->location()) {
1921 Register source(builder()->Local(variable->index()));
1922 // We need to load the variable into the accumulator, even when in a
1924 // subsequent expressions assign to the same variable.
1927 BuildThrowIfHole(variable->raw_name());
1932 // The parameter indices are shifted by 1 (receiver is variable
1934 Register source = builder()->Parameter(variable->index() + 1);
1935 // We need to load the variable into the accumulator, even when in a
1937 // subsequent expressions assign to the same variable.
1940 BuildThrowIfHole(variable->raw_name());
1948 if (variable->raw_name() == undefined_string()) {
1951 builder()->LoadGlobal(variable->raw_name(), feedback_index(slot),
1957 int depth = execution_context()->ContextChainDepth(variable->scope());
1968 (variable->maybe_assigned() == kNotAssigned)
1972 builder()->LoadContextSlot(context_reg, variable->index(), depth,
1975 BuildThrowIfHole(variable->raw_name());
1980 switch (variable->mode()) {
1982 Variable* local_variable = variable->local_if_not_shadowed();
1985 builder()->LoadLookupContextSlot(variable->raw_name(), typeof_mode,
1988 BuildThrowIfHole(variable->raw_name());
1995 builder()->LoadLookupGlobalSlot(variable->raw_name(), typeof_mode,
2000 builder()->LoadLookupSlot(variable->raw_name(), typeof_mode);
2005 int depth = execution_context()->ContextChainDepth(variable->scope());
2006 builder()->LoadModuleVariable(variable->index(), depth);
2008 BuildThrowIfHole(variable->raw_name());
2016 Variable* variable, FeedbackSlot slot, HoleCheckMode hole_check_mode,
2019 BuildVariableLoad(variable, slot, hole_check_mode, typeof_mode);
2042 Variable* var_promise = closure_scope()->promise_var();
2082 void BytecodeGenerator::BuildHoleCheckForVariableAssignment(Variable* variable,
2084 if (variable->is_this() && variable->mode() == CONST && op == Token::INIT) {
2085 // Perform an initialization check for 'this'. 'this' variable is the
2086 // only variable able to trigger bind operations outside the TDZ
2098 DCHECK(IsLexicalVariableMode(variable->mode()));
2099 BuildThrowIfHole(variable->raw_name());
2103 void BytecodeGenerator::BuildVariableAssignment(Variable* variable,
2107 VariableMode mode = variable->mode();
2110 switch (variable->location()) {
2114 if (VariableLocation::PARAMETER == variable->location()) {
2115 destination = builder()->Parameter(variable->index() + 1);
2117 destination = builder()->Local(variable->index());
2127 BuildHoleCheckForVariableAssignment(variable, op);
2133 } else if (variable->throw_on_const_assignment(language_mode())) {
2139 builder()->StoreGlobal(variable->raw_name(), feedback_index(slot),
2144 int depth = execution_context()->ContextChainDepth(variable->scope());
2160 .LoadContextSlot(context_reg, variable->index(), depth,
2163 BuildHoleCheckForVariableAssignment(variable, op);
2168 builder()->StoreContextSlot(context_reg, variable->index(), depth);
2169 variable->throw_on_const_assignment(language_mode())) {
2175 builder()->StoreLookupSlot(variable->raw_name(), language_mode());
2189 DCHECK(variable->IsExport());
2191 int depth = execution_context()->ContextChainDepth(variable->scope());
2196 .LoadModuleVariable(variable->index(), depth);
2197 BuildHoleCheckForVariableAssignment(variable, op);
2200 builder()->StoreModuleVariable(variable->index(), depth);
2212 // Left-hand side can only be a property, a global or a variable slot.
2218 case VARIABLE:
2219 // Nothing to do to evaluate variable assignment LHS.
2260 case VARIABLE: {
2310 case VARIABLE: {
2427 case VARIABLE:
2542 // Load callee as a global variable.
2561 Variable* variable = callee_expr->AsVariableProxy()->var();
2563 ->LoadLiteral(variable->raw_name())
2651 // {new.target} variable.
2716 // perform a non-contextual load in case the operand is a variable proxy.
2781 Variable* variable = proxy->var();
2782 DCHECK(is_sloppy(language_mode()) || variable->is_this());
2783 switch (variable->location()) {
2796 .LoadLiteral(variable->raw_name())
2805 if (variable->is_this()) {
2815 ->LoadLiteral(variable->raw_name())
2833 // Left-hand side can only be a property, a global or a variable slot.
2844 case VARIABLE: {
2912 case VARIABLE: {
3209 Variable* variable = scope->receiver();
3211 // Context variable (at bottom of the context chain).
3212 DCHECK_EQ(0, scope->ContextChainLength(variable->scope()));
3214 execution_context()->reg(), variable->index(), 0);
3220 Variable* variable = scope->parameter(i);
3221 if (!variable->IsContextSlot()) continue;
3223 // The parameter indices are shifted by 1 (receiver is variable
3226 // Context variable (at bottom of the context chain).
3227 DCHECK_EQ(0, scope->ContextChainLength(variable->scope()));
3229 execution_context()->reg(), variable->index(), 0);
3251 void BytecodeGenerator::BuildNewLocalCatchContext(Variable* variable,
3254 DCHECK(variable->IsContextSlot());
3259 builder()->CreateCatchContext(exception, variable->raw_name(), scope);
3284 void BytecodeGenerator::VisitArgumentsObject(Variable* variable) {
3285 if (variable == nullptr) return;
3287 DCHECK(variable->IsContextSlot() || variable->IsStackAllocated());
3290 // {arguments} variable.
3296 BuildVariableAssignment(variable, Token::ASSIGN, FeedbackSlot::Invalid(),
3300 void BytecodeGenerator::VisitRestArgumentsArray(Variable* rest) {
3304 // variable.
3311 void BytecodeGenerator::VisitThisFunctionVariable(Variable* variable) {
3312 if (variable == nullptr) return;
3314 // Store the closure we were called with in the given variable.
3316 BuildVariableAssignment(variable, Token::INIT, FeedbackSlot::Invalid(),
3320 void BytecodeGenerator::VisitNewTargetVariable(Variable* variable) {
3321 if (variable == nullptr) return;
3323 // Store the new target we were called with in the given variable.
3325 BuildVariableAssignment(variable, Token::INIT, FeedbackSlot::Invalid(),
3330 // before a local variable containing the <new.target> is used. Using a label