OLD | NEW |
1 // Copyright 2009 the V8 project authors. All rights reserved. | 1 // Copyright 2009 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 553 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
564 } | 564 } |
565 | 565 |
566 | 566 |
567 void FullCodeGenerator::SetSourcePosition(int pos) { | 567 void FullCodeGenerator::SetSourcePosition(int pos) { |
568 if (FLAG_debug_info && pos != RelocInfo::kNoPosition) { | 568 if (FLAG_debug_info && pos != RelocInfo::kNoPosition) { |
569 masm_->RecordPosition(pos); | 569 masm_->RecordPosition(pos); |
570 } | 570 } |
571 } | 571 } |
572 | 572 |
573 | 573 |
| 574 void FullCodeGenerator::EmitInlineRuntimeCall(CallRuntime* expr) { |
| 575 Handle<String> name = expr->name(); |
| 576 if (strcmp("_IsSmi", *name->ToCString()) == 0) { |
| 577 EmitIsSmi(expr->arguments()); |
| 578 } else if (strcmp("_IsNonNegativeSmi", *name->ToCString()) == 0) { |
| 579 EmitIsNonNegativeSmi(expr->arguments()); |
| 580 } else if (strcmp("_IsObject", *name->ToCString()) == 0) { |
| 581 EmitIsObject(expr->arguments()); |
| 582 } else if (strcmp("_IsUndetectableObject", *name->ToCString()) == 0) { |
| 583 EmitIsUndetectableObject(expr->arguments()); |
| 584 } else if (strcmp("_IsFunction", *name->ToCString()) == 0) { |
| 585 EmitIsFunction(expr->arguments()); |
| 586 } else if (strcmp("_IsArray", *name->ToCString()) == 0) { |
| 587 EmitIsArray(expr->arguments()); |
| 588 } else if (strcmp("_IsRegExp", *name->ToCString()) == 0) { |
| 589 EmitIsRegExp(expr->arguments()); |
| 590 } else if (strcmp("_IsConstructCall", *name->ToCString()) == 0) { |
| 591 EmitIsConstructCall(expr->arguments()); |
| 592 } else if (strcmp("_ObjectEquals", *name->ToCString()) == 0) { |
| 593 EmitObjectEquals(expr->arguments()); |
| 594 } else if (strcmp("_Arguments", *name->ToCString()) == 0) { |
| 595 EmitArguments(expr->arguments()); |
| 596 } else if (strcmp("_ArgumentsLength", *name->ToCString()) == 0) { |
| 597 EmitArgumentsLength(expr->arguments()); |
| 598 } else if (strcmp("_ClassOf", *name->ToCString()) == 0) { |
| 599 EmitClassOf(expr->arguments()); |
| 600 } else if (strcmp("_Log", *name->ToCString()) == 0) { |
| 601 EmitLog(expr->arguments()); |
| 602 } else if (strcmp("_RandomHeapNumber", *name->ToCString()) == 0) { |
| 603 EmitRandomHeapNumber(expr->arguments()); |
| 604 } else if (strcmp("_SubString", *name->ToCString()) == 0) { |
| 605 EmitSubString(expr->arguments()); |
| 606 } else if (strcmp("_RegExpExec", *name->ToCString()) == 0) { |
| 607 EmitRegExpExec(expr->arguments()); |
| 608 } else if (strcmp("_ValueOf", *name->ToCString()) == 0) { |
| 609 EmitValueOf(expr->arguments()); |
| 610 } else if (strcmp("_SetValueOf", *name->ToCString()) == 0) { |
| 611 EmitSetValueOf(expr->arguments()); |
| 612 } else if (strcmp("_NumberToString", *name->ToCString()) == 0) { |
| 613 EmitNumberToString(expr->arguments()); |
| 614 } else if (strcmp("_StringCharFromCode", *name->ToCString()) == 0) { |
| 615 EmitStringCharFromCode(expr->arguments()); |
| 616 } else if (strcmp("_StringCharCodeAt", *name->ToCString()) == 0) { |
| 617 EmitStringCharCodeAt(expr->arguments()); |
| 618 } else if (strcmp("_StringCharAt", *name->ToCString()) == 0) { |
| 619 EmitStringCharAt(expr->arguments()); |
| 620 } else if (strcmp("_StringAdd", *name->ToCString()) == 0) { |
| 621 EmitStringAdd(expr->arguments()); |
| 622 } else if (strcmp("_StringCompare", *name->ToCString()) == 0) { |
| 623 EmitStringCompare(expr->arguments()); |
| 624 } else if (strcmp("_MathPow", *name->ToCString()) == 0) { |
| 625 EmitMathPow(expr->arguments()); |
| 626 } else if (strcmp("_MathSin", *name->ToCString()) == 0) { |
| 627 EmitMathSin(expr->arguments()); |
| 628 } else if (strcmp("_MathCos", *name->ToCString()) == 0) { |
| 629 EmitMathCos(expr->arguments()); |
| 630 } else if (strcmp("_MathSqrt", *name->ToCString()) == 0) { |
| 631 EmitMathSqrt(expr->arguments()); |
| 632 } else if (strcmp("_CallFunction", *name->ToCString()) == 0) { |
| 633 EmitCallFunction(expr->arguments()); |
| 634 } else if (strcmp("_RegExpConstructResult", *name->ToCString()) == 0) { |
| 635 EmitRegExpConstructResult(expr->arguments()); |
| 636 } else if (strcmp("_SwapElements", *name->ToCString()) == 0) { |
| 637 EmitSwapElements(expr->arguments()); |
| 638 } else if (strcmp("_GetFromCache", *name->ToCString()) == 0) { |
| 639 EmitGetFromCache(expr->arguments()); |
| 640 } else { |
| 641 UNREACHABLE(); |
| 642 } |
| 643 } |
| 644 |
| 645 |
574 void FullCodeGenerator::EmitLogicalOperation(BinaryOperation* expr) { | 646 void FullCodeGenerator::EmitLogicalOperation(BinaryOperation* expr) { |
575 Label eval_right, done; | 647 Label eval_right, done; |
576 | 648 |
577 // Set up the appropriate context for the left subexpression based | 649 // Set up the appropriate context for the left subexpression based |
578 // on the operation and our own context. Initially assume we can | 650 // on the operation and our own context. Initially assume we can |
579 // inherit both true and false labels from our context. | 651 // inherit both true and false labels from our context. |
580 if (expr->op() == Token::OR) { | 652 if (expr->op() == Token::OR) { |
581 switch (context_) { | 653 switch (context_) { |
582 case Expression::kUninitialized: | 654 case Expression::kUninitialized: |
583 UNREACHABLE(); | 655 UNREACHABLE(); |
(...skipping 486 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1070 // The macros used here must preserve the result register. | 1142 // The macros used here must preserve the result register. |
1071 __ Drop(stack_depth); | 1143 __ Drop(stack_depth); |
1072 __ PopTryHandler(); | 1144 __ PopTryHandler(); |
1073 return 0; | 1145 return 0; |
1074 } | 1146 } |
1075 | 1147 |
1076 #undef __ | 1148 #undef __ |
1077 | 1149 |
1078 | 1150 |
1079 } } // namespace v8::internal | 1151 } } // namespace v8::internal |
OLD | NEW |