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

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

Issue 2266843002: Drop is_eval_scope when checking how to access dynamic globals. It has no influence (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 4 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
« no previous file with comments | « src/full-codegen/s390/full-codegen-s390.cc ('k') | src/full-codegen/x87/full-codegen-x87.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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #if V8_TARGET_ARCH_X64 5 #if V8_TARGET_ARCH_X64
6 6
7 #include "src/ast/scopes.h" 7 #include "src/ast/scopes.h"
8 #include "src/code-factory.h" 8 #include "src/code-factory.h"
9 #include "src/code-stubs.h" 9 #include "src/code-stubs.h"
10 #include "src/codegen.h" 10 #include "src/codegen.h"
(...skipping 1132 matching lines...) Expand 10 before | Expand all | Expand 10 after
1143 // Check that extension is "the hole". 1143 // Check that extension is "the hole".
1144 __ JumpIfNotRoot(ContextOperand(context, Context::EXTENSION_INDEX), 1144 __ JumpIfNotRoot(ContextOperand(context, Context::EXTENSION_INDEX),
1145 Heap::kTheHoleValueRootIndex, slow); 1145 Heap::kTheHoleValueRootIndex, slow);
1146 } 1146 }
1147 // Load next context in chain. 1147 // Load next context in chain.
1148 __ movp(temp, ContextOperand(context, Context::PREVIOUS_INDEX)); 1148 __ movp(temp, ContextOperand(context, Context::PREVIOUS_INDEX));
1149 // Walk the rest of the chain without clobbering rsi. 1149 // Walk the rest of the chain without clobbering rsi.
1150 context = temp; 1150 context = temp;
1151 } 1151 }
1152 // If no outer scope calls eval, we do not need to check more 1152 // If no outer scope calls eval, we do not need to check more
1153 // context extensions. If we have reached an eval scope, we check 1153 // context extensions.
1154 // all extensions from this point. 1154 if (!s->outer_scope_calls_sloppy_eval()) break;
1155 if (!s->outer_scope_calls_sloppy_eval() || s->is_eval_scope()) break;
1156 s = s->outer_scope(); 1155 s = s->outer_scope();
1157 } 1156 }
1158 1157
1159 if (s != NULL && s->is_eval_scope()) {
1160 // Loop up the context chain. There is no frame effect so it is
1161 // safe to use raw labels here.
1162 Label next, fast;
1163 if (!context.is(temp)) {
1164 __ movp(temp, context);
1165 }
1166 // Load map for comparison into register, outside loop.
1167 __ LoadRoot(kScratchRegister, Heap::kNativeContextMapRootIndex);
1168 __ bind(&next);
1169 // Terminate at native context.
1170 __ cmpp(kScratchRegister, FieldOperand(temp, HeapObject::kMapOffset));
1171 __ j(equal, &fast, Label::kNear);
1172 // Check that extension is "the hole".
1173 __ JumpIfNotRoot(ContextOperand(temp, Context::EXTENSION_INDEX),
1174 Heap::kTheHoleValueRootIndex, slow);
1175 // Load next context in chain.
1176 __ movp(temp, ContextOperand(temp, Context::PREVIOUS_INDEX));
1177 __ jmp(&next);
1178 __ bind(&fast);
1179 }
1180
1181 // All extension objects were empty and it is safe to use a normal global 1158 // All extension objects were empty and it is safe to use a normal global
1182 // load machinery. 1159 // load machinery.
1183 EmitGlobalVariableLoad(proxy, typeof_mode); 1160 EmitGlobalVariableLoad(proxy, typeof_mode);
1184 } 1161 }
1185 1162
1186 1163
1187 MemOperand FullCodeGenerator::ContextSlotOperandCheckExtensions(Variable* var, 1164 MemOperand FullCodeGenerator::ContextSlotOperandCheckExtensions(Variable* var,
1188 Label* slow) { 1165 Label* slow) {
1189 DCHECK(var->IsContextSlot()); 1166 DCHECK(var->IsContextSlot());
1190 Register context = rsi; 1167 Register context = rsi;
(...skipping 2472 matching lines...) Expand 10 before | Expand all | Expand 10 after
3663 DCHECK_EQ( 3640 DCHECK_EQ(
3664 isolate->builtins()->OnStackReplacement()->entry(), 3641 isolate->builtins()->OnStackReplacement()->entry(),
3665 Assembler::target_address_at(call_target_address, unoptimized_code)); 3642 Assembler::target_address_at(call_target_address, unoptimized_code));
3666 return ON_STACK_REPLACEMENT; 3643 return ON_STACK_REPLACEMENT;
3667 } 3644 }
3668 3645
3669 } // namespace internal 3646 } // namespace internal
3670 } // namespace v8 3647 } // namespace v8
3671 3648
3672 #endif // V8_TARGET_ARCH_X64 3649 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/full-codegen/s390/full-codegen-s390.cc ('k') | src/full-codegen/x87/full-codegen-x87.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698