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

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

Issue 2263123002: Find the last outer eval scope to check in fullcodegen rather than scope analysis (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Add ports 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
OLDNEW
1 // Copyright 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 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_PPC 5 #if V8_TARGET_ARCH_PPC
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 1130 matching lines...) Expand 10 before | Expand all | Expand 10 after
1141 } 1141 }
1142 1142
1143 1143
1144 void FullCodeGenerator::EmitLoadGlobalCheckExtensions(VariableProxy* proxy, 1144 void FullCodeGenerator::EmitLoadGlobalCheckExtensions(VariableProxy* proxy,
1145 TypeofMode typeof_mode, 1145 TypeofMode typeof_mode,
1146 Label* slow) { 1146 Label* slow) {
1147 Register current = cp; 1147 Register current = cp;
1148 Register next = r4; 1148 Register next = r4;
1149 Register temp = r5; 1149 Register temp = r5;
1150 1150
1151 Scope* s = scope(); 1151 int to_check = scope()->ContextChainLengthUntilOutermostSloppyEval();
1152 while (s != NULL) { 1152 for (Scope* s = scope(); to_check > 0; s = s->outer_scope()) {
1153 if (s->num_heap_slots() > 0) { 1153 if (!s->NeedsContext()) continue;
1154 if (s->calls_sloppy_eval()) { 1154 if (s->calls_sloppy_eval()) {
1155 // Check that extension is "the hole". 1155 // Check that extension is "the hole".
1156 __ LoadP(temp, ContextMemOperand(current, Context::EXTENSION_INDEX)); 1156 __ LoadP(temp, ContextMemOperand(current, Context::EXTENSION_INDEX));
1157 __ JumpIfNotRoot(temp, Heap::kTheHoleValueRootIndex, slow); 1157 __ JumpIfNotRoot(temp, Heap::kTheHoleValueRootIndex, slow);
1158 }
1159 // Load next context in chain.
1160 __ LoadP(next, ContextMemOperand(current, Context::PREVIOUS_INDEX));
1161 // Walk the rest of the chain without clobbering cp.
1162 current = next;
1163 } 1158 }
1164 // If no outer scope calls eval, we do not need to check more 1159 // Load next context in chain.
1165 // context extensions. 1160 __ LoadP(next, ContextMemOperand(current, Context::PREVIOUS_INDEX));
1166 if (!s->outer_scope_calls_sloppy_eval()) break; 1161 // Walk the rest of the chain without clobbering cp.
1167 s = s->outer_scope(); 1162 current = next;
1163 to_check--;
1168 } 1164 }
1169 1165
1170 // All extension objects were empty and it is safe to use a normal global 1166 // All extension objects were empty and it is safe to use a normal global
1171 // load machinery. 1167 // load machinery.
1172 EmitGlobalVariableLoad(proxy, typeof_mode); 1168 EmitGlobalVariableLoad(proxy, typeof_mode);
1173 } 1169 }
1174 1170
1175 1171
1176 MemOperand FullCodeGenerator::ContextSlotOperandCheckExtensions(Variable* var, 1172 MemOperand FullCodeGenerator::ContextSlotOperandCheckExtensions(Variable* var,
1177 Label* slow) { 1173 Label* slow) {
(...skipping 2563 matching lines...) Expand 10 before | Expand all | Expand 10 after
3741 3737
3742 DCHECK(Assembler::IsCrSet(Assembler::instr_at(cmp_address))); 3738 DCHECK(Assembler::IsCrSet(Assembler::instr_at(cmp_address)));
3743 3739
3744 DCHECK(interrupt_address == 3740 DCHECK(interrupt_address ==
3745 isolate->builtins()->OnStackReplacement()->entry()); 3741 isolate->builtins()->OnStackReplacement()->entry());
3746 return ON_STACK_REPLACEMENT; 3742 return ON_STACK_REPLACEMENT;
3747 } 3743 }
3748 } // namespace internal 3744 } // namespace internal
3749 } // namespace v8 3745 } // namespace v8
3750 #endif // V8_TARGET_ARCH_PPC 3746 #endif // V8_TARGET_ARCH_PPC
OLDNEW
« no previous file with comments | « src/full-codegen/mips64/full-codegen-mips64.cc ('k') | src/full-codegen/s390/full-codegen-s390.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698