| 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 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 106 // o fp: our caller's frame pointer | 106 // o fp: our caller's frame pointer |
| 107 // o sp: stack pointer | 107 // o sp: stack pointer |
| 108 // o ra: return address | 108 // o ra: return address |
| 109 // | 109 // |
| 110 // The function builds a JS frame. Please see JavaScriptFrameConstants in | 110 // The function builds a JS frame. Please see JavaScriptFrameConstants in |
| 111 // frames-mips.h for its layout. | 111 // frames-mips.h for its layout. |
| 112 void FullCodeGenerator::Generate() { | 112 void FullCodeGenerator::Generate() { |
| 113 CompilationInfo* info = info_; | 113 CompilationInfo* info = info_; |
| 114 profiling_counter_ = isolate()->factory()->NewCell( | 114 profiling_counter_ = isolate()->factory()->NewCell( |
| 115 Handle<Smi>(Smi::FromInt(FLAG_interrupt_budget), isolate())); | 115 Handle<Smi>(Smi::FromInt(FLAG_interrupt_budget), isolate())); |
| 116 SetFunctionPosition(function()); | 116 SetFunctionPosition(literal()); |
| 117 Comment cmnt(masm_, "[ function compiled by full code generator"); | 117 Comment cmnt(masm_, "[ function compiled by full code generator"); |
| 118 | 118 |
| 119 ProfileEntryHookStub::MaybeCallEntryHook(masm_); | 119 ProfileEntryHookStub::MaybeCallEntryHook(masm_); |
| 120 | 120 |
| 121 #ifdef DEBUG | 121 #ifdef DEBUG |
| 122 if (strlen(FLAG_stop_at) > 0 && | 122 if (strlen(FLAG_stop_at) > 0 && |
| 123 info->literal()->name()->IsUtf8EqualTo(CStrVector(FLAG_stop_at))) { | 123 info->literal()->name()->IsUtf8EqualTo(CStrVector(FLAG_stop_at))) { |
| 124 __ stop("stop-at"); | 124 __ stop("stop-at"); |
| 125 } | 125 } |
| 126 #endif | 126 #endif |
| (...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 326 __ li(a1, Operand(Smi::FromInt(num_parameters))); | 326 __ li(a1, Operand(Smi::FromInt(num_parameters))); |
| 327 __ Push(a3, a2, a1); | 327 __ Push(a3, a2, a1); |
| 328 | 328 |
| 329 // Arguments to ArgumentsAccessStub: | 329 // Arguments to ArgumentsAccessStub: |
| 330 // function, receiver address, parameter count. | 330 // function, receiver address, parameter count. |
| 331 // The stub will rewrite receiever and parameter count if the previous | 331 // The stub will rewrite receiever and parameter count if the previous |
| 332 // stack frame was an arguments adapter frame. | 332 // stack frame was an arguments adapter frame. |
| 333 ArgumentsAccessStub::Type type; | 333 ArgumentsAccessStub::Type type; |
| 334 if (is_strict(language_mode()) || !has_simple_parameters()) { | 334 if (is_strict(language_mode()) || !has_simple_parameters()) { |
| 335 type = ArgumentsAccessStub::NEW_STRICT; | 335 type = ArgumentsAccessStub::NEW_STRICT; |
| 336 } else if (function()->has_duplicate_parameters()) { | 336 } else if (literal()->has_duplicate_parameters()) { |
| 337 type = ArgumentsAccessStub::NEW_SLOPPY_SLOW; | 337 type = ArgumentsAccessStub::NEW_SLOPPY_SLOW; |
| 338 } else { | 338 } else { |
| 339 type = ArgumentsAccessStub::NEW_SLOPPY_FAST; | 339 type = ArgumentsAccessStub::NEW_SLOPPY_FAST; |
| 340 } | 340 } |
| 341 ArgumentsAccessStub stub(isolate(), type); | 341 ArgumentsAccessStub stub(isolate(), type); |
| 342 __ CallStub(&stub); | 342 __ CallStub(&stub); |
| 343 | 343 |
| 344 SetVar(arguments, v0, a1, a2); | 344 SetVar(arguments, v0, a1, a2); |
| 345 } | 345 } |
| 346 | 346 |
| (...skipping 25 matching lines...) Expand all Loading... |
| 372 Handle<Code> stack_check = isolate()->builtins()->StackCheck(); | 372 Handle<Code> stack_check = isolate()->builtins()->StackCheck(); |
| 373 PredictableCodeSizeScope predictable(masm_, | 373 PredictableCodeSizeScope predictable(masm_, |
| 374 masm_->CallSize(stack_check, RelocInfo::CODE_TARGET)); | 374 masm_->CallSize(stack_check, RelocInfo::CODE_TARGET)); |
| 375 __ Call(stack_check, RelocInfo::CODE_TARGET); | 375 __ Call(stack_check, RelocInfo::CODE_TARGET); |
| 376 __ bind(&ok); | 376 __ bind(&ok); |
| 377 } | 377 } |
| 378 | 378 |
| 379 { Comment cmnt(masm_, "[ Body"); | 379 { Comment cmnt(masm_, "[ Body"); |
| 380 DCHECK(loop_depth() == 0); | 380 DCHECK(loop_depth() == 0); |
| 381 | 381 |
| 382 VisitStatements(function()->body()); | 382 VisitStatements(literal()->body()); |
| 383 | 383 |
| 384 DCHECK(loop_depth() == 0); | 384 DCHECK(loop_depth() == 0); |
| 385 } | 385 } |
| 386 } | 386 } |
| 387 | 387 |
| 388 // Always emit a 'return undefined' in case control fell off the end of | 388 // Always emit a 'return undefined' in case control fell off the end of |
| 389 // the body. | 389 // the body. |
| 390 { Comment cmnt(masm_, "[ return <undefined>;"); | 390 { Comment cmnt(masm_, "[ return <undefined>;"); |
| 391 __ LoadRoot(v0, Heap::kUndefinedValueRootIndex); | 391 __ LoadRoot(v0, Heap::kUndefinedValueRootIndex); |
| 392 } | 392 } |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 485 EmitProfilingCounterReset(); | 485 EmitProfilingCounterReset(); |
| 486 __ bind(&ok); | 486 __ bind(&ok); |
| 487 | 487 |
| 488 // Make sure that the constant pool is not emitted inside of the return | 488 // Make sure that the constant pool is not emitted inside of the return |
| 489 // sequence. | 489 // sequence. |
| 490 { Assembler::BlockTrampolinePoolScope block_trampoline_pool(masm_); | 490 { Assembler::BlockTrampolinePoolScope block_trampoline_pool(masm_); |
| 491 // Here we use masm_-> instead of the __ macro to avoid the code coverage | 491 // Here we use masm_-> instead of the __ macro to avoid the code coverage |
| 492 // tool from instrumenting as we rely on the code size here. | 492 // tool from instrumenting as we rely on the code size here. |
| 493 int32_t arg_count = info_->scope()->num_parameters() + 1; | 493 int32_t arg_count = info_->scope()->num_parameters() + 1; |
| 494 int32_t sp_delta = arg_count * kPointerSize; | 494 int32_t sp_delta = arg_count * kPointerSize; |
| 495 SetReturnPosition(function()); | 495 SetReturnPosition(literal()); |
| 496 masm_->mov(sp, fp); | 496 masm_->mov(sp, fp); |
| 497 int no_frame_start = masm_->pc_offset(); | 497 int no_frame_start = masm_->pc_offset(); |
| 498 masm_->MultiPop(static_cast<RegList>(fp.bit() | ra.bit())); | 498 masm_->MultiPop(static_cast<RegList>(fp.bit() | ra.bit())); |
| 499 masm_->Daddu(sp, sp, Operand(sp_delta)); | 499 masm_->Daddu(sp, sp, Operand(sp_delta)); |
| 500 masm_->Jump(ra); | 500 masm_->Jump(ra); |
| 501 info_->AddNoFrameRange(no_frame_start, masm_->pc_offset()); | 501 info_->AddNoFrameRange(no_frame_start, masm_->pc_offset()); |
| 502 } | 502 } |
| 503 } | 503 } |
| 504 } | 504 } |
| 505 | 505 |
| (...skipping 4876 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5382 reinterpret_cast<uint64_t>( | 5382 reinterpret_cast<uint64_t>( |
| 5383 isolate->builtins()->OsrAfterStackCheck()->entry())); | 5383 isolate->builtins()->OsrAfterStackCheck()->entry())); |
| 5384 return OSR_AFTER_STACK_CHECK; | 5384 return OSR_AFTER_STACK_CHECK; |
| 5385 } | 5385 } |
| 5386 | 5386 |
| 5387 | 5387 |
| 5388 } // namespace internal | 5388 } // namespace internal |
| 5389 } // namespace v8 | 5389 } // namespace v8 |
| 5390 | 5390 |
| 5391 #endif // V8_TARGET_ARCH_MIPS64 | 5391 #endif // V8_TARGET_ARCH_MIPS64 |
| OLD | NEW |