Home | History | Annotate | Download | only in compiler

Lines Matching refs:variable

404   // Compute local variable liveness information and use it to relax
455 Variable* arguments = info()->scope()->arguments();
467 // Gets the bailout id just before reading a variable proxy, but only for
505 // Bind the receiver variable.
516 // (receiver is variable index -1 but {Parameter} node index 0 and located at
553 void AstGraphBuilder::Environment::Bind(Variable* variable, Node* node) {
554 DCHECK(variable->IsStackAllocated());
555 if (variable->IsParameter()) {
556 // The parameter indices are shifted by 1 (receiver is variable
558 values()->at(variable->index() + 1) = node;
560 DCHECK(variable->IsStackLocal());
561 values()->at(variable->index() + parameters_count_) = node;
564 liveness_block()->Bind(variable->index());
570 Node* AstGraphBuilder::Environment::Lookup(Variable* variable) {
571 DCHECK(variable->IsStackAllocated());
572 if (variable->IsParameter()) {
573 // The parameter indices are shifted by 1 (receiver is variable
575 return values()->at(variable->index() + 1);
577 DCHECK(variable->IsStackLocal());
580 liveness_block()->Lookup(variable->index());
582 return values()->at(variable->index() + parameters_count_);
929 Variable* variable = decl->proxy()->var();
930 switch (variable->location()) {
932 DCHECK(!variable->binding_needs_init());
933 globals()->push_back(variable->name());
943 if (variable->binding_needs_init()) {
945 environment()->Bind(variable, value);
949 if (variable->binding_needs_init()) {
951 const Operator* op = javascript()->StoreContext(0, variable->index());
963 Variable* variable = decl->proxy()->var();
964 switch (variable->location()) {
970 globals()->push_back(variable->name());
987 environment()->Bind(variable, value);
993 const Operator* op = javascript()->StoreContext(0, variable->index());
1448 // Left-hand side can only be a property, a global or a variable slot.
1455 case VARIABLE: {
1456 Variable* variable = expr->target()->AsVariableProxy()->var();
1457 if (variable->location() == VariableLocation::PARAMETER ||
1458 variable->location() == VariableLocation::LOCAL ||
1459 variable->location() == VariableLocation::CONTEXT) {
1482 case VARIABLE: {
1537 case VARIABLE: {
1538 Variable* variable = expr->target()->AsVariableProxy()->var();
1539 BuildVariableAssignment(variable, value, expr->op(), feedback, expr->id(),
1588 case VARIABLE:
1799 // Left-hand side can only be a property, a global or a variable slot.
1805 if (is_postfix && assign_type != VARIABLE) {
1813 case VARIABLE: {
1865 if (assign_type != VARIABLE) {
1881 case VARIABLE: {
1882 Variable* variable = expr->expression()->AsVariableProxy()->var();
1884 BuildVariableAssignment(variable, value, expr->op(), feedback,
2114 Variable* variable = expr->expression()->AsVariableProxy()->var();
2115 DCHECK(is_sloppy(language_mode()) || variable->is_this());
2116 value = BuildVariableDelete(variable, expr->id(),
2143 // perform a non-contextual load in case the operand is a variable proxy.
2272 // Context variable (at bottom of the context chain).
2273 Variable* variable = scope->receiver();
2274 DCHECK_EQ(0, scope->ContextChainLength(variable->scope()));
2275 const Operator* op = javascript()->StoreContext(0, variable->index());
2283 Variable* variable = scope->parameter(i);
2284 if (!variable->IsContextSlot()) continue;
2286 // Context variable (at bottom of the context chain).
2287 DCHECK_EQ(0, scope->ContextChainLength(variable->scope()));
2288 const Operator* op = javascript()->StoreContext(0, variable->index());
2336 Node* AstGraphBuilder::BuildArgumentsObject(Variable* arguments) {
2348 // Assign the object to the {arguments} variable. This should never lazy
2356 Node* AstGraphBuilder::BuildHoleCheckThenThrow(Node* value, Variable* variable,
2365 Node* error = BuildThrowReferenceError(variable, bailout_id);
2374 Node* AstGraphBuilder::BuildHoleCheckElseThrow(Node* value, Variable* variable,
2385 Node* error = BuildThrowReferenceError(variable, bailout_id);
2391 Node* AstGraphBuilder::BuildVariableLoad(Variable* variable,
2397 switch (variable->location()) {
2399 // Global var, const, or let variable.
2400 Handle<Name> name = variable->name();
2408 // Local var, const, or let variable.
2409 Node* value = environment()->Lookup(variable);
2410 if (variable->binding_needs_init()) {
2413 value = BuildThrowReferenceError(variable, bailout_id);
2415 value = BuildHoleCheckThenThrow(value, variable, value, bailout_id);
2421 // Context variable (potentially up the context chain).
2422 int depth = current_scope()->ContextChainLength(variable->scope());
2423 // TODO(mstarzinger): The {maybe_assigned} flag computed during variable
2426 bool immutable = variable->maybe_assigned() == kNotAssigned &&
2429 javascript()->LoadContext(depth, variable->index(), immutable);
2434 if (variable->binding_needs_init()) {
2436 value = BuildHoleCheckThenThrow(value, variable, value, bailout_id);
2449 Node* AstGraphBuilder::BuildVariableDelete(Variable* variable,
2452 switch (variable->location()) {
2454 // Global var, const, or let variable.
2456 Node* name = jsgraph()->Constant(variable->name());
2465 // Local var, const, or let variable or context variable.
2466 return jsgraph()->BooleanConstant(variable->is_this());
2477 Variable* variable, Node* value, Token::Value op,
2481 VariableMode mode = variable->mode();
2482 switch (variable->location()) {
2484 // Global var, const, or let variable.
2485 Handle<Name> name = variable->name();
2492 // Local var, const, or let variable.
2495 // that we still perform a lookup to keep the variable live, because
2496 // baseline code might contain debug code that inspects the variable.
2497 Node* current = environment()->Lookup(variable);
2500 variable->binding_needs_init()) {
2502 Node* current = environment()->Lookup(variable);
2504 return BuildThrowReferenceError(variable, bailout_id);
2506 BuildHoleCheckThenThrow(current, variable, value, bailout_id);
2510 // Note that the {this} variable is the only const variable being able
2512 Node* current = environment()->Lookup(variable);
2513 if (current->op() != the_hole->op() && variable->is_this()) {
2514 value = BuildHoleCheckElseThrow(current, variable, value, bailout_id);
2517 variable->is_sloppy_function_name()) {
2521 DCHECK(!variable->binding_needs_init());
2522 if (variable->throw_on_const_assignment(language_mode())) {
2527 if (variable->binding_needs_init()) {
2528 Node* current = environment()->Lookup(variable);
2530 return BuildThrowReferenceError(variable, bailout_id);
2532 BuildHoleCheckThenThrow(current, variable, value, bailout_id);
2538 environment()->Bind(variable, value);
2541 // Context variable (potentially up the context chain).
2542 int depth = current_scope()->ContextChainLength(variable->scope());
2543 if (mode == LET && op != Token::INIT && variable->binding_needs_init()) {
2546 javascript()->LoadContext(depth, variable->index(), false);
2548 value = BuildHoleCheckThenThrow(current, variable, value, bailout_id);
2551 // Note that the {this} variable is the only const variable being able
2553 if (variable->is_this()) {
2555 javascript()->LoadContext(depth, variable->index(), false);
2557 value = BuildHoleCheckElseThrow(current, variable, value, bailout_id);
2560 variable->is_sloppy_function_name()) {
2564 DCHECK(!variable->binding_needs_init());
2565 if (variable->throw_on_const_assignment(language_mode())) {
2570 if (variable->binding_needs_init()) {
2572 javascript()->LoadContext(depth, variable->index(), false);
2574 BuildHoleCheckThenThrow(current, variable, value, bailout_id);
2579 const Operator* op = javascript()->StoreContext(depth, variable->index());
2709 Node* AstGraphBuilder::BuildThrowReferenceError(Variable* variable,
2711 Node* variable_name = jsgraph()->Constant(variable->name());
2985 // Record the merge for the local variable liveness calculation.