Bug 29395 - Broken instance method intrinsics in the JIT
Summary: Broken instance method intrinsics in the JIT
Status: VERIFIED FIXED
Alias: None
Product: Runtime
Classification: Mono
Component: JIT ()
Version: unspecified
Hardware: All All
: --- major
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2015-04-24 18:10 UTC by Alex Rønne Petersen
Modified: 2015-05-01 13:34 UTC (History)
3 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on GitHub or Developer Community with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
VERIFIED FIXED

Description Alex Rønne Petersen 2015-04-24 18:10:19 UTC
Test case 1:

```
using System;
public class Tests {
 public static void Main (String[] args) {
  string s = "ABC";
  for (int j = 0; j < 10000; ++j) {
   for (int i = 0; i < 100000; ++i) {
    char c = s [args.Length];
   }
  }
 }
}
```

Takes ~2.5 secs, takes ~0.9 secs with the fix.

Test case 2:

```
using System;
class Program {
 static int Main () {
  var s = "abcd";
  s = s.PadRight (int.MaxValue);
  for (int i = s.Length - 1; i >= 0; i -= 2048) {
   if (s [i] != ' ') {
    Console.WriteLine ("incorrect at {0}", i);
   }
  }
  return 0;
 }
}
```

This test case crashes before the fix.
Comment 2 Mohit Kheterpal 2015-04-27 14:39:48 UTC
Hi Alex,

I have tried to verify this issue but I am getting out of memory exception at line 
> s = s.PadRight (int.MaxValue); in test case 2

Could you please let me know with which build of mono should I reproduce this issue and with which version of mono should I check to verify it ?
Comment 3 Mohit Kheterpal 2015-04-28 06:00:45 UTC
I have checked the first test case and it seems that the performance is improved with the new mono i.e. MonoFramework-MDK-4.1.0.1183.macos10.xamarin.x86_a4ee723a80c30b09b63431cb6e49aaff2c4cb1d1

With old mono i.e. 4.0.0.8 : ~.87ms Screencast : http://www.screencast.com/t/g4HlZZ9V
with new mono i.e. 4.1.0.1183: ~.12ms Screencast : http://www.screencast.com/t/CLC6ph1p0

Hence closing this issue.

Thanks
Comment 4 Mohit Kheterpal 2015-05-01 13:34:05 UTC
I have checked this issue again and this issue is working fine with C5 build of Mono 4.0.1.24.

http://www.screencast.com/t/mQ0rfOvBE
Hence closing this issue.