OLD | NEW |
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 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 1225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1236 int CodeGenerator::FastCaseSwitchMaxOverheadFactor() { | 1236 int CodeGenerator::FastCaseSwitchMaxOverheadFactor() { |
1237 return kFastSwitchMaxOverheadFactor; | 1237 return kFastSwitchMaxOverheadFactor; |
1238 } | 1238 } |
1239 | 1239 |
1240 int CodeGenerator::FastCaseSwitchMinCaseCount() { | 1240 int CodeGenerator::FastCaseSwitchMinCaseCount() { |
1241 return kFastSwitchMinCaseCount; | 1241 return kFastSwitchMinCaseCount; |
1242 } | 1242 } |
1243 | 1243 |
1244 | 1244 |
1245 void CodeGenerator::GenerateFastCaseSwitchJumpTable( | 1245 void CodeGenerator::GenerateFastCaseSwitchJumpTable( |
1246 SwitchStatement* node, int min_index, int range, Label *fail_label, | 1246 SwitchStatement* node, |
1247 SmartPointer<Label*> &case_targets, SmartPointer<Label> &case_labels) { | 1247 int min_index, |
| 1248 int range, |
| 1249 Label* fail_label, |
| 1250 Vector<Label*> case_targets, |
| 1251 Vector<Label> case_labels) { |
1248 | 1252 |
1249 ASSERT(kSmiTag == 0 && kSmiTagSize <= 2); | 1253 ASSERT(kSmiTag == 0 && kSmiTagSize <= 2); |
1250 | 1254 |
1251 __ pop(r0); | 1255 __ pop(r0); |
1252 if (min_index != 0) { | 1256 if (min_index != 0) { |
1253 // small positive numbers can be immediate operands. | 1257 // small positive numbers can be immediate operands. |
1254 if (min_index < 0) { | 1258 if (min_index < 0) { |
1255 __ add(r0, r0, Operand(Smi::FromInt(-min_index))); | 1259 __ add(r0, r0, Operand(Smi::FromInt(-min_index))); |
1256 } else { | 1260 } else { |
1257 __ sub(r0, r0, Operand(Smi::FromInt(min_index))); | 1261 __ sub(r0, r0, Operand(Smi::FromInt(min_index))); |
(...skipping 2914 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4172 // Slow-case: Non-function called. | 4176 // Slow-case: Non-function called. |
4173 __ bind(&slow); | 4177 __ bind(&slow); |
4174 __ mov(r0, Operand(argc_)); // Setup the number of arguments. | 4178 __ mov(r0, Operand(argc_)); // Setup the number of arguments. |
4175 __ InvokeBuiltin(Builtins::CALL_NON_FUNCTION, JUMP_JS); | 4179 __ InvokeBuiltin(Builtins::CALL_NON_FUNCTION, JUMP_JS); |
4176 } | 4180 } |
4177 | 4181 |
4178 | 4182 |
4179 #undef __ | 4183 #undef __ |
4180 | 4184 |
4181 } } // namespace v8::internal | 4185 } } // namespace v8::internal |
OLD | NEW |