Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(94)

Side by Side Diff: src/compiler.cc

Issue 486008: Adding compound assignments to the top-level compiler. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 11 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/ast.h ('k') | src/fast-codegen.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 881 matching lines...) Expand 10 before | Expand all | Expand 10 after
892 void CodeGenSelector::VisitCatchExtensionObject(CatchExtensionObject* expr) { 892 void CodeGenSelector::VisitCatchExtensionObject(CatchExtensionObject* expr) {
893 BAILOUT("CatchExtensionObject"); 893 BAILOUT("CatchExtensionObject");
894 } 894 }
895 895
896 896
897 void CodeGenSelector::VisitAssignment(Assignment* expr) { 897 void CodeGenSelector::VisitAssignment(Assignment* expr) {
898 // We support plain non-compound assignments to properties, parameters and 898 // We support plain non-compound assignments to properties, parameters and
899 // non-context (stack-allocated) locals, and global variables. 899 // non-context (stack-allocated) locals, and global variables.
900 Token::Value op = expr->op(); 900 Token::Value op = expr->op();
901 if (op == Token::INIT_CONST) BAILOUT("initialize constant"); 901 if (op == Token::INIT_CONST) BAILOUT("initialize constant");
902 if (op != Token::ASSIGN && op != Token::INIT_VAR) {
903 BAILOUT("compound assignment");
904 }
905 902
906 Variable* var = expr->target()->AsVariableProxy()->AsVariable(); 903 Variable* var = expr->target()->AsVariableProxy()->AsVariable();
907 Property* prop = expr->target()->AsProperty(); 904 Property* prop = expr->target()->AsProperty();
908 ASSERT(var == NULL || prop == NULL); 905 ASSERT(var == NULL || prop == NULL);
909 if (var != NULL) { 906 if (var != NULL) {
910 // All global variables are supported. 907 // All global variables are supported.
911 if (!var->is_global()) { 908 if (!var->is_global()) {
912 ASSERT(var->slot() != NULL); 909 ASSERT(var->slot() != NULL);
913 Slot::Type type = var->slot()->type(); 910 Slot::Type type = var->slot()->type();
914 if (type == Slot::LOOKUP) { 911 if (type == Slot::LOOKUP) {
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after
1126 1123
1127 void CodeGenSelector::VisitThisFunction(ThisFunction* expr) { 1124 void CodeGenSelector::VisitThisFunction(ThisFunction* expr) {
1128 // ThisFunction is supported. 1125 // ThisFunction is supported.
1129 } 1126 }
1130 1127
1131 #undef BAILOUT 1128 #undef BAILOUT
1132 #undef CHECK_BAILOUT 1129 #undef CHECK_BAILOUT
1133 1130
1134 1131
1135 } } // namespace v8::internal 1132 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/ast.h ('k') | src/fast-codegen.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698