OLD | NEW |
1 // Copyright 2009 the V8 project authors. All rights reserved. | 1 // Copyright 2009 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 421 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
432 SetSourcePosition(expr->position()); | 432 SetSourcePosition(expr->position()); |
433 | 433 |
434 Expression* rhs = expr->value(); | 434 Expression* rhs = expr->value(); |
435 // Left-hand side can only be a property, a global or a (parameter or | 435 // Left-hand side can only be a property, a global or a (parameter or |
436 // local) slot. | 436 // local) slot. |
437 Variable* var = expr->target()->AsVariableProxy()->AsVariable(); | 437 Variable* var = expr->target()->AsVariableProxy()->AsVariable(); |
438 Property* prop = expr->target()->AsProperty(); | 438 Property* prop = expr->target()->AsProperty(); |
439 if (var != NULL) { | 439 if (var != NULL) { |
440 Visit(rhs); | 440 Visit(rhs); |
441 ASSERT_EQ(Expression::kValue, rhs->context()); | 441 ASSERT_EQ(Expression::kValue, rhs->context()); |
442 EmitVariableAssignment(expr->context(), var); | 442 EmitVariableAssignment(expr); |
443 } else if (prop != NULL) { | 443 } else if (prop != NULL) { |
444 // Assignment to a property. | 444 // Assignment to a property. |
445 Visit(prop->obj()); | 445 Visit(prop->obj()); |
446 ASSERT_EQ(Expression::kValue, prop->obj()->context()); | 446 ASSERT_EQ(Expression::kValue, prop->obj()->context()); |
447 // Use the expression context of the key subexpression to detect whether | 447 // Use the expression context of the key subexpression to detect whether |
448 // we have decided to us a named or keyed IC. | 448 // we have decided to us a named or keyed IC. |
449 if (prop->key()->context() == Expression::kUninitialized) { | 449 if (prop->key()->context() == Expression::kUninitialized) { |
450 ASSERT(prop->key()->AsLiteral() != NULL); | 450 ASSERT(prop->key()->AsLiteral() != NULL); |
451 Visit(rhs); | 451 Visit(rhs); |
452 ASSERT_EQ(Expression::kValue, rhs->context()); | 452 ASSERT_EQ(Expression::kValue, rhs->context()); |
453 EmitNamedPropertyAssignment(expr->context(), | 453 EmitNamedPropertyAssignment(expr); |
454 prop->key()->AsLiteral()->handle()); | |
455 } else { | 454 } else { |
456 Visit(prop->key()); | 455 Visit(prop->key()); |
457 ASSERT_EQ(Expression::kValue, prop->key()->context()); | 456 ASSERT_EQ(Expression::kValue, prop->key()->context()); |
458 Visit(rhs); | 457 Visit(rhs); |
459 ASSERT_EQ(Expression::kValue, rhs->context()); | 458 ASSERT_EQ(Expression::kValue, rhs->context()); |
460 EmitKeyedPropertyAssignment(expr->context()); | 459 EmitKeyedPropertyAssignment(expr); |
461 } | 460 } |
462 } else { | 461 } else { |
463 UNREACHABLE(); | 462 UNREACHABLE(); |
464 } | 463 } |
465 } | 464 } |
466 | 465 |
467 | 466 |
468 void FastCodeGenerator::VisitCatchExtensionObject(CatchExtensionObject* expr) { | 467 void FastCodeGenerator::VisitCatchExtensionObject(CatchExtensionObject* expr) { |
469 UNREACHABLE(); | 468 UNREACHABLE(); |
470 } | 469 } |
(...skipping 11 matching lines...) Expand all Loading... |
482 | 481 |
483 void FastCodeGenerator::VisitThisFunction(ThisFunction* expr) { | 482 void FastCodeGenerator::VisitThisFunction(ThisFunction* expr) { |
484 UNREACHABLE(); | 483 UNREACHABLE(); |
485 } | 484 } |
486 | 485 |
487 | 486 |
488 #undef __ | 487 #undef __ |
489 | 488 |
490 | 489 |
491 } } // namespace v8::internal | 490 } } // namespace v8::internal |
OLD | NEW |