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 #include "src/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #if V8_TARGET_ARCH_MIPS | 7 #if V8_TARGET_ARCH_MIPS |
8 | 8 |
9 // Note on Mips implementation: | 9 // Note on Mips implementation: |
10 // | 10 // |
(...skipping 426 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
437 // Add a label for checking the size of the code used for returning. | 437 // Add a label for checking the size of the code used for returning. |
438 Label check_exit_codesize; | 438 Label check_exit_codesize; |
439 masm_->bind(&check_exit_codesize); | 439 masm_->bind(&check_exit_codesize); |
440 #endif | 440 #endif |
441 // Make sure that the constant pool is not emitted inside of the return | 441 // Make sure that the constant pool is not emitted inside of the return |
442 // sequence. | 442 // sequence. |
443 { Assembler::BlockTrampolinePoolScope block_trampoline_pool(masm_); | 443 { Assembler::BlockTrampolinePoolScope block_trampoline_pool(masm_); |
444 // Here we use masm_-> instead of the __ macro to avoid the code coverage | 444 // Here we use masm_-> instead of the __ macro to avoid the code coverage |
445 // tool from instrumenting as we rely on the code size here. | 445 // tool from instrumenting as we rely on the code size here. |
446 int32_t arg_count = info_->scope()->num_parameters() + 1; | 446 int32_t arg_count = info_->scope()->num_parameters() + 1; |
447 if (FLAG_experimental_classes && | 447 if (IsSubclassConstructor(info_->function()->kind())) { |
448 IsSubclassConstructor(info_->function()->kind())) { | |
449 arg_count++; | 448 arg_count++; |
450 } | 449 } |
451 int32_t sp_delta = arg_count * kPointerSize; | 450 int32_t sp_delta = arg_count * kPointerSize; |
452 CodeGenerator::RecordPositions(masm_, function()->end_position() - 1); | 451 CodeGenerator::RecordPositions(masm_, function()->end_position() - 1); |
453 __ RecordJSReturn(); | 452 __ RecordJSReturn(); |
454 masm_->mov(sp, fp); | 453 masm_->mov(sp, fp); |
455 int no_frame_start = masm_->pc_offset(); | 454 int no_frame_start = masm_->pc_offset(); |
456 masm_->MultiPop(static_cast<RegList>(fp.bit() | ra.bit())); | 455 masm_->MultiPop(static_cast<RegList>(fp.bit() | ra.bit())); |
457 masm_->Addu(sp, sp, Operand(sp_delta)); | 456 masm_->Addu(sp, sp, Operand(sp_delta)); |
458 masm_->Jump(ra); | 457 masm_->Jump(ra); |
(...skipping 2696 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3155 PreservePositionScope scope(masm()->positions_recorder()); | 3154 PreservePositionScope scope(masm()->positions_recorder()); |
3156 VisitForStackValue(property->obj()); | 3155 VisitForStackValue(property->obj()); |
3157 } | 3156 } |
3158 if (is_named_call) { | 3157 if (is_named_call) { |
3159 EmitCallWithLoadIC(expr); | 3158 EmitCallWithLoadIC(expr); |
3160 } else { | 3159 } else { |
3161 EmitKeyedCallWithLoadIC(expr, property->key()); | 3160 EmitKeyedCallWithLoadIC(expr, property->key()); |
3162 } | 3161 } |
3163 } | 3162 } |
3164 } else if (call_type == Call::SUPER_CALL) { | 3163 } else if (call_type == Call::SUPER_CALL) { |
3165 if (FLAG_experimental_classes) { | 3164 EmitSuperConstructorCall(expr); |
3166 EmitSuperConstructorCall(expr); | |
3167 } else { | |
3168 EmitLoadSuperConstructor(); | |
3169 __ Push(result_register()); | |
3170 SuperReference* super_ref = callee->AsSuperReference(); | |
3171 VisitForStackValue(super_ref->this_var()); | |
3172 EmitCall(expr, CallICState::METHOD); | |
3173 } | |
3174 } else { | 3165 } else { |
3175 DCHECK(call_type == Call::OTHER_CALL); | 3166 DCHECK(call_type == Call::OTHER_CALL); |
3176 // Call to an arbitrary expression not handled specially above. | 3167 // Call to an arbitrary expression not handled specially above. |
3177 { PreservePositionScope scope(masm()->positions_recorder()); | 3168 { PreservePositionScope scope(masm()->positions_recorder()); |
3178 VisitForStackValue(callee); | 3169 VisitForStackValue(callee); |
3179 } | 3170 } |
3180 __ LoadRoot(a1, Heap::kUndefinedValueRootIndex); | 3171 __ LoadRoot(a1, Heap::kUndefinedValueRootIndex); |
3181 __ push(a1); | 3172 __ push(a1); |
3182 // Emit function call. | 3173 // Emit function call. |
3183 EmitCall(expr); | 3174 EmitCall(expr); |
(...skipping 2248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5432 Assembler::target_address_at(pc_immediate_load_address)) == | 5423 Assembler::target_address_at(pc_immediate_load_address)) == |
5433 reinterpret_cast<uint32_t>( | 5424 reinterpret_cast<uint32_t>( |
5434 isolate->builtins()->OsrAfterStackCheck()->entry())); | 5425 isolate->builtins()->OsrAfterStackCheck()->entry())); |
5435 return OSR_AFTER_STACK_CHECK; | 5426 return OSR_AFTER_STACK_CHECK; |
5436 } | 5427 } |
5437 | 5428 |
5438 | 5429 |
5439 } } // namespace v8::internal | 5430 } } // namespace v8::internal |
5440 | 5431 |
5441 #endif // V8_TARGET_ARCH_MIPS | 5432 #endif // V8_TARGET_ARCH_MIPS |
OLD | NEW |