OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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_ARM64 | 5 #if V8_TARGET_ARCH_ARM64 |
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 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
289 __ CallStub(&stub); | 289 __ CallStub(&stub); |
290 } | 290 } |
291 | 291 |
292 SetVar(arguments, x0, x1, x2); | 292 SetVar(arguments, x0, x1, x2); |
293 } | 293 } |
294 | 294 |
295 if (FLAG_trace) { | 295 if (FLAG_trace) { |
296 __ CallRuntime(Runtime::kTraceEnter); | 296 __ CallRuntime(Runtime::kTraceEnter); |
297 } | 297 } |
298 | 298 |
299 // Visit the declarations and body unless there is an illegal | 299 // Visit the declarations and body. |
300 // redeclaration. | 300 PrepareForBailoutForId(BailoutId::FunctionEntry(), NO_REGISTERS); |
301 if (scope()->HasIllegalRedeclaration()) { | 301 { |
302 EmitIllegalRedeclaration(); | 302 Comment cmnt(masm_, "[ Declarations"); |
303 } else { | 303 VisitDeclarations(scope()->declarations()); |
304 PrepareForBailoutForId(BailoutId::FunctionEntry(), NO_REGISTERS); | 304 } |
305 { Comment cmnt(masm_, "[ Declarations"); | |
306 VisitDeclarations(scope()->declarations()); | |
307 } | |
308 | 305 |
309 // Assert that the declarations do not use ICs. Otherwise the debugger | 306 // Assert that the declarations do not use ICs. Otherwise the debugger |
310 // won't be able to redirect a PC at an IC to the correct IC in newly | 307 // won't be able to redirect a PC at an IC to the correct IC in newly |
311 // recompiled code. | 308 // recompiled code. |
312 DCHECK_EQ(0, ic_total_count_); | 309 DCHECK_EQ(0, ic_total_count_); |
313 | 310 |
314 { | 311 { |
315 Comment cmnt(masm_, "[ Stack check"); | 312 Comment cmnt(masm_, "[ Stack check"); |
316 PrepareForBailoutForId(BailoutId::Declarations(), NO_REGISTERS); | 313 PrepareForBailoutForId(BailoutId::Declarations(), NO_REGISTERS); |
317 Label ok; | 314 Label ok; |
318 DCHECK(jssp.Is(__ StackPointer())); | 315 DCHECK(jssp.Is(__ StackPointer())); |
319 __ CompareRoot(jssp, Heap::kStackLimitRootIndex); | 316 __ CompareRoot(jssp, Heap::kStackLimitRootIndex); |
320 __ B(hs, &ok); | 317 __ B(hs, &ok); |
321 PredictableCodeSizeScope predictable(masm_, | 318 PredictableCodeSizeScope predictable(masm_, |
322 Assembler::kCallSizeWithRelocation); | 319 Assembler::kCallSizeWithRelocation); |
323 __ Call(isolate()->builtins()->StackCheck(), RelocInfo::CODE_TARGET); | 320 __ Call(isolate()->builtins()->StackCheck(), RelocInfo::CODE_TARGET); |
324 __ Bind(&ok); | 321 __ Bind(&ok); |
325 } | 322 } |
326 | 323 |
327 { | 324 { |
328 Comment cmnt(masm_, "[ Body"); | 325 Comment cmnt(masm_, "[ Body"); |
329 DCHECK(loop_depth() == 0); | 326 DCHECK(loop_depth() == 0); |
330 VisitStatements(literal()->body()); | 327 VisitStatements(literal()->body()); |
331 DCHECK(loop_depth() == 0); | 328 DCHECK(loop_depth() == 0); |
332 } | |
333 } | 329 } |
334 | 330 |
335 // Always emit a 'return undefined' in case control fell off the end of | 331 // Always emit a 'return undefined' in case control fell off the end of |
336 // the body. | 332 // the body. |
337 { Comment cmnt(masm_, "[ return <undefined>;"); | 333 { Comment cmnt(masm_, "[ return <undefined>;"); |
338 __ LoadRoot(x0, Heap::kUndefinedValueRootIndex); | 334 __ LoadRoot(x0, Heap::kUndefinedValueRootIndex); |
339 } | 335 } |
340 EmitReturnSequence(); | 336 EmitReturnSequence(); |
341 | 337 |
342 // Force emission of the pools, so they don't get emitted in the middle | 338 // Force emission of the pools, so they don't get emitted in the middle |
(...skipping 3833 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4176 } | 4172 } |
4177 | 4173 |
4178 return INTERRUPT; | 4174 return INTERRUPT; |
4179 } | 4175 } |
4180 | 4176 |
4181 | 4177 |
4182 } // namespace internal | 4178 } // namespace internal |
4183 } // namespace v8 | 4179 } // namespace v8 |
4184 | 4180 |
4185 #endif // V8_TARGET_ARCH_ARM64 | 4181 #endif // V8_TARGET_ARCH_ARM64 |
OLD | NEW |