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_ARM | 7 #if V8_TARGET_ARCH_ARM |
8 | 8 |
9 #include "src/code-factory.h" | 9 #include "src/code-factory.h" |
10 #include "src/code-stubs.h" | 10 #include "src/code-stubs.h" |
(...skipping 437 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
448 | 448 |
449 #ifdef DEBUG | 449 #ifdef DEBUG |
450 // Add a label for checking the size of the code used for returning. | 450 // Add a label for checking the size of the code used for returning. |
451 Label check_exit_codesize; | 451 Label check_exit_codesize; |
452 __ bind(&check_exit_codesize); | 452 __ bind(&check_exit_codesize); |
453 #endif | 453 #endif |
454 // Make sure that the constant pool is not emitted inside of the return | 454 // Make sure that the constant pool is not emitted inside of the return |
455 // sequence. | 455 // sequence. |
456 { Assembler::BlockConstPoolScope block_const_pool(masm_); | 456 { Assembler::BlockConstPoolScope block_const_pool(masm_); |
457 int32_t arg_count = info_->scope()->num_parameters() + 1; | 457 int32_t arg_count = info_->scope()->num_parameters() + 1; |
458 if (FLAG_experimental_classes && | 458 if (IsSubclassConstructor(info_->function()->kind())) { |
459 IsSubclassConstructor(info_->function()->kind())) { | |
460 arg_count++; | 459 arg_count++; |
461 } | 460 } |
462 int32_t sp_delta = arg_count * kPointerSize; | 461 int32_t sp_delta = arg_count * kPointerSize; |
463 CodeGenerator::RecordPositions(masm_, function()->end_position() - 1); | 462 CodeGenerator::RecordPositions(masm_, function()->end_position() - 1); |
464 // TODO(svenpanne) The code below is sometimes 4 words, sometimes 5! | 463 // TODO(svenpanne) The code below is sometimes 4 words, sometimes 5! |
465 PredictableCodeSizeScope predictable(masm_, -1); | 464 PredictableCodeSizeScope predictable(masm_, -1); |
466 __ RecordJSReturn(); | 465 __ RecordJSReturn(); |
467 int no_frame_start = __ LeaveFrame(StackFrame::JAVA_SCRIPT); | 466 int no_frame_start = __ LeaveFrame(StackFrame::JAVA_SCRIPT); |
468 { ConstantPoolUnavailableScope constant_pool_unavailable(masm_); | 467 { ConstantPoolUnavailableScope constant_pool_unavailable(masm_); |
469 __ add(sp, sp, Operand(sp_delta)); | 468 __ add(sp, sp, Operand(sp_delta)); |
(...skipping 2712 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3182 PreservePositionScope scope(masm()->positions_recorder()); | 3181 PreservePositionScope scope(masm()->positions_recorder()); |
3183 VisitForStackValue(property->obj()); | 3182 VisitForStackValue(property->obj()); |
3184 } | 3183 } |
3185 if (is_named_call) { | 3184 if (is_named_call) { |
3186 EmitCallWithLoadIC(expr); | 3185 EmitCallWithLoadIC(expr); |
3187 } else { | 3186 } else { |
3188 EmitKeyedCallWithLoadIC(expr, property->key()); | 3187 EmitKeyedCallWithLoadIC(expr, property->key()); |
3189 } | 3188 } |
3190 } | 3189 } |
3191 } else if (call_type == Call::SUPER_CALL) { | 3190 } else if (call_type == Call::SUPER_CALL) { |
3192 if (FLAG_experimental_classes) { | 3191 EmitSuperConstructorCall(expr); |
3193 EmitSuperConstructorCall(expr); | |
3194 } else { | |
3195 EmitLoadSuperConstructor(); | |
3196 __ Push(result_register()); | |
3197 SuperReference* super_ref = callee->AsSuperReference(); | |
3198 VisitForStackValue(super_ref->this_var()); | |
3199 EmitCall(expr, CallICState::METHOD); | |
3200 } | |
3201 } else { | 3192 } else { |
3202 DCHECK(call_type == Call::OTHER_CALL); | 3193 DCHECK(call_type == Call::OTHER_CALL); |
3203 // Call to an arbitrary expression not handled specially above. | 3194 // Call to an arbitrary expression not handled specially above. |
3204 { PreservePositionScope scope(masm()->positions_recorder()); | 3195 { PreservePositionScope scope(masm()->positions_recorder()); |
3205 VisitForStackValue(callee); | 3196 VisitForStackValue(callee); |
3206 } | 3197 } |
3207 __ LoadRoot(r1, Heap::kUndefinedValueRootIndex); | 3198 __ LoadRoot(r1, Heap::kUndefinedValueRootIndex); |
3208 __ push(r1); | 3199 __ push(r1); |
3209 // Emit function call. | 3200 // Emit function call. |
3210 EmitCall(expr); | 3201 EmitCall(expr); |
(...skipping 2279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5490 | 5481 |
5491 DCHECK(interrupt_address == | 5482 DCHECK(interrupt_address == |
5492 isolate->builtins()->OsrAfterStackCheck()->entry()); | 5483 isolate->builtins()->OsrAfterStackCheck()->entry()); |
5493 return OSR_AFTER_STACK_CHECK; | 5484 return OSR_AFTER_STACK_CHECK; |
5494 } | 5485 } |
5495 | 5486 |
5496 | 5487 |
5497 } } // namespace v8::internal | 5488 } } // namespace v8::internal |
5498 | 5489 |
5499 #endif // V8_TARGET_ARCH_ARM | 5490 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |