| 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_MIPS64 | 5 #if V8_TARGET_ARCH_MIPS64 |
| 6 | 6 |
| 7 // Note on Mips implementation: | 7 // Note on Mips implementation: |
| 8 // | 8 // |
| 9 // The result_register() for mips is the 'v0' register, which is defined | 9 // The result_register() for mips is the 'v0' register, which is defined |
| 10 // by the ABI to contain function return values. However, the first | 10 // by the ABI to contain function return values. However, the first |
| (...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 294 __ CallStub(&stub); | 294 __ CallStub(&stub); |
| 295 } | 295 } |
| 296 | 296 |
| 297 SetVar(arguments, v0, a1, a2); | 297 SetVar(arguments, v0, a1, a2); |
| 298 } | 298 } |
| 299 | 299 |
| 300 if (FLAG_trace) { | 300 if (FLAG_trace) { |
| 301 __ CallRuntime(Runtime::kTraceEnter); | 301 __ CallRuntime(Runtime::kTraceEnter); |
| 302 } | 302 } |
| 303 | 303 |
| 304 // Visit the declarations and body unless there is an illegal | 304 // Visit the declarations and body. |
| 305 // redeclaration. | 305 PrepareForBailoutForId(BailoutId::FunctionEntry(), NO_REGISTERS); |
| 306 if (scope()->HasIllegalRedeclaration()) { | 306 { |
| 307 EmitIllegalRedeclaration(); | 307 Comment cmnt(masm_, "[ Declarations"); |
| 308 } else { | 308 VisitDeclarations(scope()->declarations()); |
| 309 PrepareForBailoutForId(BailoutId::FunctionEntry(), NO_REGISTERS); | 309 } |
| 310 { Comment cmnt(masm_, "[ Declarations"); | |
| 311 VisitDeclarations(scope()->declarations()); | |
| 312 } | |
| 313 | 310 |
| 314 // Assert that the declarations do not use ICs. Otherwise the debugger | 311 // Assert that the declarations do not use ICs. Otherwise the debugger |
| 315 // won't be able to redirect a PC at an IC to the correct IC in newly | 312 // won't be able to redirect a PC at an IC to the correct IC in newly |
| 316 // recompiled code. | 313 // recompiled code. |
| 317 DCHECK_EQ(0, ic_total_count_); | 314 DCHECK_EQ(0, ic_total_count_); |
| 318 | 315 |
| 319 { Comment cmnt(masm_, "[ Stack check"); | 316 { |
| 320 PrepareForBailoutForId(BailoutId::Declarations(), NO_REGISTERS); | 317 Comment cmnt(masm_, "[ Stack check"); |
| 321 Label ok; | 318 PrepareForBailoutForId(BailoutId::Declarations(), NO_REGISTERS); |
| 322 __ LoadRoot(at, Heap::kStackLimitRootIndex); | 319 Label ok; |
| 323 __ Branch(&ok, hs, sp, Operand(at)); | 320 __ LoadRoot(at, Heap::kStackLimitRootIndex); |
| 324 Handle<Code> stack_check = isolate()->builtins()->StackCheck(); | 321 __ Branch(&ok, hs, sp, Operand(at)); |
| 325 PredictableCodeSizeScope predictable(masm_, | 322 Handle<Code> stack_check = isolate()->builtins()->StackCheck(); |
| 326 masm_->CallSize(stack_check, RelocInfo::CODE_TARGET)); | 323 PredictableCodeSizeScope predictable( |
| 327 __ Call(stack_check, RelocInfo::CODE_TARGET); | 324 masm_, masm_->CallSize(stack_check, RelocInfo::CODE_TARGET)); |
| 328 __ bind(&ok); | 325 __ Call(stack_check, RelocInfo::CODE_TARGET); |
| 329 } | 326 __ bind(&ok); |
| 327 } |
| 330 | 328 |
| 331 { Comment cmnt(masm_, "[ Body"); | 329 { |
| 332 DCHECK(loop_depth() == 0); | 330 Comment cmnt(masm_, "[ Body"); |
| 331 DCHECK(loop_depth() == 0); |
| 333 | 332 |
| 334 VisitStatements(literal()->body()); | 333 VisitStatements(literal()->body()); |
| 335 | 334 |
| 336 DCHECK(loop_depth() == 0); | 335 DCHECK(loop_depth() == 0); |
| 337 } | |
| 338 } | 336 } |
| 339 | 337 |
| 340 // Always emit a 'return undefined' in case control fell off the end of | 338 // Always emit a 'return undefined' in case control fell off the end of |
| 341 // the body. | 339 // the body. |
| 342 { Comment cmnt(masm_, "[ return <undefined>;"); | 340 { Comment cmnt(masm_, "[ return <undefined>;"); |
| 343 __ LoadRoot(v0, Heap::kUndefinedValueRootIndex); | 341 __ LoadRoot(v0, Heap::kUndefinedValueRootIndex); |
| 344 } | 342 } |
| 345 EmitReturnSequence(); | 343 EmitReturnSequence(); |
| 346 } | 344 } |
| 347 | 345 |
| (...skipping 3783 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4131 reinterpret_cast<uint64_t>( | 4129 reinterpret_cast<uint64_t>( |
| 4132 isolate->builtins()->OnStackReplacement()->entry())); | 4130 isolate->builtins()->OnStackReplacement()->entry())); |
| 4133 return ON_STACK_REPLACEMENT; | 4131 return ON_STACK_REPLACEMENT; |
| 4134 } | 4132 } |
| 4135 | 4133 |
| 4136 | 4134 |
| 4137 } // namespace internal | 4135 } // namespace internal |
| 4138 } // namespace v8 | 4136 } // namespace v8 |
| 4139 | 4137 |
| 4140 #endif // V8_TARGET_ARCH_MIPS64 | 4138 #endif // V8_TARGET_ARCH_MIPS64 |
| OLD | NEW |