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

Side by Side Diff: src/arm/ic-arm.cc

Issue 91803003: Move responsibility for definition of ExtraICState bits into the ICs. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: A couple more nits. Created 7 years 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | src/arm/stub-cache-arm.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after
334 334
335 335
336 // Defined in ic.cc. 336 // Defined in ic.cc.
337 Object* CallIC_Miss(Arguments args); 337 Object* CallIC_Miss(Arguments args);
338 338
339 // The generated code does not accept smi keys. 339 // The generated code does not accept smi keys.
340 // The generated code falls through if both probes miss. 340 // The generated code falls through if both probes miss.
341 void CallICBase::GenerateMonomorphicCacheProbe(MacroAssembler* masm, 341 void CallICBase::GenerateMonomorphicCacheProbe(MacroAssembler* masm,
342 int argc, 342 int argc,
343 Code::Kind kind, 343 Code::Kind kind,
344 Code::ExtraICState extra_state) { 344 ExtraICState extra_state) {
345 // ----------- S t a t e ------------- 345 // ----------- S t a t e -------------
346 // -- r1 : receiver 346 // -- r1 : receiver
347 // -- r2 : name 347 // -- r2 : name
348 // ----------------------------------- 348 // -----------------------------------
349 Label number, non_number, non_string, boolean, probe, miss; 349 Label number, non_number, non_string, boolean, probe, miss;
350 350
351 // Probe the stub cache. 351 // Probe the stub cache.
352 Code::Flags flags = Code::ComputeFlags(kind, 352 Code::Flags flags = Code::ComputeFlags(kind,
353 MONOMORPHIC, 353 MONOMORPHIC,
354 extra_state, 354 extra_state,
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
438 438
439 GenerateFunctionTailCall(masm, argc, &miss, r4); 439 GenerateFunctionTailCall(masm, argc, &miss, r4);
440 440
441 __ bind(&miss); 441 __ bind(&miss);
442 } 442 }
443 443
444 444
445 void CallICBase::GenerateMiss(MacroAssembler* masm, 445 void CallICBase::GenerateMiss(MacroAssembler* masm,
446 int argc, 446 int argc,
447 IC::UtilityId id, 447 IC::UtilityId id,
448 Code::ExtraICState extra_state) { 448 ExtraICState extra_state) {
449 // ----------- S t a t e ------------- 449 // ----------- S t a t e -------------
450 // -- r2 : name 450 // -- r2 : name
451 // -- lr : return address 451 // -- lr : return address
452 // ----------------------------------- 452 // -----------------------------------
453 Isolate* isolate = masm->isolate(); 453 Isolate* isolate = masm->isolate();
454 454
455 if (id == IC::kCallIC_Miss) { 455 if (id == IC::kCallIC_Miss) {
456 __ IncrementCounter(isolate->counters()->call_miss(), 1, r3, r4); 456 __ IncrementCounter(isolate->counters()->call_miss(), 1, r3, r4);
457 } else { 457 } else {
458 __ IncrementCounter(isolate->counters()->keyed_call_miss(), 1, r3, r4); 458 __ IncrementCounter(isolate->counters()->keyed_call_miss(), 1, r3, r4);
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
504 __ InvokeFunction(r1, 504 __ InvokeFunction(r1,
505 actual, 505 actual,
506 JUMP_FUNCTION, 506 JUMP_FUNCTION,
507 NullCallWrapper(), 507 NullCallWrapper(),
508 call_kind); 508 call_kind);
509 } 509 }
510 510
511 511
512 void CallIC::GenerateMegamorphic(MacroAssembler* masm, 512 void CallIC::GenerateMegamorphic(MacroAssembler* masm,
513 int argc, 513 int argc,
514 Code::ExtraICState extra_ic_state) { 514 ExtraICState extra_ic_state) {
515 // ----------- S t a t e ------------- 515 // ----------- S t a t e -------------
516 // -- r2 : name 516 // -- r2 : name
517 // -- lr : return address 517 // -- lr : return address
518 // ----------------------------------- 518 // -----------------------------------
519 519
520 // Get the receiver of the function from the stack into r1. 520 // Get the receiver of the function from the stack into r1.
521 __ ldr(r1, MemOperand(sp, argc * kPointerSize)); 521 __ ldr(r1, MemOperand(sp, argc * kPointerSize));
522 GenerateMonomorphicCacheProbe(masm, argc, Code::CALL_IC, extra_ic_state); 522 GenerateMonomorphicCacheProbe(masm, argc, Code::CALL_IC, extra_ic_state);
523 GenerateMiss(masm, argc, extra_ic_state); 523 GenerateMiss(masm, argc, extra_ic_state);
524 } 524 }
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
603 603
604 GenerateDictionaryLoad(masm, &slow_load, r0, r2, r1, r3, r4); 604 GenerateDictionaryLoad(masm, &slow_load, r0, r2, r1, r3, r4);
605 __ IncrementCounter(counters->keyed_call_generic_lookup_dict(), 1, r0, r3); 605 __ IncrementCounter(counters->keyed_call_generic_lookup_dict(), 1, r0, r3);
606 __ jmp(&do_call); 606 __ jmp(&do_call);
607 607
608 __ bind(&lookup_monomorphic_cache); 608 __ bind(&lookup_monomorphic_cache);
609 __ IncrementCounter(counters->keyed_call_generic_lookup_cache(), 1, r0, r3); 609 __ IncrementCounter(counters->keyed_call_generic_lookup_cache(), 1, r0, r3);
610 GenerateMonomorphicCacheProbe(masm, 610 GenerateMonomorphicCacheProbe(masm,
611 argc, 611 argc,
612 Code::KEYED_CALL_IC, 612 Code::KEYED_CALL_IC,
613 Code::kNoExtraICState); 613 kNoExtraICState);
614 // Fall through on miss. 614 // Fall through on miss.
615 615
616 __ bind(&slow_call); 616 __ bind(&slow_call);
617 // This branch is taken if: 617 // This branch is taken if:
618 // - the receiver requires boxing or access check, 618 // - the receiver requires boxing or access check,
619 // - the key is neither smi nor a unique name, 619 // - the key is neither smi nor a unique name,
620 // - the value loaded is not a function, 620 // - the value loaded is not a function,
621 // - there is hope that the runtime will create a monomorphic call stub 621 // - there is hope that the runtime will create a monomorphic call stub
622 // that will get fetched next time. 622 // that will get fetched next time.
623 __ IncrementCounter(counters->keyed_call_generic_slow(), 1, r0, r3); 623 __ IncrementCounter(counters->keyed_call_generic_slow(), 1, r0, r3);
(...skipping 25 matching lines...) Expand all
649 649
650 void LoadIC::GenerateMegamorphic(MacroAssembler* masm) { 650 void LoadIC::GenerateMegamorphic(MacroAssembler* masm) {
651 // ----------- S t a t e ------------- 651 // ----------- S t a t e -------------
652 // -- r2 : name 652 // -- r2 : name
653 // -- lr : return address 653 // -- lr : return address
654 // -- r0 : receiver 654 // -- r0 : receiver
655 // ----------------------------------- 655 // -----------------------------------
656 656
657 // Probe the stub cache. 657 // Probe the stub cache.
658 Code::Flags flags = Code::ComputeFlags( 658 Code::Flags flags = Code::ComputeFlags(
659 Code::HANDLER, MONOMORPHIC, Code::kNoExtraICState, 659 Code::HANDLER, MONOMORPHIC, kNoExtraICState,
660 Code::NORMAL, Code::LOAD_IC); 660 Code::NORMAL, Code::LOAD_IC);
661 masm->isolate()->stub_cache()->GenerateProbe( 661 masm->isolate()->stub_cache()->GenerateProbe(
662 masm, flags, r0, r2, r3, r4, r5, r6); 662 masm, flags, r0, r2, r3, r4, r5, r6);
663 663
664 // Cache miss: Jump to runtime. 664 // Cache miss: Jump to runtime.
665 GenerateMiss(masm); 665 GenerateMiss(masm);
666 } 666 }
667 667
668 668
669 void LoadIC::GenerateNormal(MacroAssembler* masm) { 669 void LoadIC::GenerateNormal(MacroAssembler* masm) {
(...skipping 1007 matching lines...) Expand 10 before | Expand all | Expand 10 after
1677 } else { 1677 } else {
1678 ASSERT(Assembler::GetCondition(branch_instr) == ne); 1678 ASSERT(Assembler::GetCondition(branch_instr) == ne);
1679 patcher.EmitCondition(eq); 1679 patcher.EmitCondition(eq);
1680 } 1680 }
1681 } 1681 }
1682 1682
1683 1683
1684 } } // namespace v8::internal 1684 } } // namespace v8::internal
1685 1685
1686 #endif // V8_TARGET_ARCH_ARM 1686 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « no previous file | src/arm/stub-cache-arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698