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 5843 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5854 Register scratch3, | 5854 Register scratch3, |
5855 Register scratch4, | 5855 Register scratch4, |
5856 Label* slow) { | 5856 Label* slow) { |
5857 // First check if the argument is already a string. | 5857 // First check if the argument is already a string. |
5858 Label not_string, done; | 5858 Label not_string, done; |
5859 __ JumpIfSmi(arg, ¬_string); | 5859 __ JumpIfSmi(arg, ¬_string); |
5860 __ GetObjectType(arg, scratch1, scratch1); | 5860 __ GetObjectType(arg, scratch1, scratch1); |
5861 __ Branch(&done, lt, scratch1, Operand(FIRST_NONSTRING_TYPE)); | 5861 __ Branch(&done, lt, scratch1, Operand(FIRST_NONSTRING_TYPE)); |
5862 | 5862 |
5863 // Check the number to string cache. | 5863 // Check the number to string cache. |
5864 Label not_cached; | |
5865 __ bind(¬_string); | 5864 __ bind(¬_string); |
5866 // Puts the cached result into scratch1. | 5865 // Puts the cached result into scratch1. |
5867 NumberToStringStub::GenerateLookupNumberStringCache(masm, | 5866 NumberToStringStub::GenerateLookupNumberStringCache(masm, |
5868 arg, | 5867 arg, |
5869 scratch1, | 5868 scratch1, |
5870 scratch2, | 5869 scratch2, |
5871 scratch3, | 5870 scratch3, |
5872 scratch4, | 5871 scratch4, |
5873 ¬_cached); | 5872 slow); |
5874 __ mov(arg, scratch1); | 5873 __ mov(arg, scratch1); |
5875 __ sw(arg, MemOperand(sp, stack_offset)); | 5874 __ sw(arg, MemOperand(sp, stack_offset)); |
5876 __ jmp(&done); | |
5877 | |
5878 // Check if the argument is a safe string wrapper. | |
5879 __ bind(¬_cached); | |
5880 __ JumpIfSmi(arg, slow); | |
5881 __ GetObjectType(arg, scratch1, scratch2); // map -> scratch1. | |
5882 __ Branch(slow, ne, scratch2, Operand(JS_VALUE_TYPE)); | |
5883 __ lbu(scratch2, FieldMemOperand(scratch1, Map::kBitField2Offset)); | |
5884 __ li(scratch4, 1 << Map::kStringWrapperSafeForDefaultValueOf); | |
5885 __ And(scratch2, scratch2, scratch4); | |
5886 __ Branch(slow, ne, scratch2, Operand(scratch4)); | |
5887 __ lw(arg, FieldMemOperand(arg, JSValue::kValueOffset)); | |
5888 __ sw(arg, MemOperand(sp, stack_offset)); | |
5889 | |
5890 __ bind(&done); | 5875 __ bind(&done); |
5891 } | 5876 } |
5892 | 5877 |
5893 | 5878 |
5894 void ICCompareStub::GenerateSmis(MacroAssembler* masm) { | 5879 void ICCompareStub::GenerateSmis(MacroAssembler* masm) { |
5895 ASSERT(state_ == CompareIC::SMI); | 5880 ASSERT(state_ == CompareIC::SMI); |
5896 Label miss; | 5881 Label miss; |
5897 __ Or(a2, a1, a0); | 5882 __ Or(a2, a1, a0); |
5898 __ JumpIfNotSmi(a2, &miss); | 5883 __ JumpIfNotSmi(a2, &miss); |
5899 | 5884 |
(...skipping 1356 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7256 __ bind(&fast_elements_case); | 7241 __ bind(&fast_elements_case); |
7257 GenerateCase(masm, FAST_ELEMENTS); | 7242 GenerateCase(masm, FAST_ELEMENTS); |
7258 } | 7243 } |
7259 | 7244 |
7260 | 7245 |
7261 #undef __ | 7246 #undef __ |
7262 | 7247 |
7263 } } // namespace v8::internal | 7248 } } // namespace v8::internal |
7264 | 7249 |
7265 #endif // V8_TARGET_ARCH_MIPS | 7250 #endif // V8_TARGET_ARCH_MIPS |
OLD | NEW |