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

Side by Side Diff: src/arm/macro-assembler-arm.h

Issue 11098043: Simplify some of the startup code for SubStringStub::Generate. (Closed) Base URL: https://github.com/v8/v8.git@master
Patch Set: Clarify comments. Created 8 years, 2 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
« no previous file with comments | « src/arm/code-stubs-arm.cc ('k') | src/arm/simulator-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 859 matching lines...) Expand 10 before | Expand all | Expand 10 after
870 SmiCheckType smi_check_type); 870 SmiCheckType smi_check_type);
871 871
872 872
873 // Compare the object in a register to a value from the root list. 873 // Compare the object in a register to a value from the root list.
874 // Uses the ip register as scratch. 874 // Uses the ip register as scratch.
875 void CompareRoot(Register obj, Heap::RootListIndex index); 875 void CompareRoot(Register obj, Heap::RootListIndex index);
876 876
877 877
878 // Load and check the instance type of an object for being a string. 878 // Load and check the instance type of an object for being a string.
879 // Loads the type into the second argument register. 879 // Loads the type into the second argument register.
880 // Returns a condition that will be enabled if the object was a string. 880 // Returns a condition that will be enabled if the object was a string
881 // and the passed-in condition passed. If the passed-in condition failed
882 // then flags remain unchanged.
881 Condition IsObjectStringType(Register obj, 883 Condition IsObjectStringType(Register obj,
882 Register type) { 884 Register type,
883 ldr(type, FieldMemOperand(obj, HeapObject::kMapOffset)); 885 Condition cond = al) {
884 ldrb(type, FieldMemOperand(type, Map::kInstanceTypeOffset)); 886 ldr(type, FieldMemOperand(obj, HeapObject::kMapOffset), cond);
885 tst(type, Operand(kIsNotStringMask)); 887 ldrb(type, FieldMemOperand(type, Map::kInstanceTypeOffset), cond);
888 tst(type, Operand(kIsNotStringMask), cond);
886 ASSERT_EQ(0, kStringTag); 889 ASSERT_EQ(0, kStringTag);
887 return eq; 890 return eq;
888 } 891 }
889 892
890 893
891 // Generates code for reporting that an illegal operation has 894 // Generates code for reporting that an illegal operation has
892 // occurred. 895 // occurred.
893 void IllegalOperation(int num_arguments); 896 void IllegalOperation(int num_arguments);
894 897
895 // Picks out an array index from the hash field. 898 // Picks out an array index from the hash field.
(...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after
1179 } 1182 }
1180 1183
1181 // Untag the source value into destination and jump if source is a smi. 1184 // Untag the source value into destination and jump if source is a smi.
1182 // Souce and destination can be the same register. 1185 // Souce and destination can be the same register.
1183 void UntagAndJumpIfSmi(Register dst, Register src, Label* smi_case); 1186 void UntagAndJumpIfSmi(Register dst, Register src, Label* smi_case);
1184 1187
1185 // Untag the source value into destination and jump if source is not a smi. 1188 // Untag the source value into destination and jump if source is not a smi.
1186 // Souce and destination can be the same register. 1189 // Souce and destination can be the same register.
1187 void UntagAndJumpIfNotSmi(Register dst, Register src, Label* non_smi_case); 1190 void UntagAndJumpIfNotSmi(Register dst, Register src, Label* non_smi_case);
1188 1191
1189 // Jump the register contains a smi. 1192 // Jump if the register contains a smi.
1190 inline void JumpIfSmi(Register value, Label* smi_label) { 1193 inline void JumpIfSmi(Register value, Label* smi_label) {
1191 tst(value, Operand(kSmiTagMask)); 1194 tst(value, Operand(kSmiTagMask));
1192 b(eq, smi_label); 1195 b(eq, smi_label);
1193 } 1196 }
1194 // Jump if either of the registers contain a non-smi. 1197 // Jump if either of the registers contain a non-smi.
1195 inline void JumpIfNotSmi(Register value, Label* not_smi_label) { 1198 inline void JumpIfNotSmi(Register value, Label* not_smi_label) {
1196 tst(value, Operand(kSmiTagMask)); 1199 tst(value, Operand(kSmiTagMask));
1197 b(ne, not_smi_label); 1200 b(ne, not_smi_label);
1198 } 1201 }
1199 // Jump if either of the registers contain a non-smi. 1202 // Jump if either of the registers contain a non-smi.
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after
1402 #define __FILE_LINE__ __FILE__ ":" CODE_COVERAGE_TOSTRING(__LINE__) 1405 #define __FILE_LINE__ __FILE__ ":" CODE_COVERAGE_TOSTRING(__LINE__)
1403 #define ACCESS_MASM(masm) masm->stop(__FILE_LINE__); masm-> 1406 #define ACCESS_MASM(masm) masm->stop(__FILE_LINE__); masm->
1404 #else 1407 #else
1405 #define ACCESS_MASM(masm) masm-> 1408 #define ACCESS_MASM(masm) masm->
1406 #endif 1409 #endif
1407 1410
1408 1411
1409 } } // namespace v8::internal 1412 } } // namespace v8::internal
1410 1413
1411 #endif // V8_ARM_MACRO_ASSEMBLER_ARM_H_ 1414 #endif // V8_ARM_MACRO_ASSEMBLER_ARM_H_
OLDNEW
« no previous file with comments | « src/arm/code-stubs-arm.cc ('k') | src/arm/simulator-arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698