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