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

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

Issue 9496010: Fix secondary stub cache and add a test for the stub cache lookups. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 8 years, 9 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | src/arm/stub-cache-arm.cc » ('j') | src/arm/stub-cache-arm.cc » ('J')
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 381 matching lines...) Expand 10 before | Expand all | Expand 10 after
392 // ----------------------------------- 392 // -----------------------------------
393 Label number, non_number, non_string, boolean, probe, miss; 393 Label number, non_number, non_string, boolean, probe, miss;
394 394
395 // Probe the stub cache. 395 // Probe the stub cache.
396 Code::Flags flags = Code::ComputeFlags(kind, 396 Code::Flags flags = Code::ComputeFlags(kind,
397 MONOMORPHIC, 397 MONOMORPHIC,
398 extra_state, 398 extra_state,
399 NORMAL, 399 NORMAL,
400 argc); 400 argc);
401 Isolate::Current()->stub_cache()->GenerateProbe( 401 Isolate::Current()->stub_cache()->GenerateProbe(
402 masm, flags, r1, r2, r3, r4, r5); 402 masm, flags, r1, r2, r3, r4, r5, r6);
403 403
404 // If the stub cache probing failed, the receiver might be a value. 404 // If the stub cache probing failed, the receiver might be a value.
405 // For value objects, we use the map of the prototype objects for 405 // For value objects, we use the map of the prototype objects for
406 // the corresponding JSValue for the cache and that is what we need 406 // the corresponding JSValue for the cache and that is what we need
407 // to probe. 407 // to probe.
408 // 408 //
409 // Check for number. 409 // Check for number.
410 __ JumpIfSmi(r1, &number); 410 __ JumpIfSmi(r1, &number);
411 __ CompareObjectType(r1, r3, r3, HEAP_NUMBER_TYPE); 411 __ CompareObjectType(r1, r3, r3, HEAP_NUMBER_TYPE);
412 __ b(ne, &non_number); 412 __ b(ne, &non_number);
(...skipping 18 matching lines...) Expand all
431 __ LoadRoot(ip, Heap::kFalseValueRootIndex); 431 __ LoadRoot(ip, Heap::kFalseValueRootIndex);
432 __ cmp(r1, ip); 432 __ cmp(r1, ip);
433 __ b(ne, &miss); 433 __ b(ne, &miss);
434 __ bind(&boolean); 434 __ bind(&boolean);
435 StubCompiler::GenerateLoadGlobalFunctionPrototype( 435 StubCompiler::GenerateLoadGlobalFunctionPrototype(
436 masm, Context::BOOLEAN_FUNCTION_INDEX, r1); 436 masm, Context::BOOLEAN_FUNCTION_INDEX, r1);
437 437
438 // Probe the stub cache for the value object. 438 // Probe the stub cache for the value object.
439 __ bind(&probe); 439 __ bind(&probe);
440 Isolate::Current()->stub_cache()->GenerateProbe( 440 Isolate::Current()->stub_cache()->GenerateProbe(
441 masm, flags, r1, r2, r3, r4, r5); 441 masm, flags, r1, r2, r3, r4, r5, r6);
442 442
443 __ bind(&miss); 443 __ bind(&miss);
444 } 444 }
445 445
446 446
447 static void GenerateFunctionTailCall(MacroAssembler* masm, 447 static void GenerateFunctionTailCall(MacroAssembler* masm,
448 int argc, 448 int argc,
449 Label* miss, 449 Label* miss,
450 Register scratch) { 450 Register scratch) {
451 // r1: function 451 // r1: function
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after
699 // -- r2 : name 699 // -- r2 : name
700 // -- lr : return address 700 // -- lr : return address
701 // -- r0 : receiver 701 // -- r0 : receiver
702 // -- sp[0] : receiver 702 // -- sp[0] : receiver
703 // ----------------------------------- 703 // -----------------------------------
704 704
705 // Probe the stub cache. 705 // Probe the stub cache.
706 Code::Flags flags = 706 Code::Flags flags =
707 Code::ComputeFlags(Code::LOAD_IC, MONOMORPHIC); 707 Code::ComputeFlags(Code::LOAD_IC, MONOMORPHIC);
708 Isolate::Current()->stub_cache()->GenerateProbe( 708 Isolate::Current()->stub_cache()->GenerateProbe(
709 masm, flags, r0, r2, r3, r4, r5); 709 masm, flags, r0, r2, r3, r4, r5, r6);
710 710
711 // Cache miss: Jump to runtime. 711 // Cache miss: Jump to runtime.
712 GenerateMiss(masm); 712 GenerateMiss(masm);
713 } 713 }
714 714
715 715
716 void LoadIC::GenerateNormal(MacroAssembler* masm) { 716 void LoadIC::GenerateNormal(MacroAssembler* masm) {
717 // ----------- S t a t e ------------- 717 // ----------- S t a t e -------------
718 // -- r2 : name 718 // -- r2 : name
719 // -- lr : return address 719 // -- lr : return address
(...skipping 789 matching lines...) Expand 10 before | Expand all | Expand 10 after
1509 // -- r1 : receiver 1509 // -- r1 : receiver
1510 // -- r2 : name 1510 // -- r2 : name
1511 // -- lr : return address 1511 // -- lr : return address
1512 // ----------------------------------- 1512 // -----------------------------------
1513 1513
1514 // Get the receiver from the stack and probe the stub cache. 1514 // Get the receiver from the stack and probe the stub cache.
1515 Code::Flags flags = 1515 Code::Flags flags =
1516 Code::ComputeFlags(Code::STORE_IC, MONOMORPHIC, strict_mode); 1516 Code::ComputeFlags(Code::STORE_IC, MONOMORPHIC, strict_mode);
1517 1517
1518 Isolate::Current()->stub_cache()->GenerateProbe( 1518 Isolate::Current()->stub_cache()->GenerateProbe(
1519 masm, flags, r1, r2, r3, r4, r5); 1519 masm, flags, r1, r2, r3, r4, r5, r6);
1520 1520
1521 // Cache miss: Jump to runtime. 1521 // Cache miss: Jump to runtime.
1522 GenerateMiss(masm); 1522 GenerateMiss(masm);
1523 } 1523 }
1524 1524
1525 1525
1526 void StoreIC::GenerateMiss(MacroAssembler* masm) { 1526 void StoreIC::GenerateMiss(MacroAssembler* masm) {
1527 // ----------- S t a t e ------------- 1527 // ----------- S t a t e -------------
1528 // -- r0 : value 1528 // -- r0 : value
1529 // -- r1 : receiver 1529 // -- r1 : receiver
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after
1758 Register reg = Assembler::GetRn(instr_at_patch); 1758 Register reg = Assembler::GetRn(instr_at_patch);
1759 patcher.masm()->tst(reg, Operand(kSmiTagMask)); 1759 patcher.masm()->tst(reg, Operand(kSmiTagMask));
1760 patcher.EmitCondition(eq); 1760 patcher.EmitCondition(eq);
1761 } 1761 }
1762 } 1762 }
1763 1763
1764 1764
1765 } } // namespace v8::internal 1765 } } // namespace v8::internal
1766 1766
1767 #endif // V8_TARGET_ARCH_ARM 1767 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « no previous file | src/arm/stub-cache-arm.cc » ('j') | src/arm/stub-cache-arm.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698