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

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

Issue 2435023002: Use a different map to distinguish eval contexts (Closed)
Patch Set: relax dchecks Created 4 years, 1 month 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 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/full-codegen/full-codegen.h" 7 #include "src/full-codegen/full-codegen.h"
8 #include "src/ast/compile-time-value.h" 8 #include "src/ast/compile-time-value.h"
9 #include "src/ast/scopes.h" 9 #include "src/ast/scopes.h"
10 #include "src/code-factory.h" 10 #include "src/code-factory.h"
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after
183 __ CallRuntime(Runtime::kNewScriptContext); 183 __ CallRuntime(Runtime::kNewScriptContext);
184 PrepareForBailoutForId(BailoutId::ScriptContext(), 184 PrepareForBailoutForId(BailoutId::ScriptContext(),
185 BailoutState::TOS_REGISTER); 185 BailoutState::TOS_REGISTER);
186 // The new target value is not used, clobbering is safe. 186 // The new target value is not used, clobbering is safe.
187 DCHECK_NULL(info->scope()->new_target_var()); 187 DCHECK_NULL(info->scope()->new_target_var());
188 } else { 188 } else {
189 if (info->scope()->new_target_var() != nullptr) { 189 if (info->scope()->new_target_var() != nullptr) {
190 __ Push(rdx); // Preserve new target. 190 __ Push(rdx); // Preserve new target.
191 } 191 }
192 if (slots <= FastNewFunctionContextStub::kMaximumSlots) { 192 if (slots <= FastNewFunctionContextStub::kMaximumSlots) {
193 FastNewFunctionContextStub stub(isolate()); 193 if (info->scope()->is_eval_scope()) {
194 __ Set(FastNewFunctionContextDescriptor::SlotsRegister(), slots); 194 FastNewEvalContextStub stub(isolate());
195 __ CallStub(&stub); 195 __ Set(FastNewEvalContextDescriptor::SlotsRegister(), slots);
196 __ CallStub(&stub);
197 } else {
198 FastNewFunctionContextStub stub(isolate());
199 __ Set(FastNewFunctionContextDescriptor::SlotsRegister(), slots);
200 __ CallStub(&stub);
201 }
196 // Result of FastNewFunctionContextStub is always in new space. 202 // Result of FastNewFunctionContextStub is always in new space.
197 need_write_barrier = false; 203 need_write_barrier = false;
198 } else { 204 } else {
199 __ Push(rdi); 205 __ Push(rdi);
200 __ CallRuntime(Runtime::kNewFunctionContext); 206 __ CallRuntime(info->scope()->is_eval_scope()
207 ? Runtime::kNewEvalContext
208 : Runtime::kNewFunctionContext);
201 } 209 }
202 if (info->scope()->new_target_var() != nullptr) { 210 if (info->scope()->new_target_var() != nullptr) {
203 __ Pop(rdx); // Restore new target. 211 __ Pop(rdx); // Restore new target.
204 } 212 }
205 } 213 }
206 function_in_register = false; 214 function_in_register = false;
207 // Context is returned in rax. It replaces the context passed to us. 215 // Context is returned in rax. It replaces the context passed to us.
208 // It's saved in the stack and kept live in rsi. 216 // It's saved in the stack and kept live in rsi.
209 __ movp(rsi, rax); 217 __ movp(rsi, rax);
210 __ movp(Operand(rbp, StandardFrameConstants::kContextOffset), rax); 218 __ movp(Operand(rbp, StandardFrameConstants::kContextOffset), rax);
(...skipping 3302 matching lines...) Expand 10 before | Expand all | Expand 10 after
3513 DCHECK_EQ( 3521 DCHECK_EQ(
3514 isolate->builtins()->OnStackReplacement()->entry(), 3522 isolate->builtins()->OnStackReplacement()->entry(),
3515 Assembler::target_address_at(call_target_address, unoptimized_code)); 3523 Assembler::target_address_at(call_target_address, unoptimized_code));
3516 return ON_STACK_REPLACEMENT; 3524 return ON_STACK_REPLACEMENT;
3517 } 3525 }
3518 3526
3519 } // namespace internal 3527 } // namespace internal
3520 } // namespace v8 3528 } // namespace v8
3521 3529
3522 #endif // V8_TARGET_ARCH_X64 3530 #endif // V8_TARGET_ARCH_X64
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698