| 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_IA32 | 5 #if V8_TARGET_ARCH_IA32 |
| 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 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 281 __ CallStub(&stub); | 281 __ CallStub(&stub); |
| 282 } | 282 } |
| 283 | 283 |
| 284 SetVar(arguments, eax, ebx, edx); | 284 SetVar(arguments, eax, ebx, edx); |
| 285 } | 285 } |
| 286 | 286 |
| 287 if (FLAG_trace) { | 287 if (FLAG_trace) { |
| 288 __ CallRuntime(Runtime::kTraceEnter); | 288 __ CallRuntime(Runtime::kTraceEnter); |
| 289 } | 289 } |
| 290 | 290 |
| 291 // Visit the declarations and body unless there is an illegal | 291 // Visit the declarations and body. |
| 292 // redeclaration. | 292 PrepareForBailoutForId(BailoutId::FunctionEntry(), NO_REGISTERS); |
| 293 if (scope()->HasIllegalRedeclaration()) { | 293 { |
| 294 EmitIllegalRedeclaration(); | 294 Comment cmnt(masm_, "[ Declarations"); |
| 295 } else { | 295 VisitDeclarations(scope()->declarations()); |
| 296 PrepareForBailoutForId(BailoutId::FunctionEntry(), NO_REGISTERS); | 296 } |
| 297 { Comment cmnt(masm_, "[ Declarations"); | |
| 298 VisitDeclarations(scope()->declarations()); | |
| 299 } | |
| 300 | 297 |
| 301 // Assert that the declarations do not use ICs. Otherwise the debugger | 298 // Assert that the declarations do not use ICs. Otherwise the debugger |
| 302 // won't be able to redirect a PC at an IC to the correct IC in newly | 299 // won't be able to redirect a PC at an IC to the correct IC in newly |
| 303 // recompiled code. | 300 // recompiled code. |
| 304 DCHECK_EQ(0, ic_total_count_); | 301 DCHECK_EQ(0, ic_total_count_); |
| 305 | 302 |
| 306 { Comment cmnt(masm_, "[ Stack check"); | 303 { |
| 307 PrepareForBailoutForId(BailoutId::Declarations(), NO_REGISTERS); | 304 Comment cmnt(masm_, "[ Stack check"); |
| 308 Label ok; | 305 PrepareForBailoutForId(BailoutId::Declarations(), NO_REGISTERS); |
| 309 ExternalReference stack_limit | 306 Label ok; |
| 310 = ExternalReference::address_of_stack_limit(isolate()); | 307 ExternalReference stack_limit = |
| 311 __ cmp(esp, Operand::StaticVariable(stack_limit)); | 308 ExternalReference::address_of_stack_limit(isolate()); |
| 312 __ j(above_equal, &ok, Label::kNear); | 309 __ cmp(esp, Operand::StaticVariable(stack_limit)); |
| 313 __ call(isolate()->builtins()->StackCheck(), RelocInfo::CODE_TARGET); | 310 __ j(above_equal, &ok, Label::kNear); |
| 314 __ bind(&ok); | 311 __ call(isolate()->builtins()->StackCheck(), RelocInfo::CODE_TARGET); |
| 315 } | 312 __ bind(&ok); |
| 313 } |
| 316 | 314 |
| 317 { Comment cmnt(masm_, "[ Body"); | 315 { |
| 318 DCHECK(loop_depth() == 0); | 316 Comment cmnt(masm_, "[ Body"); |
| 319 VisitStatements(literal()->body()); | 317 DCHECK(loop_depth() == 0); |
| 320 DCHECK(loop_depth() == 0); | 318 VisitStatements(literal()->body()); |
| 321 } | 319 DCHECK(loop_depth() == 0); |
| 322 } | 320 } |
| 323 | 321 |
| 324 // Always emit a 'return undefined' in case control fell off the end of | 322 // Always emit a 'return undefined' in case control fell off the end of |
| 325 // the body. | 323 // the body. |
| 326 { Comment cmnt(masm_, "[ return <undefined>;"); | 324 { Comment cmnt(masm_, "[ return <undefined>;"); |
| 327 __ mov(eax, isolate()->factory()->undefined_value()); | 325 __ mov(eax, isolate()->factory()->undefined_value()); |
| 328 EmitReturnSequence(); | 326 EmitReturnSequence(); |
| 329 } | 327 } |
| 330 } | 328 } |
| 331 | 329 |
| (...skipping 3674 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4006 isolate->builtins()->OnStackReplacement()->entry(), | 4004 isolate->builtins()->OnStackReplacement()->entry(), |
| 4007 Assembler::target_address_at(call_target_address, unoptimized_code)); | 4005 Assembler::target_address_at(call_target_address, unoptimized_code)); |
| 4008 return ON_STACK_REPLACEMENT; | 4006 return ON_STACK_REPLACEMENT; |
| 4009 } | 4007 } |
| 4010 | 4008 |
| 4011 | 4009 |
| 4012 } // namespace internal | 4010 } // namespace internal |
| 4013 } // namespace v8 | 4011 } // namespace v8 |
| 4014 | 4012 |
| 4015 #endif // V8_TARGET_ARCH_IA32 | 4013 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |