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

Side by Side Diff: src/compiler.cc

Issue 536029: Fix a problem with const initialization in the top-level code generator.... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 10 years, 11 months 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/arm/codegen-arm.cc ('k') | src/fast-codegen.cc » ('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 870 matching lines...) Expand 10 before | Expand all | Expand 10 after
881 void CodeGenSelector::VisitAssignment(Assignment* expr) { 881 void CodeGenSelector::VisitAssignment(Assignment* expr) {
882 // We support plain non-compound assignments to properties, parameters and 882 // We support plain non-compound assignments to properties, parameters and
883 // non-context (stack-allocated) locals, and global variables. 883 // non-context (stack-allocated) locals, and global variables.
884 Token::Value op = expr->op(); 884 Token::Value op = expr->op();
885 if (op == Token::INIT_CONST) BAILOUT("initialize constant"); 885 if (op == Token::INIT_CONST) BAILOUT("initialize constant");
886 886
887 Variable* var = expr->target()->AsVariableProxy()->AsVariable(); 887 Variable* var = expr->target()->AsVariableProxy()->AsVariable();
888 Property* prop = expr->target()->AsProperty(); 888 Property* prop = expr->target()->AsProperty();
889 ASSERT(var == NULL || prop == NULL); 889 ASSERT(var == NULL || prop == NULL);
890 if (var != NULL) { 890 if (var != NULL) {
891 if (var->mode() == Variable::CONST) {
892 BAILOUT("Assignment to const");
893 }
891 // All global variables are supported. 894 // All global variables are supported.
892 if (!var->is_global()) { 895 if (!var->is_global()) {
893 ASSERT(var->slot() != NULL); 896 ASSERT(var->slot() != NULL);
894 Slot::Type type = var->slot()->type(); 897 Slot::Type type = var->slot()->type();
895 if (type == Slot::LOOKUP) { 898 if (type == Slot::LOOKUP) {
896 BAILOUT("Lookup slot"); 899 BAILOUT("Lookup slot");
897 } 900 }
898 } 901 }
899 } else if (prop != NULL) { 902 } else if (prop != NULL) {
900 ProcessExpression(prop->obj(), Expression::kValue); 903 ProcessExpression(prop->obj(), Expression::kValue);
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after
1120 1123
1121 void CodeGenSelector::VisitThisFunction(ThisFunction* expr) { 1124 void CodeGenSelector::VisitThisFunction(ThisFunction* expr) {
1122 // ThisFunction is supported. 1125 // ThisFunction is supported.
1123 } 1126 }
1124 1127
1125 #undef BAILOUT 1128 #undef BAILOUT
1126 #undef CHECK_BAILOUT 1129 #undef CHECK_BAILOUT
1127 1130
1128 1131
1129 } } // namespace v8::internal 1132 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/arm/codegen-arm.cc ('k') | src/fast-codegen.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698