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

Side by Side Diff: src/mips/code-stubs-mips.cc

Issue 78403002: MIPS: Use SmiTst and TrySmiTag MacroAssembler instructions. (Closed) Base URL: https://github.com/v8/v8.git@gbl
Patch Set: Created 7 years, 1 month 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
« no previous file with comments | « src/mips/builtins-mips.cc ('k') | src/mips/full-codegen-mips.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 2951 matching lines...) Expand 10 before | Expand all | Expand 10 after
2962 // Check that the first argument is a JSRegExp object. 2962 // Check that the first argument is a JSRegExp object.
2963 __ lw(a0, MemOperand(sp, kJSRegExpOffset)); 2963 __ lw(a0, MemOperand(sp, kJSRegExpOffset));
2964 STATIC_ASSERT(kSmiTag == 0); 2964 STATIC_ASSERT(kSmiTag == 0);
2965 __ JumpIfSmi(a0, &runtime); 2965 __ JumpIfSmi(a0, &runtime);
2966 __ GetObjectType(a0, a1, a1); 2966 __ GetObjectType(a0, a1, a1);
2967 __ Branch(&runtime, ne, a1, Operand(JS_REGEXP_TYPE)); 2967 __ Branch(&runtime, ne, a1, Operand(JS_REGEXP_TYPE));
2968 2968
2969 // Check that the RegExp has been compiled (data contains a fixed array). 2969 // Check that the RegExp has been compiled (data contains a fixed array).
2970 __ lw(regexp_data, FieldMemOperand(a0, JSRegExp::kDataOffset)); 2970 __ lw(regexp_data, FieldMemOperand(a0, JSRegExp::kDataOffset));
2971 if (FLAG_debug_code) { 2971 if (FLAG_debug_code) {
2972 __ And(t0, regexp_data, Operand(kSmiTagMask)); 2972 __ SmiTst(regexp_data, t0);
2973 __ Check(nz, 2973 __ Check(nz,
2974 kUnexpectedTypeForRegExpDataFixedArrayExpected, 2974 kUnexpectedTypeForRegExpDataFixedArrayExpected,
2975 t0, 2975 t0,
2976 Operand(zero_reg)); 2976 Operand(zero_reg));
2977 __ GetObjectType(regexp_data, a0, a0); 2977 __ GetObjectType(regexp_data, a0, a0);
2978 __ Check(eq, 2978 __ Check(eq,
2979 kUnexpectedTypeForRegExpDataFixedArrayExpected, 2979 kUnexpectedTypeForRegExpDataFixedArrayExpected,
2980 a0, 2980 a0,
2981 Operand(FIXED_ARRAY_TYPE)); 2981 Operand(FIXED_ARRAY_TYPE));
2982 } 2982 }
(...skipping 3174 matching lines...) Expand 10 before | Expand all | Expand 10 after
6157 // -- sp[0] : return address 6157 // -- sp[0] : return address
6158 // -- sp[4] : last argument 6158 // -- sp[4] : last argument
6159 // ----------------------------------- 6159 // -----------------------------------
6160 if (FLAG_debug_code) { 6160 if (FLAG_debug_code) {
6161 // The array construct code is only set for the global and natives 6161 // The array construct code is only set for the global and natives
6162 // builtin Array functions which always have maps. 6162 // builtin Array functions which always have maps.
6163 6163
6164 // Initial map for the builtin Array function should be a map. 6164 // Initial map for the builtin Array function should be a map.
6165 __ lw(a3, FieldMemOperand(a1, JSFunction::kPrototypeOrInitialMapOffset)); 6165 __ lw(a3, FieldMemOperand(a1, JSFunction::kPrototypeOrInitialMapOffset));
6166 // Will both indicate a NULL and a Smi. 6166 // Will both indicate a NULL and a Smi.
6167 __ And(at, a3, Operand(kSmiTagMask)); 6167 __ SmiTst(a3, at);
6168 __ Assert(ne, kUnexpectedInitialMapForArrayFunction, 6168 __ Assert(ne, kUnexpectedInitialMapForArrayFunction,
6169 at, Operand(zero_reg)); 6169 at, Operand(zero_reg));
6170 __ GetObjectType(a3, a3, t0); 6170 __ GetObjectType(a3, a3, t0);
6171 __ Assert(eq, kUnexpectedInitialMapForArrayFunction, 6171 __ Assert(eq, kUnexpectedInitialMapForArrayFunction,
6172 t0, Operand(MAP_TYPE)); 6172 t0, Operand(MAP_TYPE));
6173 6173
6174 // We should either have undefined in a2 or a valid cell. 6174 // We should either have undefined in a2 or a valid cell.
6175 Label okay_here; 6175 Label okay_here;
6176 Handle<Map> cell_map = masm->isolate()->factory()->cell_map(); 6176 Handle<Map> cell_map = masm->isolate()->factory()->cell_map();
6177 __ LoadRoot(at, Heap::kUndefinedValueRootIndex); 6177 __ LoadRoot(at, Heap::kUndefinedValueRootIndex);
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
6246 // -- sp[4] : last argument 6246 // -- sp[4] : last argument
6247 // ----------------------------------- 6247 // -----------------------------------
6248 6248
6249 if (FLAG_debug_code) { 6249 if (FLAG_debug_code) {
6250 // The array construct code is only set for the global and natives 6250 // The array construct code is only set for the global and natives
6251 // builtin Array functions which always have maps. 6251 // builtin Array functions which always have maps.
6252 6252
6253 // Initial map for the builtin Array function should be a map. 6253 // Initial map for the builtin Array function should be a map.
6254 __ lw(a3, FieldMemOperand(a1, JSFunction::kPrototypeOrInitialMapOffset)); 6254 __ lw(a3, FieldMemOperand(a1, JSFunction::kPrototypeOrInitialMapOffset));
6255 // Will both indicate a NULL and a Smi. 6255 // Will both indicate a NULL and a Smi.
6256 __ And(at, a3, Operand(kSmiTagMask)); 6256 __ SmiTst(a3, at);
6257 __ Assert(ne, kUnexpectedInitialMapForArrayFunction, 6257 __ Assert(ne, kUnexpectedInitialMapForArrayFunction,
6258 at, Operand(zero_reg)); 6258 at, Operand(zero_reg));
6259 __ GetObjectType(a3, a3, t0); 6259 __ GetObjectType(a3, a3, t0);
6260 __ Assert(eq, kUnexpectedInitialMapForArrayFunction, 6260 __ Assert(eq, kUnexpectedInitialMapForArrayFunction,
6261 t0, Operand(MAP_TYPE)); 6261 t0, Operand(MAP_TYPE));
6262 } 6262 }
6263 6263
6264 // Figure out the right elements kind. 6264 // Figure out the right elements kind.
6265 __ lw(a3, FieldMemOperand(a1, JSFunction::kPrototypeOrInitialMapOffset)); 6265 __ lw(a3, FieldMemOperand(a1, JSFunction::kPrototypeOrInitialMapOffset));
6266 6266
(...skipping 19 matching lines...) Expand all
6286 __ bind(&fast_elements_case); 6286 __ bind(&fast_elements_case);
6287 GenerateCase(masm, FAST_ELEMENTS); 6287 GenerateCase(masm, FAST_ELEMENTS);
6288 } 6288 }
6289 6289
6290 6290
6291 #undef __ 6291 #undef __
6292 6292
6293 } } // namespace v8::internal 6293 } } // namespace v8::internal
6294 6294
6295 #endif // V8_TARGET_ARCH_MIPS 6295 #endif // V8_TARGET_ARCH_MIPS
OLDNEW
« no previous file with comments | « src/mips/builtins-mips.cc ('k') | src/mips/full-codegen-mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698