OLD | NEW |
1 // Copyright (c) 1994-2006 Sun Microsystems Inc. | 1 // Copyright (c) 1994-2006 Sun Microsystems Inc. |
2 // All Rights Reserved. | 2 // All Rights Reserved. |
3 // | 3 // |
4 // Redistribution and use in source and binary forms, with or without | 4 // Redistribution and use in source and binary forms, with or without |
5 // modification, are permitted provided that the following conditions are | 5 // modification, are permitted provided that the following conditions are |
6 // met: | 6 // met: |
7 // | 7 // |
8 // - Redistributions of source code must retain the above copyright notice, | 8 // - Redistributions of source code must retain the above copyright notice, |
9 // this list of conditions and the following disclaimer. | 9 // this list of conditions and the following disclaimer. |
10 // | 10 // |
(...skipping 1075 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1086 ExternalReference ExternalReference::date_cache_stamp(Isolate* isolate) { | 1086 ExternalReference ExternalReference::date_cache_stamp(Isolate* isolate) { |
1087 return ExternalReference(isolate->date_cache()->stamp_address()); | 1087 return ExternalReference(isolate->date_cache()->stamp_address()); |
1088 } | 1088 } |
1089 | 1089 |
1090 | 1090 |
1091 ExternalReference ExternalReference::stress_deopt_count(Isolate* isolate) { | 1091 ExternalReference ExternalReference::stress_deopt_count(Isolate* isolate) { |
1092 return ExternalReference(isolate->stress_deopt_count_address()); | 1092 return ExternalReference(isolate->stress_deopt_count_address()); |
1093 } | 1093 } |
1094 | 1094 |
1095 | 1095 |
1096 ExternalReference ExternalReference::transcendental_cache_array_address( | |
1097 Isolate* isolate) { | |
1098 return ExternalReference( | |
1099 isolate->transcendental_cache()->cache_array_address()); | |
1100 } | |
1101 | |
1102 | |
1103 ExternalReference ExternalReference::new_deoptimizer_function( | 1096 ExternalReference ExternalReference::new_deoptimizer_function( |
1104 Isolate* isolate) { | 1097 Isolate* isolate) { |
1105 return ExternalReference( | 1098 return ExternalReference( |
1106 Redirect(isolate, FUNCTION_ADDR(Deoptimizer::New))); | 1099 Redirect(isolate, FUNCTION_ADDR(Deoptimizer::New))); |
1107 } | 1100 } |
1108 | 1101 |
1109 | 1102 |
1110 ExternalReference ExternalReference::compute_output_frames_function( | 1103 ExternalReference ExternalReference::compute_output_frames_function( |
1111 Isolate* isolate) { | 1104 Isolate* isolate) { |
1112 return ExternalReference( | 1105 return ExternalReference( |
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1388 } | 1381 } |
1389 | 1382 |
1390 ExternalReference ExternalReference::address_of_regexp_stack_memory_size( | 1383 ExternalReference ExternalReference::address_of_regexp_stack_memory_size( |
1391 Isolate* isolate) { | 1384 Isolate* isolate) { |
1392 return ExternalReference(isolate->regexp_stack()->memory_size_address()); | 1385 return ExternalReference(isolate->regexp_stack()->memory_size_address()); |
1393 } | 1386 } |
1394 | 1387 |
1395 #endif // V8_INTERPRETED_REGEXP | 1388 #endif // V8_INTERPRETED_REGEXP |
1396 | 1389 |
1397 | 1390 |
1398 static double add_two_doubles(double x, double y) { | |
1399 return x + y; | |
1400 } | |
1401 | |
1402 | |
1403 static double sub_two_doubles(double x, double y) { | |
1404 return x - y; | |
1405 } | |
1406 | |
1407 | |
1408 static double mul_two_doubles(double x, double y) { | |
1409 return x * y; | |
1410 } | |
1411 | |
1412 | |
1413 static double div_two_doubles(double x, double y) { | |
1414 return x / y; | |
1415 } | |
1416 | |
1417 | |
1418 static double mod_two_doubles(double x, double y) { | |
1419 return modulo(x, y); | |
1420 } | |
1421 | |
1422 | |
1423 static double math_log_double(double x) { | |
1424 return log(x); | |
1425 } | |
1426 | |
1427 | |
1428 ExternalReference ExternalReference::math_log_double_function( | 1391 ExternalReference ExternalReference::math_log_double_function( |
1429 Isolate* isolate) { | 1392 Isolate* isolate) { |
1430 return ExternalReference(Redirect(isolate, | 1393 return ExternalReference(Redirect(isolate, |
1431 FUNCTION_ADDR(math_log_double), | 1394 FUNCTION_ADDR(log), |
1432 BUILTIN_FP_CALL)); | 1395 BUILTIN_FP_CALL)); |
1433 } | 1396 } |
1434 | 1397 |
1435 | 1398 |
1436 ExternalReference ExternalReference::math_exp_constants(int constant_index) { | 1399 ExternalReference ExternalReference::math_exp_constants(int constant_index) { |
1437 ASSERT(math_exp_data_initialized); | 1400 ASSERT(math_exp_data_initialized); |
1438 return ExternalReference( | 1401 return ExternalReference( |
1439 reinterpret_cast<void*>(math_exp_constants_array + constant_index)); | 1402 reinterpret_cast<void*>(math_exp_constants_array + constant_index)); |
1440 } | 1403 } |
1441 | 1404 |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1526 | 1489 |
1527 | 1490 |
1528 ExternalReference ExternalReference::power_double_int_function( | 1491 ExternalReference ExternalReference::power_double_int_function( |
1529 Isolate* isolate) { | 1492 Isolate* isolate) { |
1530 return ExternalReference(Redirect(isolate, | 1493 return ExternalReference(Redirect(isolate, |
1531 FUNCTION_ADDR(power_double_int), | 1494 FUNCTION_ADDR(power_double_int), |
1532 BUILTIN_FP_INT_CALL)); | 1495 BUILTIN_FP_INT_CALL)); |
1533 } | 1496 } |
1534 | 1497 |
1535 | 1498 |
1536 static int native_compare_doubles(double y, double x) { | |
1537 if (x == y) return EQUAL; | |
1538 return x < y ? LESS : GREATER; | |
1539 } | |
1540 | |
1541 | |
1542 bool EvalComparison(Token::Value op, double op1, double op2) { | 1499 bool EvalComparison(Token::Value op, double op1, double op2) { |
1543 ASSERT(Token::IsCompareOp(op)); | 1500 ASSERT(Token::IsCompareOp(op)); |
1544 switch (op) { | 1501 switch (op) { |
1545 case Token::EQ: | 1502 case Token::EQ: |
1546 case Token::EQ_STRICT: return (op1 == op2); | 1503 case Token::EQ_STRICT: return (op1 == op2); |
1547 case Token::NE: return (op1 != op2); | 1504 case Token::NE: return (op1 != op2); |
1548 case Token::LT: return (op1 < op2); | 1505 case Token::LT: return (op1 < op2); |
1549 case Token::GT: return (op1 > op2); | 1506 case Token::GT: return (op1 > op2); |
1550 case Token::LTE: return (op1 <= op2); | 1507 case Token::LTE: return (op1 <= op2); |
1551 case Token::GTE: return (op1 >= op2); | 1508 case Token::GTE: return (op1 >= op2); |
1552 default: | 1509 default: |
1553 UNREACHABLE(); | 1510 UNREACHABLE(); |
1554 return false; | 1511 return false; |
1555 } | 1512 } |
1556 } | 1513 } |
1557 | 1514 |
1558 | 1515 |
1559 ExternalReference ExternalReference::double_fp_operation( | 1516 ExternalReference ExternalReference::mod_two_doubles_operation( |
1560 Token::Value operation, Isolate* isolate) { | 1517 Isolate* isolate) { |
1561 typedef double BinaryFPOperation(double x, double y); | |
1562 BinaryFPOperation* function = NULL; | |
1563 switch (operation) { | |
1564 case Token::ADD: | |
1565 function = &add_two_doubles; | |
1566 break; | |
1567 case Token::SUB: | |
1568 function = &sub_two_doubles; | |
1569 break; | |
1570 case Token::MUL: | |
1571 function = &mul_two_doubles; | |
1572 break; | |
1573 case Token::DIV: | |
1574 function = &div_two_doubles; | |
1575 break; | |
1576 case Token::MOD: | |
1577 function = &mod_two_doubles; | |
1578 break; | |
1579 default: | |
1580 UNREACHABLE(); | |
1581 } | |
1582 return ExternalReference(Redirect(isolate, | 1518 return ExternalReference(Redirect(isolate, |
1583 FUNCTION_ADDR(function), | 1519 FUNCTION_ADDR(modulo), |
1584 BUILTIN_FP_FP_CALL)); | 1520 BUILTIN_FP_FP_CALL)); |
1585 } | 1521 } |
1586 | 1522 |
1587 | 1523 |
1588 ExternalReference ExternalReference::compare_doubles(Isolate* isolate) { | |
1589 return ExternalReference(Redirect(isolate, | |
1590 FUNCTION_ADDR(native_compare_doubles), | |
1591 BUILTIN_COMPARE_CALL)); | |
1592 } | |
1593 | |
1594 | |
1595 #ifdef ENABLE_DEBUGGER_SUPPORT | 1524 #ifdef ENABLE_DEBUGGER_SUPPORT |
1596 ExternalReference ExternalReference::debug_break(Isolate* isolate) { | 1525 ExternalReference ExternalReference::debug_break(Isolate* isolate) { |
1597 return ExternalReference(Redirect(isolate, FUNCTION_ADDR(Debug_Break))); | 1526 return ExternalReference(Redirect(isolate, FUNCTION_ADDR(Debug_Break))); |
1598 } | 1527 } |
1599 | 1528 |
1600 | 1529 |
1601 ExternalReference ExternalReference::debug_step_in_fp_address( | 1530 ExternalReference ExternalReference::debug_step_in_fp_address( |
1602 Isolate* isolate) { | 1531 Isolate* isolate) { |
1603 return ExternalReference(isolate->debug()->step_in_fp_addr()); | 1532 return ExternalReference(isolate->debug()->step_in_fp_addr()); |
1604 } | 1533 } |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1659 assembler_->RecordRelocInfo(RelocInfo::POSITION, state_.current_position); | 1588 assembler_->RecordRelocInfo(RelocInfo::POSITION, state_.current_position); |
1660 state_.written_position = state_.current_position; | 1589 state_.written_position = state_.current_position; |
1661 written = true; | 1590 written = true; |
1662 } | 1591 } |
1663 | 1592 |
1664 // Return whether something was written. | 1593 // Return whether something was written. |
1665 return written; | 1594 return written; |
1666 } | 1595 } |
1667 | 1596 |
1668 } } // namespace v8::internal | 1597 } } // namespace v8::internal |
OLD | NEW |