Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(477)

Side by Side Diff: src/arm/full-codegen-arm.cc

Issue 1222093007: Debugger: use debug break slot to break on call. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: fix mips Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 2240 matching lines...) Expand 10 before | Expand all | Expand 10 after
2251 // result = receiver[f](arg); 2251 // result = receiver[f](arg);
2252 __ bind(&l_call); 2252 __ bind(&l_call);
2253 __ ldr(load_receiver, MemOperand(sp, kPointerSize)); 2253 __ ldr(load_receiver, MemOperand(sp, kPointerSize));
2254 __ ldr(load_name, MemOperand(sp, 2 * kPointerSize)); 2254 __ ldr(load_name, MemOperand(sp, 2 * kPointerSize));
2255 __ mov(LoadDescriptor::SlotRegister(), 2255 __ mov(LoadDescriptor::SlotRegister(),
2256 Operand(SmiFromSlot(expr->KeyedLoadFeedbackSlot()))); 2256 Operand(SmiFromSlot(expr->KeyedLoadFeedbackSlot())));
2257 Handle<Code> ic = CodeFactory::KeyedLoadIC(isolate(), SLOPPY).code(); 2257 Handle<Code> ic = CodeFactory::KeyedLoadIC(isolate(), SLOPPY).code();
2258 CallIC(ic, TypeFeedbackId::None()); 2258 CallIC(ic, TypeFeedbackId::None());
2259 __ mov(r1, r0); 2259 __ mov(r1, r0);
2260 __ str(r1, MemOperand(sp, 2 * kPointerSize)); 2260 __ str(r1, MemOperand(sp, 2 * kPointerSize));
2261 SetCallPosition(expr, 1);
2261 CallFunctionStub stub(isolate(), 1, CALL_AS_METHOD); 2262 CallFunctionStub stub(isolate(), 1, CALL_AS_METHOD);
2262 __ CallStub(&stub); 2263 __ CallStub(&stub);
2263 2264
2264 __ ldr(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); 2265 __ ldr(cp, MemOperand(fp, StandardFrameConstants::kContextOffset));
2265 __ Drop(1); // The function is still on the stack; drop it. 2266 __ Drop(1); // The function is still on the stack; drop it.
2266 2267
2267 // if (!result.done) goto l_try; 2268 // if (!result.done) goto l_try;
2268 __ bind(&l_loop); 2269 __ bind(&l_loop);
2269 __ Move(load_receiver, r0); 2270 __ Move(load_receiver, r0);
2270 2271
(...skipping 814 matching lines...) Expand 10 before | Expand all | Expand 10 after
3085 3086
3086 3087
3087 void FullCodeGenerator::EmitCall(Call* expr, CallICState::CallType call_type) { 3088 void FullCodeGenerator::EmitCall(Call* expr, CallICState::CallType call_type) {
3088 // Load the arguments. 3089 // Load the arguments.
3089 ZoneList<Expression*>* args = expr->arguments(); 3090 ZoneList<Expression*>* args = expr->arguments();
3090 int arg_count = args->length(); 3091 int arg_count = args->length();
3091 for (int i = 0; i < arg_count; i++) { 3092 for (int i = 0; i < arg_count; i++) {
3092 VisitForStackValue(args->at(i)); 3093 VisitForStackValue(args->at(i));
3093 } 3094 }
3094 3095
3095 SetExpressionPosition(expr); 3096 SetCallPosition(expr, arg_count);
3096 Handle<Code> ic = CodeFactory::CallIC(isolate(), arg_count, call_type).code(); 3097 Handle<Code> ic = CodeFactory::CallIC(isolate(), arg_count, call_type).code();
3097 __ mov(r3, Operand(SmiFromSlot(expr->CallFeedbackICSlot()))); 3098 __ mov(r3, Operand(SmiFromSlot(expr->CallFeedbackICSlot())));
3098 __ ldr(r1, MemOperand(sp, (arg_count + 1) * kPointerSize)); 3099 __ ldr(r1, MemOperand(sp, (arg_count + 1) * kPointerSize));
3099 // Don't assign a type feedback id to the IC, since type feedback is provided 3100 // Don't assign a type feedback id to the IC, since type feedback is provided
3100 // by the vector above. 3101 // by the vector above.
3101 CallIC(ic); 3102 CallIC(ic);
3102 3103
3103 RecordJSReturnSite(expr); 3104 RecordJSReturnSite(expr);
3104 // Restore context register. 3105 // Restore context register.
3105 __ ldr(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); 3106 __ ldr(cp, MemOperand(fp, StandardFrameConstants::kContextOffset));
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
3220 __ ldr(r1, MemOperand(sp, (arg_count + 1) * kPointerSize)); 3221 __ ldr(r1, MemOperand(sp, (arg_count + 1) * kPointerSize));
3221 __ push(r1); 3222 __ push(r1);
3222 EmitResolvePossiblyDirectEval(arg_count); 3223 EmitResolvePossiblyDirectEval(arg_count);
3223 3224
3224 // Touch up the stack with the resolved function. 3225 // Touch up the stack with the resolved function.
3225 __ str(r0, MemOperand(sp, (arg_count + 1) * kPointerSize)); 3226 __ str(r0, MemOperand(sp, (arg_count + 1) * kPointerSize));
3226 3227
3227 PrepareForBailoutForId(expr->EvalId(), NO_REGISTERS); 3228 PrepareForBailoutForId(expr->EvalId(), NO_REGISTERS);
3228 3229
3229 // Record source position for debugger. 3230 // Record source position for debugger.
3230 SetExpressionPosition(expr); 3231 SetCallPosition(expr, arg_count);
3231 CallFunctionStub stub(isolate(), arg_count, NO_CALL_FUNCTION_FLAGS); 3232 CallFunctionStub stub(isolate(), arg_count, NO_CALL_FUNCTION_FLAGS);
3232 __ ldr(r1, MemOperand(sp, (arg_count + 1) * kPointerSize)); 3233 __ ldr(r1, MemOperand(sp, (arg_count + 1) * kPointerSize));
3233 __ CallStub(&stub); 3234 __ CallStub(&stub);
3234 RecordJSReturnSite(expr); 3235 RecordJSReturnSite(expr);
3235 // Restore context register. 3236 // Restore context register.
3236 __ ldr(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); 3237 __ ldr(cp, MemOperand(fp, StandardFrameConstants::kContextOffset));
3237 context()->DropAndPlug(1, r0); 3238 context()->DropAndPlug(1, r0);
3238 } else if (call_type == Call::GLOBAL_CALL) { 3239 } else if (call_type == Call::GLOBAL_CALL) {
3239 EmitCallWithLoadIC(expr); 3240 EmitCallWithLoadIC(expr);
3240 3241
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
3292 3293
3293 // Push the arguments ("left-to-right") on the stack. 3294 // Push the arguments ("left-to-right") on the stack.
3294 ZoneList<Expression*>* args = expr->arguments(); 3295 ZoneList<Expression*>* args = expr->arguments();
3295 int arg_count = args->length(); 3296 int arg_count = args->length();
3296 for (int i = 0; i < arg_count; i++) { 3297 for (int i = 0; i < arg_count; i++) {
3297 VisitForStackValue(args->at(i)); 3298 VisitForStackValue(args->at(i));
3298 } 3299 }
3299 3300
3300 // Call the construct call builtin that handles allocation and 3301 // Call the construct call builtin that handles allocation and
3301 // constructor invocation. 3302 // constructor invocation.
3302 SetExpressionPosition(expr); 3303 SetConstructCallPosition(expr);
3303 3304
3304 // Load function and argument count into r1 and r0. 3305 // Load function and argument count into r1 and r0.
3305 __ mov(r0, Operand(arg_count)); 3306 __ mov(r0, Operand(arg_count));
3306 __ ldr(r1, MemOperand(sp, arg_count * kPointerSize)); 3307 __ ldr(r1, MemOperand(sp, arg_count * kPointerSize));
3307 3308
3308 // Record call targets in unoptimized code. 3309 // Record call targets in unoptimized code.
3309 if (FLAG_pretenuring_call_new) { 3310 if (FLAG_pretenuring_call_new) {
3310 EnsureSlotContainsAllocationSite(expr->AllocationSiteFeedbackSlot()); 3311 EnsureSlotContainsAllocationSite(expr->AllocationSiteFeedbackSlot());
3311 DCHECK(expr->AllocationSiteFeedbackSlot().ToInt() == 3312 DCHECK(expr->AllocationSiteFeedbackSlot().ToInt() ==
3312 expr->CallNewFeedbackSlot().ToInt() + 1); 3313 expr->CallNewFeedbackSlot().ToInt() + 1);
(...skipping 22 matching lines...) Expand all
3335 3336
3336 // Push the arguments ("left-to-right") on the stack. 3337 // Push the arguments ("left-to-right") on the stack.
3337 ZoneList<Expression*>* args = expr->arguments(); 3338 ZoneList<Expression*>* args = expr->arguments();
3338 int arg_count = args->length(); 3339 int arg_count = args->length();
3339 for (int i = 0; i < arg_count; i++) { 3340 for (int i = 0; i < arg_count; i++) {
3340 VisitForStackValue(args->at(i)); 3341 VisitForStackValue(args->at(i));
3341 } 3342 }
3342 3343
3343 // Call the construct call builtin that handles allocation and 3344 // Call the construct call builtin that handles allocation and
3344 // constructor invocation. 3345 // constructor invocation.
3345 SetExpressionPosition(expr); 3346 SetConstructCallPosition(expr);
3346 3347
3347 // Load function and argument count into r1 and r0. 3348 // Load function and argument count into r1 and r0.
3348 __ mov(r0, Operand(arg_count)); 3349 __ mov(r0, Operand(arg_count));
3349 __ ldr(r1, MemOperand(sp, arg_count * kPointerSize)); 3350 __ ldr(r1, MemOperand(sp, arg_count * kPointerSize));
3350 3351
3351 // Record call targets in unoptimized code. 3352 // Record call targets in unoptimized code.
3352 if (FLAG_pretenuring_call_new) { 3353 if (FLAG_pretenuring_call_new) {
3353 UNREACHABLE(); 3354 UNREACHABLE();
3354 /* TODO(dslomov): support pretenuring. 3355 /* TODO(dslomov): support pretenuring.
3355 EnsureSlotContainsAllocationSite(expr->AllocationSiteFeedbackSlot()); 3356 EnsureSlotContainsAllocationSite(expr->AllocationSiteFeedbackSlot());
(...skipping 1358 matching lines...) Expand 10 before | Expand all | Expand 10 after
4714 __ mov(LoadDescriptor::SlotRegister(), 4715 __ mov(LoadDescriptor::SlotRegister(),
4715 Operand(SmiFromSlot(expr->CallRuntimeFeedbackSlot()))); 4716 Operand(SmiFromSlot(expr->CallRuntimeFeedbackSlot())));
4716 CallLoadIC(NOT_CONTEXTUAL); 4717 CallLoadIC(NOT_CONTEXTUAL);
4717 } 4718 }
4718 4719
4719 4720
4720 void FullCodeGenerator::EmitCallJSRuntimeFunction(CallRuntime* expr) { 4721 void FullCodeGenerator::EmitCallJSRuntimeFunction(CallRuntime* expr) {
4721 ZoneList<Expression*>* args = expr->arguments(); 4722 ZoneList<Expression*>* args = expr->arguments();
4722 int arg_count = args->length(); 4723 int arg_count = args->length();
4723 4724
4724 SetExpressionPosition(expr); 4725 SetCallPosition(expr, arg_count);
4725 CallFunctionStub stub(isolate(), arg_count, NO_CALL_FUNCTION_FLAGS); 4726 CallFunctionStub stub(isolate(), arg_count, NO_CALL_FUNCTION_FLAGS);
4726 __ ldr(r1, MemOperand(sp, (arg_count + 1) * kPointerSize)); 4727 __ ldr(r1, MemOperand(sp, (arg_count + 1) * kPointerSize));
4727 __ CallStub(&stub); 4728 __ CallStub(&stub);
4728 } 4729 }
4729 4730
4730 4731
4731 void FullCodeGenerator::VisitCallRuntime(CallRuntime* expr) { 4732 void FullCodeGenerator::VisitCallRuntime(CallRuntime* expr) {
4732 ZoneList<Expression*>* args = expr->arguments(); 4733 ZoneList<Expression*>* args = expr->arguments();
4733 int arg_count = args->length(); 4734 int arg_count = args->length();
4734 4735
(...skipping 883 matching lines...) Expand 10 before | Expand all | Expand 10 after
5618 DCHECK(interrupt_address == 5619 DCHECK(interrupt_address ==
5619 isolate->builtins()->OsrAfterStackCheck()->entry()); 5620 isolate->builtins()->OsrAfterStackCheck()->entry());
5620 return OSR_AFTER_STACK_CHECK; 5621 return OSR_AFTER_STACK_CHECK;
5621 } 5622 }
5622 5623
5623 5624
5624 } // namespace internal 5625 } // namespace internal
5625 } // namespace v8 5626 } // namespace v8
5626 5627
5627 #endif // V8_TARGET_ARCH_ARM 5628 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « src/arm/debug-arm.cc ('k') | src/arm64/assembler-arm64.h » ('j') | src/assembler.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698