 Chromium Code Reviews
 Chromium Code Reviews Issue 12490013:
  Deoptimizer support for hydrogen stubs that accept a variable number of arguments.  (Closed) 
  Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
    
  
    Issue 12490013:
  Deoptimizer support for hydrogen stubs that accept a variable number of arguments.  (Closed) 
  Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge| OLD | NEW | 
|---|---|
| 1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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 1262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1273 value = reinterpret_cast<intptr_t>( | 1273 value = reinterpret_cast<intptr_t>( | 
| 1274 Smi::FromInt(StackFrame::STUB_FAILURE_TRAMPOLINE)); | 1274 Smi::FromInt(StackFrame::STUB_FAILURE_TRAMPOLINE)); | 
| 1275 output_frame->SetFrameSlot(output_frame_offset, value); | 1275 output_frame->SetFrameSlot(output_frame_offset, value); | 
| 1276 if (trace_) { | 1276 if (trace_) { | 
| 1277 PrintF(" 0x%08" V8PRIxPTR ": [top + %d] <- 0x%08" | 1277 PrintF(" 0x%08" V8PRIxPTR ": [top + %d] <- 0x%08" | 
| 1278 V8PRIxPTR " ; function (stub failure sentinel)\n", | 1278 V8PRIxPTR " ; function (stub failure sentinel)\n", | 
| 1279 top_address + output_frame_offset, output_frame_offset, value); | 1279 top_address + output_frame_offset, output_frame_offset, value); | 
| 1280 } | 1280 } | 
| 1281 | 1281 | 
| 1282 intptr_t caller_arg_count = 0; | 1282 intptr_t caller_arg_count = 0; | 
| 1283 if (descriptor->stack_parameter_count_ != NULL) { | 1283 bool arg_count_known = descriptor->stack_parameter_count_ == NULL; | 
| 1284 caller_arg_count = | |
| 1285 input_->GetRegister(descriptor->stack_parameter_count_->code()); | |
| 1286 } | |
| 1287 | 1284 | 
| 1288 // Build the Arguments object for the caller's parameters and a pointer to it. | 1285 // Build the Arguments object for the caller's parameters and a pointer to it. | 
| 1289 output_frame_offset -= kPointerSize; | 1286 output_frame_offset -= kPointerSize; | 
| 1290 value = frame_ptr + StandardFrameConstants::kCallerSPOffset + | 1287 int args_arguments_offset = output_frame_offset; | 
| 1291 (caller_arg_count - 1) * kPointerSize; | 1288 intptr_t the_hole = reinterpret_cast<intptr_t>( | 
| 1292 output_frame->SetFrameSlot(output_frame_offset, value); | 1289 isolate_->heap()->the_hole_value()); | 
| 1290 if (arg_count_known) { | |
| 1291 value = frame_ptr + StandardFrameConstants::kCallerSPOffset + | |
| 1292 (caller_arg_count - 1) * kPointerSize; | |
| 1293 } else { | |
| 1294 value = the_hole; | |
| 1295 } | |
| 1296 | |
| 1297 output_frame->SetFrameSlot(args_arguments_offset, value); | |
| 1293 if (trace_) { | 1298 if (trace_) { | 
| 1294 PrintF(" 0x%08" V8PRIxPTR ": [top + %d] <- 0x%08" | 1299 PrintF(" 0x%08" V8PRIxPTR ": [top + %d] <- 0x%08" | 
| 1295 V8PRIxPTR " ; args.arguments\n", | 1300 V8PRIxPTR " ; args.arguments %s\n", | 
| 1296 top_address + output_frame_offset, output_frame_offset, value); | 1301 top_address + args_arguments_offset, args_arguments_offset, value, | 
| 1302 arg_count_known ? "" : "(the hole)"); | |
| 1297 } | 1303 } | 
| 1298 | 1304 | 
| 1299 output_frame_offset -= kPointerSize; | 1305 output_frame_offset -= kPointerSize; | 
| 1300 value = caller_arg_count; | 1306 int length_frame_offset = output_frame_offset; | 
| 1301 output_frame->SetFrameSlot(output_frame_offset, value); | 1307 value = arg_count_known ? caller_arg_count : the_hole; | 
| 1308 output_frame->SetFrameSlot(length_frame_offset, value); | |
| 1302 if (trace_) { | 1309 if (trace_) { | 
| 1303 PrintF(" 0x%08" V8PRIxPTR ": [top + %d] <- 0x%08" | 1310 PrintF(" 0x%08" V8PRIxPTR ": [top + %d] <- 0x%08" | 
| 1304 V8PRIxPTR " ; args.length\n", | 1311 V8PRIxPTR " ; args.length %s\n", | 
| 1305 top_address + output_frame_offset, output_frame_offset, value); | 1312 top_address + length_frame_offset, length_frame_offset, value, | 
| 1313 arg_count_known ? "" : "(the hole)"); | |
| 1306 } | 1314 } | 
| 1307 | 1315 | 
| 1308 output_frame_offset -= kPointerSize; | 1316 output_frame_offset -= kPointerSize; | 
| 1309 value = frame_ptr - (output_frame_size - output_frame_offset) - | 1317 value = frame_ptr - (output_frame_size - output_frame_offset) - | 
| 1310 StandardFrameConstants::kMarkerOffset + kPointerSize; | 1318 StandardFrameConstants::kMarkerOffset + kPointerSize; | 
| 1311 output_frame->SetFrameSlot(output_frame_offset, value); | 1319 output_frame->SetFrameSlot(output_frame_offset, value); | 
| 1312 if (trace_) { | 1320 if (trace_) { | 
| 1313 PrintF(" 0x%08" V8PRIxPTR ": [top + %d] <- 0x%08" | 1321 PrintF(" 0x%08" V8PRIxPTR ": [top + %d] <- 0x%08" | 
| 1314 V8PRIxPTR " ; args*\n", | 1322 V8PRIxPTR " ; args*\n", | 
| 1315 top_address + output_frame_offset, output_frame_offset, value); | 1323 top_address + output_frame_offset, output_frame_offset, value); | 
| 1316 } | 1324 } | 
| 1317 | 1325 | 
| 1318 // Copy the register parameters to the failure frame. | 1326 // Copy the register parameters to the failure frame. | 
| 1319 for (int i = 0; i < descriptor->register_param_count_; ++i) { | 1327 for (int i = 0; i < descriptor->register_param_count_; ++i) { | 
| 1320 output_frame_offset -= kPointerSize; | 1328 output_frame_offset -= kPointerSize; | 
| 1321 DoTranslateCommand(iterator, 0, output_frame_offset); | 1329 DoTranslateCommand(iterator, 0, output_frame_offset); | 
| 1322 } | 1330 } | 
| 1323 | 1331 | 
| 1332 if (!arg_count_known) { | |
| 1333 DoTranslateCommand(iterator, 0, length_frame_offset, | |
| 1334 TRANSLATED_VALUE_IS_NATIVE); | |
| 1335 caller_arg_count = output_frame->GetFrameSlot(length_frame_offset); | |
| 1336 value = frame_ptr + StandardFrameConstants::kCallerSPOffset + | |
| 1337 (caller_arg_count - 1) * kPointerSize; | |
| 1338 output_frame->SetFrameSlot(args_arguments_offset, value); | |
| 1339 if (trace_) { | |
| 1340 PrintF(" 0x%08" V8PRIxPTR ": [top + %d] <- 0x%08" | |
| 1341 V8PRIxPTR " ; args.arguments\n", | |
| 1342 top_address + args_arguments_offset, args_arguments_offset, value); | |
| 1343 } | |
| 1344 } | |
| 1345 | |
| 1324 ASSERT(0 == output_frame_offset); | 1346 ASSERT(0 == output_frame_offset); | 
| 1325 | 1347 | 
| 1326 // Copy the double registers from the input into the output frame. | 1348 // Copy the double registers from the input into the output frame. | 
| 1327 CopyDoubleRegisters(output_frame); | 1349 CopyDoubleRegisters(output_frame); | 
| 1328 | 1350 | 
| 1329 // Fill registers containing handler and number of parameters. | 1351 // Fill registers containing handler and number of parameters. | 
| 1330 SetPlatformCompiledStubRegisters(output_frame, descriptor); | 1352 SetPlatformCompiledStubRegisters(output_frame, descriptor); | 
| 1331 | 1353 | 
| 1332 // Compute this frame's PC, state, and continuation. | 1354 // Compute this frame's PC, state, and continuation. | 
| 1333 Code* trampoline = NULL; | 1355 Code* trampoline = NULL; | 
| 1334 int extra = descriptor->extra_expression_stack_count_; | 1356 StubFunctionMode function_mode = descriptor->function_mode_; | 
| 1335 StubFailureTrampolineStub(extra).FindCodeInCache(&trampoline, isolate_); | 1357 StubFailureTrampolineStub(function_mode).FindCodeInCache(&trampoline, | 
| 1358 isolate_); | |
| 1336 ASSERT(trampoline != NULL); | 1359 ASSERT(trampoline != NULL); | 
| 1337 output_frame->SetPc(reinterpret_cast<intptr_t>( | 1360 output_frame->SetPc(reinterpret_cast<intptr_t>( | 
| 1338 trampoline->instruction_start())); | 1361 trampoline->instruction_start())); | 
| 1339 output_frame->SetState(Smi::FromInt(FullCodeGenerator::NO_REGISTERS)); | 1362 output_frame->SetState(Smi::FromInt(FullCodeGenerator::NO_REGISTERS)); | 
| 1340 Code* notify_failure = | 1363 Code* notify_failure = | 
| 1341 isolate_->builtins()->builtin(Builtins::kNotifyStubFailure); | 1364 isolate_->builtins()->builtin(Builtins::kNotifyStubFailure); | 
| 1342 output_frame->SetContinuation( | 1365 output_frame->SetContinuation( | 
| 1343 reinterpret_cast<intptr_t>(notify_failure->entry())); | 1366 reinterpret_cast<intptr_t>(notify_failure->entry())); | 
| 1344 } | 1367 } | 
| 1345 | 1368 | 
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1469 index); | 1492 index); | 
| 1470 } | 1493 } | 
| 1471 | 1494 | 
| 1472 info->SetExpression(index, *num); | 1495 info->SetExpression(index, *num); | 
| 1473 } | 1496 } | 
| 1474 } | 1497 } | 
| 1475 } | 1498 } | 
| 1476 #endif | 1499 #endif | 
| 1477 | 1500 | 
| 1478 | 1501 | 
| 1502 static const char* TraceValueType(bool is_smi, bool is_native) { | |
| 1503 if (is_native) { | |
| 1504 return "native"; | |
| 1505 } else if (is_smi) { | |
| 1506 return "smi"; | |
| 1507 } | |
| 1508 | |
| 1509 return "heap number"; | |
| 1510 } | |
| 1511 | |
| 1512 | |
| 1479 void Deoptimizer::DoTranslateCommand(TranslationIterator* iterator, | 1513 void Deoptimizer::DoTranslateCommand(TranslationIterator* iterator, | 
| 1480 int frame_index, | 1514 int frame_index, | 
| 1481 unsigned output_offset) { | 1515 unsigned output_offset, | 
| 1516 DeoptimizerTranslatedValueType value_type) { | |
| 1482 disasm::NameConverter converter; | 1517 disasm::NameConverter converter; | 
| 1483 // A GC-safe temporary placeholder that we can put in the output frame. | 1518 // A GC-safe temporary placeholder that we can put in the output frame. | 
| 1484 const intptr_t kPlaceholder = reinterpret_cast<intptr_t>(Smi::FromInt(0)); | 1519 const intptr_t kPlaceholder = reinterpret_cast<intptr_t>(Smi::FromInt(0)); | 
| 1520 bool is_native = value_type == TRANSLATED_VALUE_IS_NATIVE; | |
| 1485 | 1521 | 
| 1486 // Ignore commands marked as duplicate and act on the first non-duplicate. | 1522 // Ignore commands marked as duplicate and act on the first non-duplicate. | 
| 1487 Translation::Opcode opcode = | 1523 Translation::Opcode opcode = | 
| 1488 static_cast<Translation::Opcode>(iterator->Next()); | 1524 static_cast<Translation::Opcode>(iterator->Next()); | 
| 1489 while (opcode == Translation::DUPLICATE) { | 1525 while (opcode == Translation::DUPLICATE) { | 
| 1490 opcode = static_cast<Translation::Opcode>(iterator->Next()); | 1526 opcode = static_cast<Translation::Opcode>(iterator->Next()); | 
| 1491 iterator->Skip(Translation::NumberOfOperandsFor(opcode)); | 1527 iterator->Skip(Translation::NumberOfOperandsFor(opcode)); | 
| 1492 opcode = static_cast<Translation::Opcode>(iterator->Next()); | 1528 opcode = static_cast<Translation::Opcode>(iterator->Next()); | 
| 1493 } | 1529 } | 
| 1494 | 1530 | 
| (...skipping 22 matching lines...) Expand all Loading... | |
| 1517 reinterpret_cast<Object*>(input_value)->ShortPrint(); | 1553 reinterpret_cast<Object*>(input_value)->ShortPrint(); | 
| 1518 PrintF("\n"); | 1554 PrintF("\n"); | 
| 1519 } | 1555 } | 
| 1520 output_[frame_index]->SetFrameSlot(output_offset, input_value); | 1556 output_[frame_index]->SetFrameSlot(output_offset, input_value); | 
| 1521 return; | 1557 return; | 
| 1522 } | 1558 } | 
| 1523 | 1559 | 
| 1524 case Translation::INT32_REGISTER: { | 1560 case Translation::INT32_REGISTER: { | 
| 1525 int input_reg = iterator->Next(); | 1561 int input_reg = iterator->Next(); | 
| 1526 intptr_t value = input_->GetRegister(input_reg); | 1562 intptr_t value = input_->GetRegister(input_reg); | 
| 1527 bool is_smi = Smi::IsValid(value); | 1563 bool is_smi = (value_type == TRANSLATED_VALUE_IS_TAGGED) && | 
| 1564 Smi::IsValid(value); | |
| 1565 | |
| 1528 if (trace_) { | 1566 if (trace_) { | 
| 1529 PrintF( | 1567 PrintF( | 
| 1530 " 0x%08" V8PRIxPTR ": [top + %d] <- %" V8PRIdPTR " ; %s (%s)\n", | 1568 " 0x%08" V8PRIxPTR ": [top + %d] <- %" V8PRIdPTR " ; %s (%s)\n", | 
| 1531 output_[frame_index]->GetTop() + output_offset, | 1569 output_[frame_index]->GetTop() + output_offset, | 
| 1532 output_offset, | 1570 output_offset, | 
| 1533 value, | 1571 value, | 
| 1534 converter.NameOfCPURegister(input_reg), | 1572 converter.NameOfCPURegister(input_reg), | 
| 1535 is_smi ? "smi" : "heap number"); | 1573 TraceValueType(is_smi, is_native)); | 
| 1536 } | 1574 } | 
| 1537 if (is_smi) { | 1575 if (is_smi) { | 
| 1538 intptr_t tagged_value = | 1576 intptr_t tagged_value = | 
| 1539 reinterpret_cast<intptr_t>(Smi::FromInt(static_cast<int>(value))); | 1577 reinterpret_cast<intptr_t>(Smi::FromInt(static_cast<int>(value))); | 
| 1540 output_[frame_index]->SetFrameSlot(output_offset, tagged_value); | 1578 output_[frame_index]->SetFrameSlot(output_offset, tagged_value); | 
| 1579 } else if (value_type == TRANSLATED_VALUE_IS_NATIVE) { | |
| 1580 output_[frame_index]->SetFrameSlot(output_offset, value); | |
| 1541 } else { | 1581 } else { | 
| 1542 // We save the untagged value on the side and store a GC-safe | 1582 // We save the untagged value on the side and store a GC-safe | 
| 
danno
2013/04/02 10:39:44
Here and below:
ASSERT here that value_type == TR
 
mvstanton
2013/04/02 11:27:25
Thanks, good idea. Done.
 | |
| 1543 // temporary placeholder in the frame. | 1583 // temporary placeholder in the frame. | 
| 1544 AddDoubleValue(output_[frame_index]->GetTop() + output_offset, | 1584 AddDoubleValue(output_[frame_index]->GetTop() + output_offset, | 
| 1545 static_cast<double>(static_cast<int32_t>(value))); | 1585 static_cast<double>(static_cast<int32_t>(value))); | 
| 1546 output_[frame_index]->SetFrameSlot(output_offset, kPlaceholder); | 1586 output_[frame_index]->SetFrameSlot(output_offset, kPlaceholder); | 
| 1547 } | 1587 } | 
| 1548 return; | 1588 return; | 
| 1549 } | 1589 } | 
| 1550 | 1590 | 
| 1551 case Translation::UINT32_REGISTER: { | 1591 case Translation::UINT32_REGISTER: { | 
| 1552 int input_reg = iterator->Next(); | 1592 int input_reg = iterator->Next(); | 
| 1553 uintptr_t value = static_cast<uintptr_t>(input_->GetRegister(input_reg)); | 1593 uintptr_t value = static_cast<uintptr_t>(input_->GetRegister(input_reg)); | 
| 1554 bool is_smi = (value <= static_cast<uintptr_t>(Smi::kMaxValue)); | 1594 bool is_smi = (value_type == TRANSLATED_VALUE_IS_TAGGED) && | 
| 1595 (value <= static_cast<uintptr_t>(Smi::kMaxValue)); | |
| 1555 if (trace_) { | 1596 if (trace_) { | 
| 1556 PrintF( | 1597 PrintF( | 
| 1557 " 0x%08" V8PRIxPTR ": [top + %d] <- %" V8PRIuPTR | 1598 " 0x%08" V8PRIxPTR ": [top + %d] <- %" V8PRIuPTR | 
| 1558 " ; uint %s (%s)\n", | 1599 " ; uint %s (%s)\n", | 
| 1559 output_[frame_index]->GetTop() + output_offset, | 1600 output_[frame_index]->GetTop() + output_offset, | 
| 1560 output_offset, | 1601 output_offset, | 
| 1561 value, | 1602 value, | 
| 1562 converter.NameOfCPURegister(input_reg), | 1603 converter.NameOfCPURegister(input_reg), | 
| 1563 is_smi ? "smi" : "heap number"); | 1604 TraceValueType(is_smi, is_native)); | 
| 1564 } | 1605 } | 
| 1565 if (is_smi) { | 1606 if (is_smi) { | 
| 1566 intptr_t tagged_value = | 1607 intptr_t tagged_value = | 
| 1567 reinterpret_cast<intptr_t>(Smi::FromInt(static_cast<int>(value))); | 1608 reinterpret_cast<intptr_t>(Smi::FromInt(static_cast<int>(value))); | 
| 1568 output_[frame_index]->SetFrameSlot(output_offset, tagged_value); | 1609 output_[frame_index]->SetFrameSlot(output_offset, tagged_value); | 
| 1610 } else if (value_type == TRANSLATED_VALUE_IS_NATIVE) { | |
| 1611 output_[frame_index]->SetFrameSlot(output_offset, value); | |
| 1569 } else { | 1612 } else { | 
| 1570 // We save the untagged value on the side and store a GC-safe | 1613 // We save the untagged value on the side and store a GC-safe | 
| 1571 // temporary placeholder in the frame. | 1614 // temporary placeholder in the frame. | 
| 1572 AddDoubleValue(output_[frame_index]->GetTop() + output_offset, | 1615 AddDoubleValue(output_[frame_index]->GetTop() + output_offset, | 
| 1573 static_cast<double>(static_cast<uint32_t>(value))); | 1616 static_cast<double>(static_cast<uint32_t>(value))); | 
| 1574 output_[frame_index]->SetFrameSlot(output_offset, kPlaceholder); | 1617 output_[frame_index]->SetFrameSlot(output_offset, kPlaceholder); | 
| 1575 } | 1618 } | 
| 1576 return; | 1619 return; | 
| 1577 } | 1620 } | 
| 1578 | 1621 | 
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1610 } | 1653 } | 
| 1611 output_[frame_index]->SetFrameSlot(output_offset, input_value); | 1654 output_[frame_index]->SetFrameSlot(output_offset, input_value); | 
| 1612 return; | 1655 return; | 
| 1613 } | 1656 } | 
| 1614 | 1657 | 
| 1615 case Translation::INT32_STACK_SLOT: { | 1658 case Translation::INT32_STACK_SLOT: { | 
| 1616 int input_slot_index = iterator->Next(); | 1659 int input_slot_index = iterator->Next(); | 
| 1617 unsigned input_offset = | 1660 unsigned input_offset = | 
| 1618 input_->GetOffsetFromSlotIndex(input_slot_index); | 1661 input_->GetOffsetFromSlotIndex(input_slot_index); | 
| 1619 intptr_t value = input_->GetFrameSlot(input_offset); | 1662 intptr_t value = input_->GetFrameSlot(input_offset); | 
| 1620 bool is_smi = Smi::IsValid(value); | 1663 bool is_smi = (value_type == TRANSLATED_VALUE_IS_TAGGED) && | 
| 1664 Smi::IsValid(value); | |
| 1621 if (trace_) { | 1665 if (trace_) { | 
| 1622 PrintF(" 0x%08" V8PRIxPTR ": ", | 1666 PrintF(" 0x%08" V8PRIxPTR ": ", | 
| 1623 output_[frame_index]->GetTop() + output_offset); | 1667 output_[frame_index]->GetTop() + output_offset); | 
| 1624 PrintF("[top + %d] <- %" V8PRIdPTR " ; [sp + %d] (%s)\n", | 1668 PrintF("[top + %d] <- %" V8PRIdPTR " ; [sp + %d] (%s)\n", | 
| 1625 output_offset, | 1669 output_offset, | 
| 1626 value, | 1670 value, | 
| 1627 input_offset, | 1671 input_offset, | 
| 1628 is_smi ? "smi" : "heap number"); | 1672 TraceValueType(is_smi, is_native)); | 
| 1629 } | 1673 } | 
| 1630 if (is_smi) { | 1674 if (is_smi) { | 
| 1631 intptr_t tagged_value = | 1675 intptr_t tagged_value = | 
| 1632 reinterpret_cast<intptr_t>(Smi::FromInt(static_cast<int>(value))); | 1676 reinterpret_cast<intptr_t>(Smi::FromInt(static_cast<int>(value))); | 
| 1633 output_[frame_index]->SetFrameSlot(output_offset, tagged_value); | 1677 output_[frame_index]->SetFrameSlot(output_offset, tagged_value); | 
| 1678 } else if (value_type == TRANSLATED_VALUE_IS_NATIVE) { | |
| 1679 output_[frame_index]->SetFrameSlot(output_offset, value); | |
| 1634 } else { | 1680 } else { | 
| 1635 // We save the untagged value on the side and store a GC-safe | 1681 // We save the untagged value on the side and store a GC-safe | 
| 1636 // temporary placeholder in the frame. | 1682 // temporary placeholder in the frame. | 
| 1637 AddDoubleValue(output_[frame_index]->GetTop() + output_offset, | 1683 AddDoubleValue(output_[frame_index]->GetTop() + output_offset, | 
| 1638 static_cast<double>(static_cast<int32_t>(value))); | 1684 static_cast<double>(static_cast<int32_t>(value))); | 
| 1639 output_[frame_index]->SetFrameSlot(output_offset, kPlaceholder); | 1685 output_[frame_index]->SetFrameSlot(output_offset, kPlaceholder); | 
| 1640 } | 1686 } | 
| 1641 return; | 1687 return; | 
| 1642 } | 1688 } | 
| 1643 | 1689 | 
| 1644 case Translation::UINT32_STACK_SLOT: { | 1690 case Translation::UINT32_STACK_SLOT: { | 
| 1645 int input_slot_index = iterator->Next(); | 1691 int input_slot_index = iterator->Next(); | 
| 1646 unsigned input_offset = | 1692 unsigned input_offset = | 
| 1647 input_->GetOffsetFromSlotIndex(input_slot_index); | 1693 input_->GetOffsetFromSlotIndex(input_slot_index); | 
| 1648 uintptr_t value = | 1694 uintptr_t value = | 
| 1649 static_cast<uintptr_t>(input_->GetFrameSlot(input_offset)); | 1695 static_cast<uintptr_t>(input_->GetFrameSlot(input_offset)); | 
| 1650 bool is_smi = (value <= static_cast<uintptr_t>(Smi::kMaxValue)); | 1696 bool is_smi = (value_type == TRANSLATED_VALUE_IS_TAGGED) && | 
| 1697 (value <= static_cast<uintptr_t>(Smi::kMaxValue)); | |
| 1651 if (trace_) { | 1698 if (trace_) { | 
| 1652 PrintF(" 0x%08" V8PRIxPTR ": ", | 1699 PrintF(" 0x%08" V8PRIxPTR ": ", | 
| 1653 output_[frame_index]->GetTop() + output_offset); | 1700 output_[frame_index]->GetTop() + output_offset); | 
| 1654 PrintF("[top + %d] <- %" V8PRIuPTR " ; [sp + %d] (uint32 %s)\n", | 1701 PrintF("[top + %d] <- %" V8PRIuPTR " ; [sp + %d] (uint32 %s)\n", | 
| 1655 output_offset, | 1702 output_offset, | 
| 1656 value, | 1703 value, | 
| 1657 input_offset, | 1704 input_offset, | 
| 1658 is_smi ? "smi" : "heap number"); | 1705 TraceValueType(is_smi, is_native)); | 
| 1659 } | 1706 } | 
| 1660 if (is_smi) { | 1707 if (is_smi) { | 
| 1661 intptr_t tagged_value = | 1708 intptr_t tagged_value = | 
| 1662 reinterpret_cast<intptr_t>(Smi::FromInt(static_cast<int>(value))); | 1709 reinterpret_cast<intptr_t>(Smi::FromInt(static_cast<int>(value))); | 
| 1663 output_[frame_index]->SetFrameSlot(output_offset, tagged_value); | 1710 output_[frame_index]->SetFrameSlot(output_offset, tagged_value); | 
| 1711 } else if (value_type == TRANSLATED_VALUE_IS_NATIVE) { | |
| 1712 output_[frame_index]->SetFrameSlot(output_offset, value); | |
| 1664 } else { | 1713 } else { | 
| 1665 // We save the untagged value on the side and store a GC-safe | 1714 // We save the untagged value on the side and store a GC-safe | 
| 1666 // temporary placeholder in the frame. | 1715 // temporary placeholder in the frame. | 
| 1667 AddDoubleValue(output_[frame_index]->GetTop() + output_offset, | 1716 AddDoubleValue(output_[frame_index]->GetTop() + output_offset, | 
| 1668 static_cast<double>(static_cast<uint32_t>(value))); | 1717 static_cast<double>(static_cast<uint32_t>(value))); | 
| 1669 output_[frame_index]->SetFrameSlot(output_offset, kPlaceholder); | 1718 output_[frame_index]->SetFrameSlot(output_offset, kPlaceholder); | 
| 1670 } | 1719 } | 
| 1671 return; | 1720 return; | 
| 1672 } | 1721 } | 
| 1673 | 1722 | 
| (...skipping 998 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2672 | 2721 | 
| 2673 void DeoptimizedFrameInfo::Iterate(ObjectVisitor* v) { | 2722 void DeoptimizedFrameInfo::Iterate(ObjectVisitor* v) { | 
| 2674 v->VisitPointer(BitCast<Object**>(&function_)); | 2723 v->VisitPointer(BitCast<Object**>(&function_)); | 
| 2675 v->VisitPointers(parameters_, parameters_ + parameters_count_); | 2724 v->VisitPointers(parameters_, parameters_ + parameters_count_); | 
| 2676 v->VisitPointers(expression_stack_, expression_stack_ + expression_count_); | 2725 v->VisitPointers(expression_stack_, expression_stack_ + expression_count_); | 
| 2677 } | 2726 } | 
| 2678 | 2727 | 
| 2679 #endif // ENABLE_DEBUGGER_SUPPORT | 2728 #endif // ENABLE_DEBUGGER_SUPPORT | 
| 2680 | 2729 | 
| 2681 } } // namespace v8::internal | 2730 } } // namespace v8::internal | 
| OLD | NEW |