OLD | NEW |
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 383 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
394 // ----------------------------------- | 394 // ----------------------------------- |
395 Label number, non_number, non_string, boolean, probe, miss; | 395 Label number, non_number, non_string, boolean, probe, miss; |
396 | 396 |
397 // Probe the stub cache. | 397 // Probe the stub cache. |
398 Code::Flags flags = Code::ComputeFlags(kind, | 398 Code::Flags flags = Code::ComputeFlags(kind, |
399 MONOMORPHIC, | 399 MONOMORPHIC, |
400 extra_state, | 400 extra_state, |
401 NORMAL, | 401 NORMAL, |
402 argc); | 402 argc); |
403 Isolate::Current()->stub_cache()->GenerateProbe( | 403 Isolate::Current()->stub_cache()->GenerateProbe( |
404 masm, flags, a1, a2, a3, t0, t1); | 404 masm, flags, a1, a2, a3, t0, t1, t2); |
405 | 405 |
406 // If the stub cache probing failed, the receiver might be a value. | 406 // If the stub cache probing failed, the receiver might be a value. |
407 // For value objects, we use the map of the prototype objects for | 407 // For value objects, we use the map of the prototype objects for |
408 // the corresponding JSValue for the cache and that is what we need | 408 // the corresponding JSValue for the cache and that is what we need |
409 // to probe. | 409 // to probe. |
410 // | 410 // |
411 // Check for number. | 411 // Check for number. |
412 __ JumpIfSmi(a1, &number, t1); | 412 __ JumpIfSmi(a1, &number, t1); |
413 __ GetObjectType(a1, a3, a3); | 413 __ GetObjectType(a1, a3, a3); |
414 __ Branch(&non_number, ne, a3, Operand(HEAP_NUMBER_TYPE)); | 414 __ Branch(&non_number, ne, a3, Operand(HEAP_NUMBER_TYPE)); |
(...skipping 15 matching lines...) Expand all Loading... |
430 __ Branch(&boolean, eq, a1, Operand(t0)); | 430 __ Branch(&boolean, eq, a1, Operand(t0)); |
431 __ LoadRoot(t1, Heap::kFalseValueRootIndex); | 431 __ LoadRoot(t1, Heap::kFalseValueRootIndex); |
432 __ Branch(&miss, ne, a1, Operand(t1)); | 432 __ Branch(&miss, ne, a1, Operand(t1)); |
433 __ bind(&boolean); | 433 __ bind(&boolean); |
434 StubCompiler::GenerateLoadGlobalFunctionPrototype( | 434 StubCompiler::GenerateLoadGlobalFunctionPrototype( |
435 masm, Context::BOOLEAN_FUNCTION_INDEX, a1); | 435 masm, Context::BOOLEAN_FUNCTION_INDEX, a1); |
436 | 436 |
437 // Probe the stub cache for the value object. | 437 // Probe the stub cache for the value object. |
438 __ bind(&probe); | 438 __ bind(&probe); |
439 Isolate::Current()->stub_cache()->GenerateProbe( | 439 Isolate::Current()->stub_cache()->GenerateProbe( |
440 masm, flags, a1, a2, a3, t0, t1); | 440 masm, flags, a1, a2, a3, t0, t1, t2); |
441 | 441 |
442 __ bind(&miss); | 442 __ bind(&miss); |
443 } | 443 } |
444 | 444 |
445 | 445 |
446 static void GenerateFunctionTailCall(MacroAssembler* masm, | 446 static void GenerateFunctionTailCall(MacroAssembler* masm, |
447 int argc, | 447 int argc, |
448 Label* miss, | 448 Label* miss, |
449 Register scratch) { | 449 Register scratch) { |
450 // a1: function | 450 // a1: function |
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
695 // ----------- S t a t e ------------- | 695 // ----------- S t a t e ------------- |
696 // -- a2 : name | 696 // -- a2 : name |
697 // -- ra : return address | 697 // -- ra : return address |
698 // -- a0 : receiver | 698 // -- a0 : receiver |
699 // -- sp[0] : receiver | 699 // -- sp[0] : receiver |
700 // ----------------------------------- | 700 // ----------------------------------- |
701 | 701 |
702 // Probe the stub cache. | 702 // Probe the stub cache. |
703 Code::Flags flags = Code::ComputeFlags(Code::LOAD_IC, MONOMORPHIC); | 703 Code::Flags flags = Code::ComputeFlags(Code::LOAD_IC, MONOMORPHIC); |
704 Isolate::Current()->stub_cache()->GenerateProbe( | 704 Isolate::Current()->stub_cache()->GenerateProbe( |
705 masm, flags, a0, a2, a3, t0, t1); | 705 masm, flags, a0, a2, a3, t0, t1, t2); |
706 | 706 |
707 // Cache miss: Jump to runtime. | 707 // Cache miss: Jump to runtime. |
708 GenerateMiss(masm); | 708 GenerateMiss(masm); |
709 } | 709 } |
710 | 710 |
711 | 711 |
712 void LoadIC::GenerateNormal(MacroAssembler* masm) { | 712 void LoadIC::GenerateNormal(MacroAssembler* masm) { |
713 // ----------- S t a t e ------------- | 713 // ----------- S t a t e ------------- |
714 // -- a2 : name | 714 // -- a2 : name |
715 // -- lr : return address | 715 // -- lr : return address |
(...skipping 790 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1506 // -- a0 : value | 1506 // -- a0 : value |
1507 // -- a1 : receiver | 1507 // -- a1 : receiver |
1508 // -- a2 : name | 1508 // -- a2 : name |
1509 // -- ra : return address | 1509 // -- ra : return address |
1510 // ----------------------------------- | 1510 // ----------------------------------- |
1511 | 1511 |
1512 // Get the receiver from the stack and probe the stub cache. | 1512 // Get the receiver from the stack and probe the stub cache. |
1513 Code::Flags flags = | 1513 Code::Flags flags = |
1514 Code::ComputeFlags(Code::STORE_IC, MONOMORPHIC, strict_mode); | 1514 Code::ComputeFlags(Code::STORE_IC, MONOMORPHIC, strict_mode); |
1515 Isolate::Current()->stub_cache()->GenerateProbe( | 1515 Isolate::Current()->stub_cache()->GenerateProbe( |
1516 masm, flags, a1, a2, a3, t0, t1); | 1516 masm, flags, a1, a2, a3, t0, t1, t2); |
1517 | 1517 |
1518 // Cache miss: Jump to runtime. | 1518 // Cache miss: Jump to runtime. |
1519 GenerateMiss(masm); | 1519 GenerateMiss(masm); |
1520 } | 1520 } |
1521 | 1521 |
1522 | 1522 |
1523 void StoreIC::GenerateMiss(MacroAssembler* masm) { | 1523 void StoreIC::GenerateMiss(MacroAssembler* masm) { |
1524 // ----------- S t a t e ------------- | 1524 // ----------- S t a t e ------------- |
1525 // -- a0 : value | 1525 // -- a0 : value |
1526 // -- a1 : receiver | 1526 // -- a1 : receiver |
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1749 Register reg = Register::from_code(Assembler::GetRs(instr_at_patch)); | 1749 Register reg = Register::from_code(Assembler::GetRs(instr_at_patch)); |
1750 patcher.masm()->andi(at, reg, kSmiTagMask); | 1750 patcher.masm()->andi(at, reg, kSmiTagMask); |
1751 patcher.ChangeBranchCondition(eq); | 1751 patcher.ChangeBranchCondition(eq); |
1752 } | 1752 } |
1753 } | 1753 } |
1754 | 1754 |
1755 | 1755 |
1756 } } // namespace v8::internal | 1756 } } // namespace v8::internal |
1757 | 1757 |
1758 #endif // V8_TARGET_ARCH_MIPS | 1758 #endif // V8_TARGET_ARCH_MIPS |
OLD | NEW |