OLD | NEW |
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_ARM | 5 #if V8_TARGET_ARCH_ARM |
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 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
286 __ CallStub(&stub); | 286 __ CallStub(&stub); |
287 } | 287 } |
288 | 288 |
289 SetVar(arguments, r0, r1, r2); | 289 SetVar(arguments, r0, r1, r2); |
290 } | 290 } |
291 | 291 |
292 if (FLAG_trace) { | 292 if (FLAG_trace) { |
293 __ CallRuntime(Runtime::kTraceEnter); | 293 __ CallRuntime(Runtime::kTraceEnter); |
294 } | 294 } |
295 | 295 |
296 // Visit the declarations and body unless there is an illegal | 296 // Visit the declarations and body. |
297 // redeclaration. | 297 PrepareForBailoutForId(BailoutId::FunctionEntry(), NO_REGISTERS); |
298 if (scope()->HasIllegalRedeclaration()) { | 298 { |
299 EmitIllegalRedeclaration(); | 299 Comment cmnt(masm_, "[ Declarations"); |
300 } else { | 300 VisitDeclarations(scope()->declarations()); |
301 PrepareForBailoutForId(BailoutId::FunctionEntry(), NO_REGISTERS); | 301 } |
302 { Comment cmnt(masm_, "[ Declarations"); | |
303 VisitDeclarations(scope()->declarations()); | |
304 } | |
305 | 302 |
306 // Assert that the declarations do not use ICs. Otherwise the debugger | 303 // Assert that the declarations do not use ICs. Otherwise the debugger |
307 // won't be able to redirect a PC at an IC to the correct IC in newly | 304 // won't be able to redirect a PC at an IC to the correct IC in newly |
308 // recompiled code. | 305 // recompiled code. |
309 DCHECK_EQ(0, ic_total_count_); | 306 DCHECK_EQ(0, ic_total_count_); |
310 | 307 |
311 { Comment cmnt(masm_, "[ Stack check"); | 308 { |
312 PrepareForBailoutForId(BailoutId::Declarations(), NO_REGISTERS); | 309 Comment cmnt(masm_, "[ Stack check"); |
313 Label ok; | 310 PrepareForBailoutForId(BailoutId::Declarations(), NO_REGISTERS); |
314 __ LoadRoot(ip, Heap::kStackLimitRootIndex); | 311 Label ok; |
315 __ cmp(sp, Operand(ip)); | 312 __ LoadRoot(ip, Heap::kStackLimitRootIndex); |
316 __ b(hs, &ok); | 313 __ cmp(sp, Operand(ip)); |
317 Handle<Code> stack_check = isolate()->builtins()->StackCheck(); | 314 __ b(hs, &ok); |
318 PredictableCodeSizeScope predictable(masm_); | 315 Handle<Code> stack_check = isolate()->builtins()->StackCheck(); |
319 predictable.ExpectSize( | 316 PredictableCodeSizeScope predictable(masm_); |
320 masm_->CallSize(stack_check, RelocInfo::CODE_TARGET)); | 317 predictable.ExpectSize( |
321 __ Call(stack_check, RelocInfo::CODE_TARGET); | 318 masm_->CallSize(stack_check, RelocInfo::CODE_TARGET)); |
322 __ bind(&ok); | 319 __ Call(stack_check, RelocInfo::CODE_TARGET); |
323 } | 320 __ bind(&ok); |
| 321 } |
324 | 322 |
325 { Comment cmnt(masm_, "[ Body"); | 323 { |
326 DCHECK(loop_depth() == 0); | 324 Comment cmnt(masm_, "[ Body"); |
327 VisitStatements(literal()->body()); | 325 DCHECK(loop_depth() == 0); |
328 DCHECK(loop_depth() == 0); | 326 VisitStatements(literal()->body()); |
329 } | 327 DCHECK(loop_depth() == 0); |
330 } | 328 } |
331 | 329 |
332 // Always emit a 'return undefined' in case control fell off the end of | 330 // Always emit a 'return undefined' in case control fell off the end of |
333 // the body. | 331 // the body. |
334 { Comment cmnt(masm_, "[ return <undefined>;"); | 332 { Comment cmnt(masm_, "[ return <undefined>;"); |
335 __ LoadRoot(r0, Heap::kUndefinedValueRootIndex); | 333 __ LoadRoot(r0, Heap::kUndefinedValueRootIndex); |
336 } | 334 } |
337 EmitReturnSequence(); | 335 EmitReturnSequence(); |
338 | 336 |
339 // Force emit the constant pool, so it doesn't get emitted in the middle | 337 // Force emit the constant pool, so it doesn't get emitted in the middle |
(...skipping 3837 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4177 DCHECK(interrupt_address == | 4175 DCHECK(interrupt_address == |
4178 isolate->builtins()->OnStackReplacement()->entry()); | 4176 isolate->builtins()->OnStackReplacement()->entry()); |
4179 return ON_STACK_REPLACEMENT; | 4177 return ON_STACK_REPLACEMENT; |
4180 } | 4178 } |
4181 | 4179 |
4182 | 4180 |
4183 } // namespace internal | 4181 } // namespace internal |
4184 } // namespace v8 | 4182 } // namespace v8 |
4185 | 4183 |
4186 #endif // V8_TARGET_ARCH_ARM | 4184 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |