OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
218 } | 218 } |
219 | 219 |
220 | 220 |
221 void LIsObjectAndBranch::PrintDataTo(StringStream* stream) { | 221 void LIsObjectAndBranch::PrintDataTo(StringStream* stream) { |
222 stream->Add("if is_object("); | 222 stream->Add("if is_object("); |
223 InputAt(0)->PrintTo(stream); | 223 InputAt(0)->PrintTo(stream); |
224 stream->Add(") then B%d else B%d", true_block_id(), false_block_id()); | 224 stream->Add(") then B%d else B%d", true_block_id(), false_block_id()); |
225 } | 225 } |
226 | 226 |
227 | 227 |
228 void LIsStringAndBranch::PrintDataTo(StringStream* stream) { | |
229 stream->Add("if is_string("); | |
230 InputAt(0)->PrintTo(stream); | |
231 stream->Add(") then B%d else B%d", true_block_id(), false_block_id()); | |
232 } | |
233 | |
234 | |
235 void LIsSmiAndBranch::PrintDataTo(StringStream* stream) { | 228 void LIsSmiAndBranch::PrintDataTo(StringStream* stream) { |
236 stream->Add("if is_smi("); | 229 stream->Add("if is_smi("); |
237 InputAt(0)->PrintTo(stream); | 230 InputAt(0)->PrintTo(stream); |
238 stream->Add(") then B%d else B%d", true_block_id(), false_block_id()); | 231 stream->Add(") then B%d else B%d", true_block_id(), false_block_id()); |
239 } | 232 } |
240 | 233 |
241 | 234 |
242 void LIsUndetectableAndBranch::PrintDataTo(StringStream* stream) { | 235 void LIsUndetectableAndBranch::PrintDataTo(StringStream* stream) { |
243 stream->Add("if is_undetectable("); | 236 stream->Add("if is_undetectable("); |
244 InputAt(0)->PrintTo(stream); | 237 InputAt(0)->PrintTo(stream); |
245 stream->Add(") then B%d else B%d", true_block_id(), false_block_id()); | 238 stream->Add(") then B%d else B%d", true_block_id(), false_block_id()); |
246 } | 239 } |
247 | 240 |
248 | 241 |
249 void LStringCompareAndBranch::PrintDataTo(StringStream* stream) { | |
250 stream->Add("if compare_generic("); | |
251 InputAt(1)->PrintTo(stream); | |
252 InputAt(2)->PrintTo(stream); | |
253 stream->Add(") then B%d else B%d", true_block_id(), false_block_id()); | |
254 } | |
255 | |
256 | |
257 void LHasInstanceTypeAndBranch::PrintDataTo(StringStream* stream) { | 242 void LHasInstanceTypeAndBranch::PrintDataTo(StringStream* stream) { |
258 stream->Add("if has_instance_type("); | 243 stream->Add("if has_instance_type("); |
259 InputAt(0)->PrintTo(stream); | 244 InputAt(0)->PrintTo(stream); |
260 stream->Add(") then B%d else B%d", true_block_id(), false_block_id()); | 245 stream->Add(") then B%d else B%d", true_block_id(), false_block_id()); |
261 } | 246 } |
262 | 247 |
263 | 248 |
264 void LHasCachedArrayIndexAndBranch::PrintDataTo(StringStream* stream) { | 249 void LHasCachedArrayIndexAndBranch::PrintDataTo(StringStream* stream) { |
265 stream->Add("if has_cached_array_index("); | 250 stream->Add("if has_cached_array_index("); |
266 InputAt(0)->PrintTo(stream); | 251 InputAt(0)->PrintTo(stream); |
(...skipping 1239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1506 } | 1491 } |
1507 | 1492 |
1508 | 1493 |
1509 LInstruction* LChunkBuilder::DoIsObjectAndBranch(HIsObjectAndBranch* instr) { | 1494 LInstruction* LChunkBuilder::DoIsObjectAndBranch(HIsObjectAndBranch* instr) { |
1510 ASSERT(instr->value()->representation().IsTagged()); | 1495 ASSERT(instr->value()->representation().IsTagged()); |
1511 LOperand* temp = TempRegister(); | 1496 LOperand* temp = TempRegister(); |
1512 return new(zone()) LIsObjectAndBranch(UseRegister(instr->value()), temp); | 1497 return new(zone()) LIsObjectAndBranch(UseRegister(instr->value()), temp); |
1513 } | 1498 } |
1514 | 1499 |
1515 | 1500 |
1516 LInstruction* LChunkBuilder::DoIsStringAndBranch(HIsStringAndBranch* instr) { | |
1517 ASSERT(instr->value()->representation().IsTagged()); | |
1518 LOperand* temp = TempRegister(); | |
1519 return new LIsStringAndBranch(UseRegister(instr->value()), temp); | |
1520 } | |
1521 | |
1522 | |
1523 LInstruction* LChunkBuilder::DoIsSmiAndBranch(HIsSmiAndBranch* instr) { | 1501 LInstruction* LChunkBuilder::DoIsSmiAndBranch(HIsSmiAndBranch* instr) { |
1524 ASSERT(instr->value()->representation().IsTagged()); | 1502 ASSERT(instr->value()->representation().IsTagged()); |
1525 return new(zone()) LIsSmiAndBranch(Use(instr->value())); | 1503 return new(zone()) LIsSmiAndBranch(Use(instr->value())); |
1526 } | 1504 } |
1527 | 1505 |
1528 | 1506 |
1529 LInstruction* LChunkBuilder::DoIsUndetectableAndBranch( | 1507 LInstruction* LChunkBuilder::DoIsUndetectableAndBranch( |
1530 HIsUndetectableAndBranch* instr) { | 1508 HIsUndetectableAndBranch* instr) { |
1531 ASSERT(instr ->value()->representation().IsTagged()); | 1509 ASSERT(instr ->value()->representation().IsTagged()); |
1532 return new(zone()) LIsUndetectableAndBranch( | 1510 return new(zone()) LIsUndetectableAndBranch( |
1533 UseRegisterAtStart(instr->value()), TempRegister()); | 1511 UseRegisterAtStart(instr->value()), TempRegister()); |
1534 } | 1512 } |
1535 | 1513 |
1536 | 1514 |
1537 LInstruction* LChunkBuilder::DoStringCompareAndBranch( | |
1538 HStringCompareAndBranch* instr) { | |
1539 ASSERT(instr->left()->representation().IsTagged()); | |
1540 ASSERT(instr->right()->representation().IsTagged()); | |
1541 LOperand* context = UseFixed(instr->context(), esi); | |
1542 LOperand* left = UseFixed(instr->left(), edx); | |
1543 LOperand* right = UseFixed(instr->right(), eax); | |
1544 | |
1545 LStringCompareAndBranch* result = new | |
1546 LStringCompareAndBranch(context, left, right); | |
1547 | |
1548 return MarkAsCall(result, instr); | |
1549 } | |
1550 | |
1551 | |
1552 LInstruction* LChunkBuilder::DoHasInstanceTypeAndBranch( | 1515 LInstruction* LChunkBuilder::DoHasInstanceTypeAndBranch( |
1553 HHasInstanceTypeAndBranch* instr) { | 1516 HHasInstanceTypeAndBranch* instr) { |
1554 ASSERT(instr->value()->representation().IsTagged()); | 1517 ASSERT(instr->value()->representation().IsTagged()); |
1555 return new(zone()) LHasInstanceTypeAndBranch( | 1518 return new(zone()) LHasInstanceTypeAndBranch( |
1556 UseRegisterAtStart(instr->value()), | 1519 UseRegisterAtStart(instr->value()), |
1557 TempRegister()); | 1520 TempRegister()); |
1558 } | 1521 } |
1559 | 1522 |
1560 | 1523 |
1561 LInstruction* LChunkBuilder::DoGetCachedArrayIndex( | 1524 LInstruction* LChunkBuilder::DoGetCachedArrayIndex( |
(...skipping 794 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2356 LOperand* key = UseOrConstantAtStart(instr->key()); | 2319 LOperand* key = UseOrConstantAtStart(instr->key()); |
2357 LOperand* object = UseOrConstantAtStart(instr->object()); | 2320 LOperand* object = UseOrConstantAtStart(instr->object()); |
2358 LIn* result = new(zone()) LIn(context, key, object); | 2321 LIn* result = new(zone()) LIn(context, key, object); |
2359 return MarkAsCall(DefineFixed(result, eax), instr); | 2322 return MarkAsCall(DefineFixed(result, eax), instr); |
2360 } | 2323 } |
2361 | 2324 |
2362 | 2325 |
2363 } } // namespace v8::internal | 2326 } } // namespace v8::internal |
2364 | 2327 |
2365 #endif // V8_TARGET_ARCH_IA32 | 2328 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |