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

Side by Side Diff: src/arm/full-codegen-arm.cc

Issue 8118032: Fix load of potentially eval-shadowed let bindings. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Port to arm and x64. Created 9 years, 2 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 | « no previous file | src/ia32/full-codegen-ia32.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 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 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 1207 matching lines...) Expand 10 before | Expand all | Expand 10 after
1218 // eval-introduced variables. Eval is used a lot without 1218 // eval-introduced variables. Eval is used a lot without
1219 // introducing variables. In those cases, we do not want to 1219 // introducing variables. In those cases, we do not want to
1220 // perform a runtime call for all variables in the scope 1220 // perform a runtime call for all variables in the scope
1221 // containing the eval. 1221 // containing the eval.
1222 if (var->mode() == Variable::DYNAMIC_GLOBAL) { 1222 if (var->mode() == Variable::DYNAMIC_GLOBAL) {
1223 EmitLoadGlobalCheckExtensions(var, typeof_state, slow); 1223 EmitLoadGlobalCheckExtensions(var, typeof_state, slow);
1224 __ jmp(done); 1224 __ jmp(done);
1225 } else if (var->mode() == Variable::DYNAMIC_LOCAL) { 1225 } else if (var->mode() == Variable::DYNAMIC_LOCAL) {
1226 Variable* local = var->local_if_not_shadowed(); 1226 Variable* local = var->local_if_not_shadowed();
1227 __ ldr(r0, ContextSlotOperandCheckExtensions(local, slow)); 1227 __ ldr(r0, ContextSlotOperandCheckExtensions(local, slow));
1228 if (local->mode() == Variable::CONST) { 1228 if (local->mode() == Variable::CONST ||
1229 local->mode() == Variable::LET) {
1229 __ CompareRoot(r0, Heap::kTheHoleValueRootIndex); 1230 __ CompareRoot(r0, Heap::kTheHoleValueRootIndex);
1230 __ LoadRoot(r0, Heap::kUndefinedValueRootIndex, eq); 1231 if (local->mode() == Variable::CONST) {
1232 __ LoadRoot(r0, Heap::kUndefinedValueRootIndex, eq);
1233 } else { // Variable::LE
rossberg 2011/10/06 13:34:04 Typo
1234 __ b(ne, done);
1235 __ mov(r0, Operand(var->name()));
1236 __ push(r0);
1237 __ CallRuntime(Runtime::kThrowReferenceError, 1);
1238 }
1231 } 1239 }
1232 __ jmp(done); 1240 __ jmp(done);
1233 } 1241 }
1234 } 1242 }
1235 1243
1236 1244
1237 void FullCodeGenerator::EmitVariableLoad(VariableProxy* proxy) { 1245 void FullCodeGenerator::EmitVariableLoad(VariableProxy* proxy) {
1238 // Record position before possible IC call. 1246 // Record position before possible IC call.
1239 SetSourcePosition(proxy->position()); 1247 SetSourcePosition(proxy->position());
1240 Variable* var = proxy->var(); 1248 Variable* var = proxy->var();
(...skipping 3025 matching lines...) Expand 10 before | Expand all | Expand 10 after
4266 *context_length = 0; 4274 *context_length = 0;
4267 return previous_; 4275 return previous_;
4268 } 4276 }
4269 4277
4270 4278
4271 #undef __ 4279 #undef __
4272 4280
4273 } } // namespace v8::internal 4281 } } // namespace v8::internal
4274 4282
4275 #endif // V8_TARGET_ARCH_ARM 4283 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « no previous file | src/ia32/full-codegen-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698