Add more long benchmarks.

The added benchmarks distinguish between operations on
"big" longs (that require more than 54 bits to contain their
value) and "small" operations (that require less than 31 bits).

This patch preparses for changing GWT's / j2cl's long representation
to use pure JavaScript double values for representing small longs.
This way we won't incur the overhead of object allocation and
always dealing with 3 numbers on every long operation for
small long values.

Change-Id: I377c326ebed1bbe25dbc048f6a2e85d1b0e81c7e
diff --git a/benchmarks/src/main/java/com/google/gwt/benchmark/benchmarks/java/lang/LongAddBenchmark.gwt.xml b/benchmarks/src/main/java/com/google/gwt/benchmark/benchmarks/java/lang/LongAddBigNumbersBenchmark.gwt.xml
similarity index 85%
rename from benchmarks/src/main/java/com/google/gwt/benchmark/benchmarks/java/lang/LongAddBenchmark.gwt.xml
rename to benchmarks/src/main/java/com/google/gwt/benchmark/benchmarks/java/lang/LongAddBigNumbersBenchmark.gwt.xml
index ebdd598..bcec72a 100644
--- a/benchmarks/src/main/java/com/google/gwt/benchmark/benchmarks/java/lang/LongAddBenchmark.gwt.xml
+++ b/benchmarks/src/main/java/com/google/gwt/benchmark/benchmarks/java/lang/LongAddBigNumbersBenchmark.gwt.xml
@@ -1,5 +1,5 @@
 <!--                                                                        -->
-<!-- Copyright 2014 Google Inc.                                             -->
+<!-- Copyright 2015 Google Inc.                                             -->
 <!-- Licensed under the Apache License, Version 2.0 (the "License"); you    -->
 <!-- may not use this file except in compliance with the License. You may   -->
 <!-- may obtain a copy of the License at                                    -->
@@ -14,6 +14,6 @@
 
 <module>
   <inherits name="com.google.gwt.benchmark.benchmarks.java.lang.Lang"/>
-  <entry-point class="com.google.gwt.benchmark.benchmarks.java.lang.shared.LongAddBenchmark.EntryPoint"/>
-  <source path="shared" includes="LongAddBenchmark.java" />
-</module>
\ No newline at end of file
+  <entry-point class="com.google.gwt.benchmark.benchmarks.java.lang.shared.LongAddBigNumbersBenchmark.EntryPoint"/>
+  <source path="shared" includes="LongAddBigNumbersBenchmark.java" />
+</module>
diff --git a/benchmarks/src/main/java/com/google/gwt/benchmark/benchmarks/java/lang/LongAddBenchmarkD8.gwt.xml b/benchmarks/src/main/java/com/google/gwt/benchmark/benchmarks/java/lang/LongAddBigNumbersBenchmarkD8.gwt.xml
similarity index 91%
copy from benchmarks/src/main/java/com/google/gwt/benchmark/benchmarks/java/lang/LongAddBenchmarkD8.gwt.xml
copy to benchmarks/src/main/java/com/google/gwt/benchmark/benchmarks/java/lang/LongAddBigNumbersBenchmarkD8.gwt.xml
index feb17ce..8dff54f 100644
--- a/benchmarks/src/main/java/com/google/gwt/benchmark/benchmarks/java/lang/LongAddBenchmarkD8.gwt.xml
+++ b/benchmarks/src/main/java/com/google/gwt/benchmark/benchmarks/java/lang/LongAddBigNumbersBenchmarkD8.gwt.xml
@@ -1,5 +1,5 @@
 <!--                                                                        -->
-<!-- Copyright 2014 Google Inc.                                             -->
+<!-- Copyright 2015 Google Inc.                                             -->
 <!-- Licensed under the Apache License, Version 2.0 (the "License"); you    -->
 <!-- may not use this file except in compliance with the License. You may   -->
 <!-- may obtain a copy of the License at                                    -->
@@ -13,6 +13,6 @@
 <!-- limitations under the License.                                         -->
 
 <module>
-  <inherits name="com.google.gwt.benchmark.benchmarks.java.lang.LongAddBenchmark"/>
+  <inherits name="com.google.gwt.benchmark.benchmarks.java.lang.LongAddBigNumbersBenchmark"/>
   <inherits name="com.google.gwt.benchmark.d8.D8"/>
-</module>
\ No newline at end of file
+</module>
diff --git a/benchmarks/src/main/java/com/google/gwt/benchmark/benchmarks/java/lang/LongAddBenchmark.gwt.xml b/benchmarks/src/main/java/com/google/gwt/benchmark/benchmarks/java/lang/LongAddSmallNumbersBenchmark.gwt.xml
similarity index 85%
copy from benchmarks/src/main/java/com/google/gwt/benchmark/benchmarks/java/lang/LongAddBenchmark.gwt.xml
copy to benchmarks/src/main/java/com/google/gwt/benchmark/benchmarks/java/lang/LongAddSmallNumbersBenchmark.gwt.xml
index ebdd598..13e600f 100644
--- a/benchmarks/src/main/java/com/google/gwt/benchmark/benchmarks/java/lang/LongAddBenchmark.gwt.xml
+++ b/benchmarks/src/main/java/com/google/gwt/benchmark/benchmarks/java/lang/LongAddSmallNumbersBenchmark.gwt.xml
@@ -1,5 +1,5 @@
 <!--                                                                        -->
-<!-- Copyright 2014 Google Inc.                                             -->
+<!-- Copyright 2015 Google Inc.                                             -->
 <!-- Licensed under the Apache License, Version 2.0 (the "License"); you    -->
 <!-- may not use this file except in compliance with the License. You may   -->
 <!-- may obtain a copy of the License at                                    -->
@@ -14,6 +14,6 @@
 
 <module>
   <inherits name="com.google.gwt.benchmark.benchmarks.java.lang.Lang"/>
-  <entry-point class="com.google.gwt.benchmark.benchmarks.java.lang.shared.LongAddBenchmark.EntryPoint"/>
-  <source path="shared" includes="LongAddBenchmark.java" />
-</module>
\ No newline at end of file
+  <entry-point class="com.google.gwt.benchmark.benchmarks.java.lang.shared.LongAddSmallNumbersBenchmark.EntryPoint"/>
+  <source path="shared" includes="LongAddSmallNumbersBenchmark.java" />
+</module>
diff --git a/benchmarks/src/main/java/com/google/gwt/benchmark/benchmarks/java/lang/LongAddBenchmarkD8.gwt.xml b/benchmarks/src/main/java/com/google/gwt/benchmark/benchmarks/java/lang/LongAddSmallNumbersBenchmarkD8.gwt.xml
similarity index 91%
copy from benchmarks/src/main/java/com/google/gwt/benchmark/benchmarks/java/lang/LongAddBenchmarkD8.gwt.xml
copy to benchmarks/src/main/java/com/google/gwt/benchmark/benchmarks/java/lang/LongAddSmallNumbersBenchmarkD8.gwt.xml
index feb17ce..9cd4507 100644
--- a/benchmarks/src/main/java/com/google/gwt/benchmark/benchmarks/java/lang/LongAddBenchmarkD8.gwt.xml
+++ b/benchmarks/src/main/java/com/google/gwt/benchmark/benchmarks/java/lang/LongAddSmallNumbersBenchmarkD8.gwt.xml
@@ -1,5 +1,5 @@
 <!--                                                                        -->
-<!-- Copyright 2014 Google Inc.                                             -->
+<!-- Copyright 2015 Google Inc.                                             -->
 <!-- Licensed under the Apache License, Version 2.0 (the "License"); you    -->
 <!-- may not use this file except in compliance with the License. You may   -->
 <!-- may obtain a copy of the License at                                    -->
@@ -13,6 +13,6 @@
 <!-- limitations under the License.                                         -->
 
 <module>
-  <inherits name="com.google.gwt.benchmark.benchmarks.java.lang.LongAddBenchmark"/>
+  <inherits name="com.google.gwt.benchmark.benchmarks.java.lang.LongAddSmallNumbersBenchmark"/>
   <inherits name="com.google.gwt.benchmark.d8.D8"/>
-</module>
\ No newline at end of file
+</module>
diff --git a/benchmarks/src/main/java/com/google/gwt/benchmark/benchmarks/java/lang/LongAddBenchmark.gwt.xml b/benchmarks/src/main/java/com/google/gwt/benchmark/benchmarks/java/lang/LongDivisionBigNumbersBenchmark.gwt.xml
similarity index 85%
copy from benchmarks/src/main/java/com/google/gwt/benchmark/benchmarks/java/lang/LongAddBenchmark.gwt.xml
copy to benchmarks/src/main/java/com/google/gwt/benchmark/benchmarks/java/lang/LongDivisionBigNumbersBenchmark.gwt.xml
index ebdd598..0c4e248 100644
--- a/benchmarks/src/main/java/com/google/gwt/benchmark/benchmarks/java/lang/LongAddBenchmark.gwt.xml
+++ b/benchmarks/src/main/java/com/google/gwt/benchmark/benchmarks/java/lang/LongDivisionBigNumbersBenchmark.gwt.xml
@@ -1,5 +1,5 @@
 <!--                                                                        -->
-<!-- Copyright 2014 Google Inc.                                             -->
+<!-- Copyright 2015 Google Inc.                                             -->
 <!-- Licensed under the Apache License, Version 2.0 (the "License"); you    -->
 <!-- may not use this file except in compliance with the License. You may   -->
 <!-- may obtain a copy of the License at                                    -->
@@ -14,6 +14,6 @@
 
 <module>
   <inherits name="com.google.gwt.benchmark.benchmarks.java.lang.Lang"/>
-  <entry-point class="com.google.gwt.benchmark.benchmarks.java.lang.shared.LongAddBenchmark.EntryPoint"/>
-  <source path="shared" includes="LongAddBenchmark.java" />
-</module>
\ No newline at end of file
+  <entry-point class="com.google.gwt.benchmark.benchmarks.java.lang.shared.LongDivisionBigNumbersBenchmark.EntryPoint"/>
+  <source path="shared" includes="LongDivisionBigNumbersBenchmark.java" />
+</module>
diff --git a/benchmarks/src/main/java/com/google/gwt/benchmark/benchmarks/java/lang/LongAddBenchmarkD8.gwt.xml b/benchmarks/src/main/java/com/google/gwt/benchmark/benchmarks/java/lang/LongDivisionBigNumbersBenchmarkD8.gwt.xml
similarity index 91%
copy from benchmarks/src/main/java/com/google/gwt/benchmark/benchmarks/java/lang/LongAddBenchmarkD8.gwt.xml
copy to benchmarks/src/main/java/com/google/gwt/benchmark/benchmarks/java/lang/LongDivisionBigNumbersBenchmarkD8.gwt.xml
index feb17ce..d75a0db 100644
--- a/benchmarks/src/main/java/com/google/gwt/benchmark/benchmarks/java/lang/LongAddBenchmarkD8.gwt.xml
+++ b/benchmarks/src/main/java/com/google/gwt/benchmark/benchmarks/java/lang/LongDivisionBigNumbersBenchmarkD8.gwt.xml
@@ -1,5 +1,5 @@
 <!--                                                                        -->
-<!-- Copyright 2014 Google Inc.                                             -->
+<!-- Copyright 2015 Google Inc.                                             -->
 <!-- Licensed under the Apache License, Version 2.0 (the "License"); you    -->
 <!-- may not use this file except in compliance with the License. You may   -->
 <!-- may obtain a copy of the License at                                    -->
@@ -13,6 +13,6 @@
 <!-- limitations under the License.                                         -->
 
 <module>
-  <inherits name="com.google.gwt.benchmark.benchmarks.java.lang.LongAddBenchmark"/>
+  <inherits name="com.google.gwt.benchmark.benchmarks.java.lang.LongDivisionBigNumbersBenchmark"/>
   <inherits name="com.google.gwt.benchmark.d8.D8"/>
-</module>
\ No newline at end of file
+</module>
diff --git a/benchmarks/src/main/java/com/google/gwt/benchmark/benchmarks/java/lang/LongAddBenchmark.gwt.xml b/benchmarks/src/main/java/com/google/gwt/benchmark/benchmarks/java/lang/LongDivisionSmallNumbersBenchmark.gwt.xml
similarity index 84%
copy from benchmarks/src/main/java/com/google/gwt/benchmark/benchmarks/java/lang/LongAddBenchmark.gwt.xml
copy to benchmarks/src/main/java/com/google/gwt/benchmark/benchmarks/java/lang/LongDivisionSmallNumbersBenchmark.gwt.xml
index ebdd598..37c298c 100644
--- a/benchmarks/src/main/java/com/google/gwt/benchmark/benchmarks/java/lang/LongAddBenchmark.gwt.xml
+++ b/benchmarks/src/main/java/com/google/gwt/benchmark/benchmarks/java/lang/LongDivisionSmallNumbersBenchmark.gwt.xml
@@ -1,5 +1,5 @@
 <!--                                                                        -->
-<!-- Copyright 2014 Google Inc.                                             -->
+<!-- Copyright 2015 Google Inc.                                             -->
 <!-- Licensed under the Apache License, Version 2.0 (the "License"); you    -->
 <!-- may not use this file except in compliance with the License. You may   -->
 <!-- may obtain a copy of the License at                                    -->
@@ -14,6 +14,6 @@
 
 <module>
   <inherits name="com.google.gwt.benchmark.benchmarks.java.lang.Lang"/>
-  <entry-point class="com.google.gwt.benchmark.benchmarks.java.lang.shared.LongAddBenchmark.EntryPoint"/>
-  <source path="shared" includes="LongAddBenchmark.java" />
-</module>
\ No newline at end of file
+  <entry-point class="com.google.gwt.benchmark.benchmarks.java.lang.shared.LongDivisionSmallNumbersBenchmark.EntryPoint"/>
+  <source path="shared" includes="LongDivisionSmallNumbersBenchmark.java" />
+</module>
diff --git a/benchmarks/src/main/java/com/google/gwt/benchmark/benchmarks/java/lang/LongAddBenchmarkD8.gwt.xml b/benchmarks/src/main/java/com/google/gwt/benchmark/benchmarks/java/lang/LongDivisionSmallNumbersBenchmarkD8.gwt.xml
similarity index 91%
copy from benchmarks/src/main/java/com/google/gwt/benchmark/benchmarks/java/lang/LongAddBenchmarkD8.gwt.xml
copy to benchmarks/src/main/java/com/google/gwt/benchmark/benchmarks/java/lang/LongDivisionSmallNumbersBenchmarkD8.gwt.xml
index feb17ce..6cc6edc 100644
--- a/benchmarks/src/main/java/com/google/gwt/benchmark/benchmarks/java/lang/LongAddBenchmarkD8.gwt.xml
+++ b/benchmarks/src/main/java/com/google/gwt/benchmark/benchmarks/java/lang/LongDivisionSmallNumbersBenchmarkD8.gwt.xml
@@ -1,5 +1,5 @@
 <!--                                                                        -->
-<!-- Copyright 2014 Google Inc.                                             -->
+<!-- Copyright 2015 Google Inc.                                             -->
 <!-- Licensed under the Apache License, Version 2.0 (the "License"); you    -->
 <!-- may not use this file except in compliance with the License. You may   -->
 <!-- may obtain a copy of the License at                                    -->
@@ -13,6 +13,6 @@
 <!-- limitations under the License.                                         -->
 
 <module>
-  <inherits name="com.google.gwt.benchmark.benchmarks.java.lang.LongAddBenchmark"/>
+  <inherits name="com.google.gwt.benchmark.benchmarks.java.lang.LongDivisionSmallNumbersBenchmark"/>
   <inherits name="com.google.gwt.benchmark.d8.D8"/>
-</module>
\ No newline at end of file
+</module>
diff --git a/benchmarks/src/main/java/com/google/gwt/benchmark/benchmarks/java/lang/LongMultiplyBenchmark.gwt.xml b/benchmarks/src/main/java/com/google/gwt/benchmark/benchmarks/java/lang/LongMultiplyBenchmark.gwt.xml
deleted file mode 100644
index 6329266..0000000
--- a/benchmarks/src/main/java/com/google/gwt/benchmark/benchmarks/java/lang/LongMultiplyBenchmark.gwt.xml
+++ /dev/null
@@ -1,19 +0,0 @@
-<!--                                                                        -->
-<!-- Copyright 2014 Google Inc.                                             -->
-<!-- Licensed under the Apache License, Version 2.0 (the "License"); you    -->
-<!-- may not use this file except in compliance with the License. You may   -->
-<!-- may obtain a copy of the License at                                    -->
-<!--                                                                        -->
-<!-- http://www.apache.org/licenses/LICENSE-2.0                             -->
-<!--                                                                        -->
-<!-- Unless required by applicable law or agreed to in writing, software    -->
-<!-- distributed under the License is distributed on an "AS IS" BASIS,      -->
-<!-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or        -->
-<!-- implied. License for the specific language governing permissions and   -->
-<!-- limitations under the License.                                         -->
-
-<module>
-  <inherits name="com.google.gwt.benchmark.benchmarks.java.lang.Lang"/>
-  <entry-point class="com.google.gwt.benchmark.benchmarks.java.lang.shared.LongMultiplyBenchmark.EntryPoint"/>
-  <source path="shared" includes="LongMultiplyBenchmark.java" />
-</module>
\ No newline at end of file
diff --git a/benchmarks/src/main/java/com/google/gwt/benchmark/benchmarks/java/lang/LongMultiplyBenchmarkD8.gwt.xml b/benchmarks/src/main/java/com/google/gwt/benchmark/benchmarks/java/lang/LongMultiplyBenchmarkD8.gwt.xml
deleted file mode 100644
index eedb92a..0000000
--- a/benchmarks/src/main/java/com/google/gwt/benchmark/benchmarks/java/lang/LongMultiplyBenchmarkD8.gwt.xml
+++ /dev/null
@@ -1,18 +0,0 @@
-<!--                                                                        -->
-<!-- Copyright 2014 Google Inc.                                             -->
-<!-- Licensed under the Apache License, Version 2.0 (the "License"); you    -->
-<!-- may not use this file except in compliance with the License. You may   -->
-<!-- may obtain a copy of the License at                                    -->
-<!--                                                                        -->
-<!-- http://www.apache.org/licenses/LICENSE-2.0                             -->
-<!--                                                                        -->
-<!-- Unless required by applicable law or agreed to in writing, software    -->
-<!-- distributed under the License is distributed on an "AS IS" BASIS,      -->
-<!-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or        -->
-<!-- implied. License for the specific language governing permissions and   -->
-<!-- limitations under the License.                                         -->
-
-<module>
-  <inherits name="com.google.gwt.benchmark.benchmarks.java.lang.LongMultiplyBenchmark"/>
-  <inherits name="com.google.gwt.benchmark.d8.D8"/>
-</module>
\ No newline at end of file
diff --git a/benchmarks/src/main/java/com/google/gwt/benchmark/benchmarks/java/lang/LongAddBenchmark.gwt.xml b/benchmarks/src/main/java/com/google/gwt/benchmark/benchmarks/java/lang/LongMultiplyBigNumbersBenchmark.gwt.xml
similarity index 85%
copy from benchmarks/src/main/java/com/google/gwt/benchmark/benchmarks/java/lang/LongAddBenchmark.gwt.xml
copy to benchmarks/src/main/java/com/google/gwt/benchmark/benchmarks/java/lang/LongMultiplyBigNumbersBenchmark.gwt.xml
index ebdd598..f05f682 100644
--- a/benchmarks/src/main/java/com/google/gwt/benchmark/benchmarks/java/lang/LongAddBenchmark.gwt.xml
+++ b/benchmarks/src/main/java/com/google/gwt/benchmark/benchmarks/java/lang/LongMultiplyBigNumbersBenchmark.gwt.xml
@@ -1,5 +1,5 @@
 <!--                                                                        -->
-<!-- Copyright 2014 Google Inc.                                             -->
+<!-- Copyright 2015 Google Inc.                                             -->
 <!-- Licensed under the Apache License, Version 2.0 (the "License"); you    -->
 <!-- may not use this file except in compliance with the License. You may   -->
 <!-- may obtain a copy of the License at                                    -->
@@ -14,6 +14,6 @@
 
 <module>
   <inherits name="com.google.gwt.benchmark.benchmarks.java.lang.Lang"/>
-  <entry-point class="com.google.gwt.benchmark.benchmarks.java.lang.shared.LongAddBenchmark.EntryPoint"/>
-  <source path="shared" includes="LongAddBenchmark.java" />
-</module>
\ No newline at end of file
+  <entry-point class="com.google.gwt.benchmark.benchmarks.java.lang.shared.LongMultiplyBigNumbersBenchmark.EntryPoint"/>
+  <source path="shared" includes="LongMultiplyBigNumbersBenchmark.java" />
+</module>
diff --git a/benchmarks/src/main/java/com/google/gwt/benchmark/benchmarks/java/lang/LongAddBenchmarkD8.gwt.xml b/benchmarks/src/main/java/com/google/gwt/benchmark/benchmarks/java/lang/LongMultiplyBigNumbersBenchmarkD8.gwt.xml
similarity index 91%
copy from benchmarks/src/main/java/com/google/gwt/benchmark/benchmarks/java/lang/LongAddBenchmarkD8.gwt.xml
copy to benchmarks/src/main/java/com/google/gwt/benchmark/benchmarks/java/lang/LongMultiplyBigNumbersBenchmarkD8.gwt.xml
index feb17ce..46f610b 100644
--- a/benchmarks/src/main/java/com/google/gwt/benchmark/benchmarks/java/lang/LongAddBenchmarkD8.gwt.xml
+++ b/benchmarks/src/main/java/com/google/gwt/benchmark/benchmarks/java/lang/LongMultiplyBigNumbersBenchmarkD8.gwt.xml
@@ -1,5 +1,5 @@
 <!--                                                                        -->
-<!-- Copyright 2014 Google Inc.                                             -->
+<!-- Copyright 2015 Google Inc.                                             -->
 <!-- Licensed under the Apache License, Version 2.0 (the "License"); you    -->
 <!-- may not use this file except in compliance with the License. You may   -->
 <!-- may obtain a copy of the License at                                    -->
@@ -13,6 +13,6 @@
 <!-- limitations under the License.                                         -->
 
 <module>
-  <inherits name="com.google.gwt.benchmark.benchmarks.java.lang.LongAddBenchmark"/>
+  <inherits name="com.google.gwt.benchmark.benchmarks.java.lang.LongMultiplyBigNumbersBenchmark"/>
   <inherits name="com.google.gwt.benchmark.d8.D8"/>
-</module>
\ No newline at end of file
+</module>
diff --git a/benchmarks/src/main/java/com/google/gwt/benchmark/benchmarks/java/lang/LongAddBenchmark.gwt.xml b/benchmarks/src/main/java/com/google/gwt/benchmark/benchmarks/java/lang/LongMultiplySmallNumbersBenchmark.gwt.xml
similarity index 84%
copy from benchmarks/src/main/java/com/google/gwt/benchmark/benchmarks/java/lang/LongAddBenchmark.gwt.xml
copy to benchmarks/src/main/java/com/google/gwt/benchmark/benchmarks/java/lang/LongMultiplySmallNumbersBenchmark.gwt.xml
index ebdd598..5083306 100644
--- a/benchmarks/src/main/java/com/google/gwt/benchmark/benchmarks/java/lang/LongAddBenchmark.gwt.xml
+++ b/benchmarks/src/main/java/com/google/gwt/benchmark/benchmarks/java/lang/LongMultiplySmallNumbersBenchmark.gwt.xml
@@ -1,5 +1,5 @@
 <!--                                                                        -->
-<!-- Copyright 2014 Google Inc.                                             -->
+<!-- Copyright 2015 Google Inc.                                             -->
 <!-- Licensed under the Apache License, Version 2.0 (the "License"); you    -->
 <!-- may not use this file except in compliance with the License. You may   -->
 <!-- may obtain a copy of the License at                                    -->
@@ -14,6 +14,6 @@
 
 <module>
   <inherits name="com.google.gwt.benchmark.benchmarks.java.lang.Lang"/>
-  <entry-point class="com.google.gwt.benchmark.benchmarks.java.lang.shared.LongAddBenchmark.EntryPoint"/>
-  <source path="shared" includes="LongAddBenchmark.java" />
-</module>
\ No newline at end of file
+  <entry-point class="com.google.gwt.benchmark.benchmarks.java.lang.shared.LongMultiplySmallNumbersBenchmark.EntryPoint"/>
+  <source path="shared" includes="LongMultiplySmallNumbersBenchmark.java" />
+</module>
diff --git a/benchmarks/src/main/java/com/google/gwt/benchmark/benchmarks/java/lang/LongAddBenchmarkD8.gwt.xml b/benchmarks/src/main/java/com/google/gwt/benchmark/benchmarks/java/lang/LongMultiplySmallNumbersBenchmarkD8.gwt.xml
similarity index 91%
copy from benchmarks/src/main/java/com/google/gwt/benchmark/benchmarks/java/lang/LongAddBenchmarkD8.gwt.xml
copy to benchmarks/src/main/java/com/google/gwt/benchmark/benchmarks/java/lang/LongMultiplySmallNumbersBenchmarkD8.gwt.xml
index feb17ce..74efce8 100644
--- a/benchmarks/src/main/java/com/google/gwt/benchmark/benchmarks/java/lang/LongAddBenchmarkD8.gwt.xml
+++ b/benchmarks/src/main/java/com/google/gwt/benchmark/benchmarks/java/lang/LongMultiplySmallNumbersBenchmarkD8.gwt.xml
@@ -1,5 +1,5 @@
 <!--                                                                        -->
-<!-- Copyright 2014 Google Inc.                                             -->
+<!-- Copyright 2015 Google Inc.                                             -->
 <!-- Licensed under the Apache License, Version 2.0 (the "License"); you    -->
 <!-- may not use this file except in compliance with the License. You may   -->
 <!-- may obtain a copy of the License at                                    -->
@@ -13,6 +13,6 @@
 <!-- limitations under the License.                                         -->
 
 <module>
-  <inherits name="com.google.gwt.benchmark.benchmarks.java.lang.LongAddBenchmark"/>
+  <inherits name="com.google.gwt.benchmark.benchmarks.java.lang.LongMultiplySmallNumbersBenchmark"/>
   <inherits name="com.google.gwt.benchmark.d8.D8"/>
-</module>
\ No newline at end of file
+</module>
diff --git a/benchmarks/src/main/java/com/google/gwt/benchmark/benchmarks/java/lang/LongAddBenchmark.gwt.xml b/benchmarks/src/main/java/com/google/gwt/benchmark/benchmarks/java/lang/LongShiftBigNumbersBenchmark.gwt.xml
similarity index 85%
copy from benchmarks/src/main/java/com/google/gwt/benchmark/benchmarks/java/lang/LongAddBenchmark.gwt.xml
copy to benchmarks/src/main/java/com/google/gwt/benchmark/benchmarks/java/lang/LongShiftBigNumbersBenchmark.gwt.xml
index ebdd598..20a7679 100644
--- a/benchmarks/src/main/java/com/google/gwt/benchmark/benchmarks/java/lang/LongAddBenchmark.gwt.xml
+++ b/benchmarks/src/main/java/com/google/gwt/benchmark/benchmarks/java/lang/LongShiftBigNumbersBenchmark.gwt.xml
@@ -1,5 +1,5 @@
 <!--                                                                        -->
-<!-- Copyright 2014 Google Inc.                                             -->
+<!-- Copyright 2015 Google Inc.                                             -->
 <!-- Licensed under the Apache License, Version 2.0 (the "License"); you    -->
 <!-- may not use this file except in compliance with the License. You may   -->
 <!-- may obtain a copy of the License at                                    -->
@@ -14,6 +14,6 @@
 
 <module>
   <inherits name="com.google.gwt.benchmark.benchmarks.java.lang.Lang"/>
-  <entry-point class="com.google.gwt.benchmark.benchmarks.java.lang.shared.LongAddBenchmark.EntryPoint"/>
-  <source path="shared" includes="LongAddBenchmark.java" />
-</module>
\ No newline at end of file
+  <entry-point class="com.google.gwt.benchmark.benchmarks.java.lang.shared.LongShiftBigNumbersBenchmark.EntryPoint"/>
+  <source path="shared" includes="LongShiftBigNumbersBenchmark.java" />
+</module>
diff --git a/benchmarks/src/main/java/com/google/gwt/benchmark/benchmarks/java/lang/LongAddBenchmarkD8.gwt.xml b/benchmarks/src/main/java/com/google/gwt/benchmark/benchmarks/java/lang/LongShiftBigNumbersBenchmarkD8.gwt.xml
similarity index 91%
rename from benchmarks/src/main/java/com/google/gwt/benchmark/benchmarks/java/lang/LongAddBenchmarkD8.gwt.xml
rename to benchmarks/src/main/java/com/google/gwt/benchmark/benchmarks/java/lang/LongShiftBigNumbersBenchmarkD8.gwt.xml
index feb17ce..1967e9c 100644
--- a/benchmarks/src/main/java/com/google/gwt/benchmark/benchmarks/java/lang/LongAddBenchmarkD8.gwt.xml
+++ b/benchmarks/src/main/java/com/google/gwt/benchmark/benchmarks/java/lang/LongShiftBigNumbersBenchmarkD8.gwt.xml
@@ -1,5 +1,5 @@
 <!--                                                                        -->
-<!-- Copyright 2014 Google Inc.                                             -->
+<!-- Copyright 2015 Google Inc.                                             -->
 <!-- Licensed under the Apache License, Version 2.0 (the "License"); you    -->
 <!-- may not use this file except in compliance with the License. You may   -->
 <!-- may obtain a copy of the License at                                    -->
@@ -13,6 +13,6 @@
 <!-- limitations under the License.                                         -->
 
 <module>
-  <inherits name="com.google.gwt.benchmark.benchmarks.java.lang.LongAddBenchmark"/>
+  <inherits name="com.google.gwt.benchmark.benchmarks.java.lang.LongShiftBigNumbersBenchmark"/>
   <inherits name="com.google.gwt.benchmark.d8.D8"/>
-</module>
\ No newline at end of file
+</module>
diff --git a/benchmarks/src/main/java/com/google/gwt/benchmark/benchmarks/java/lang/LongAddBenchmark.gwt.xml b/benchmarks/src/main/java/com/google/gwt/benchmark/benchmarks/java/lang/LongShiftSmallNumbersBenchmark.gwt.xml
similarity index 85%
copy from benchmarks/src/main/java/com/google/gwt/benchmark/benchmarks/java/lang/LongAddBenchmark.gwt.xml
copy to benchmarks/src/main/java/com/google/gwt/benchmark/benchmarks/java/lang/LongShiftSmallNumbersBenchmark.gwt.xml
index ebdd598..1d82d1a 100644
--- a/benchmarks/src/main/java/com/google/gwt/benchmark/benchmarks/java/lang/LongAddBenchmark.gwt.xml
+++ b/benchmarks/src/main/java/com/google/gwt/benchmark/benchmarks/java/lang/LongShiftSmallNumbersBenchmark.gwt.xml
@@ -1,5 +1,5 @@
 <!--                                                                        -->
-<!-- Copyright 2014 Google Inc.                                             -->
+<!-- Copyright 2015 Google Inc.                                             -->
 <!-- Licensed under the Apache License, Version 2.0 (the "License"); you    -->
 <!-- may not use this file except in compliance with the License. You may   -->
 <!-- may obtain a copy of the License at                                    -->
@@ -14,6 +14,6 @@
 
 <module>
   <inherits name="com.google.gwt.benchmark.benchmarks.java.lang.Lang"/>
-  <entry-point class="com.google.gwt.benchmark.benchmarks.java.lang.shared.LongAddBenchmark.EntryPoint"/>
-  <source path="shared" includes="LongAddBenchmark.java" />
-</module>
\ No newline at end of file
+  <entry-point class="com.google.gwt.benchmark.benchmarks.java.lang.shared.LongShiftSmallNumbersBenchmark.EntryPoint"/>
+  <source path="shared" includes="LongShiftSmallNumbersBenchmark.java" />
+</module>
diff --git a/benchmarks/src/main/java/com/google/gwt/benchmark/benchmarks/java/lang/LongAddBenchmarkD8.gwt.xml b/benchmarks/src/main/java/com/google/gwt/benchmark/benchmarks/java/lang/LongShiftSmallNumbersBenchmarkD8.gwt.xml
similarity index 91%
copy from benchmarks/src/main/java/com/google/gwt/benchmark/benchmarks/java/lang/LongAddBenchmarkD8.gwt.xml
copy to benchmarks/src/main/java/com/google/gwt/benchmark/benchmarks/java/lang/LongShiftSmallNumbersBenchmarkD8.gwt.xml
index feb17ce..9e99db0 100644
--- a/benchmarks/src/main/java/com/google/gwt/benchmark/benchmarks/java/lang/LongAddBenchmarkD8.gwt.xml
+++ b/benchmarks/src/main/java/com/google/gwt/benchmark/benchmarks/java/lang/LongShiftSmallNumbersBenchmarkD8.gwt.xml
@@ -1,5 +1,5 @@
 <!--                                                                        -->
-<!-- Copyright 2014 Google Inc.                                             -->
+<!-- Copyright 2015 Google Inc.                                             -->
 <!-- Licensed under the Apache License, Version 2.0 (the "License"); you    -->
 <!-- may not use this file except in compliance with the License. You may   -->
 <!-- may obtain a copy of the License at                                    -->
@@ -13,6 +13,6 @@
 <!-- limitations under the License.                                         -->
 
 <module>
-  <inherits name="com.google.gwt.benchmark.benchmarks.java.lang.LongAddBenchmark"/>
+  <inherits name="com.google.gwt.benchmark.benchmarks.java.lang.LongShiftSmallNumbersBenchmark"/>
   <inherits name="com.google.gwt.benchmark.d8.D8"/>
-</module>
\ No newline at end of file
+</module>
diff --git a/benchmarks/src/main/java/com/google/gwt/benchmark/benchmarks/java/lang/shared/LongAddBenchmark.java b/benchmarks/src/main/java/com/google/gwt/benchmark/benchmarks/java/lang/shared/LongAddBigNumbersBenchmark.java
similarity index 69%
rename from benchmarks/src/main/java/com/google/gwt/benchmark/benchmarks/java/lang/shared/LongAddBenchmark.java
rename to benchmarks/src/main/java/com/google/gwt/benchmark/benchmarks/java/lang/shared/LongAddBigNumbersBenchmark.java
index 531b3c4..9ac0ede 100644
--- a/benchmarks/src/main/java/com/google/gwt/benchmark/benchmarks/java/lang/shared/LongAddBenchmark.java
+++ b/benchmarks/src/main/java/com/google/gwt/benchmark/benchmarks/java/lang/shared/LongAddBigNumbersBenchmark.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2014 Google Inc.
+ * Copyright 2015 Google Inc.
  *
  * Licensed under the Apache License, Version 2.0 (the "License"); you may not
  * use this file except in compliance with the License. You may obtain a copy of
@@ -20,20 +20,25 @@
 
 /**
  * Benchmark to monitor performance for adding longs in GWT.
+ *
+ * This benchmark in particular only uses numbers that can not be represented in a double anymore
+ * (bigger than 54 bits).
  */
-public class LongAddBenchmark extends AbstractBenchmark {
+public class LongAddBigNumbersBenchmark extends AbstractBenchmark {
+
+  private static final long BITS_55 = 1L << 55;
 
   public static class EntryPoint extends AbstractBenchmarkEntryPoint {
     @Override
     protected AbstractBenchmark getBenchmark() {
-      return new LongAddBenchmark();
+      return new LongAddBigNumbersBenchmark();
     }
   }
 
   private long[] array;
 
-  public LongAddBenchmark() {
-    super("LongAdd");
+  public LongAddBigNumbersBenchmark() {
+    super("LongAddBigNumbersBenchmark");
   }
 
   @Override
@@ -43,8 +48,8 @@
       sum += array[i];
     }
 
-    if (sum != 49995000L) {
-      throw new RuntimeException();
+    if (sum != -8646911284501347320L) {
+      throw new RuntimeException("Sum should be -8646911284501347320, but is: " + sum);
     }
 
     return Long.valueOf(sum);
@@ -54,7 +59,7 @@
   public void setupOneTime() {
     array = new long[10000];
     for (int i = 0; i < array.length; i++) {
-      array[i] = i;
+      array[i] = (i + 1) + BITS_55;
     }
   }
 }
diff --git a/benchmarks/src/main/java/com/google/gwt/benchmark/benchmarks/java/lang/shared/LongAddBenchmark.java b/benchmarks/src/main/java/com/google/gwt/benchmark/benchmarks/java/lang/shared/LongAddSmallNumbersBenchmark.java
similarity index 68%
copy from benchmarks/src/main/java/com/google/gwt/benchmark/benchmarks/java/lang/shared/LongAddBenchmark.java
copy to benchmarks/src/main/java/com/google/gwt/benchmark/benchmarks/java/lang/shared/LongAddSmallNumbersBenchmark.java
index 531b3c4..56e2459 100644
--- a/benchmarks/src/main/java/com/google/gwt/benchmark/benchmarks/java/lang/shared/LongAddBenchmark.java
+++ b/benchmarks/src/main/java/com/google/gwt/benchmark/benchmarks/java/lang/shared/LongAddSmallNumbersBenchmark.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2014 Google Inc.
+ * Copyright 2015 Google Inc.
  *
  * Licensed under the Apache License, Version 2.0 (the "License"); you may not
  * use this file except in compliance with the License. You may obtain a copy of
@@ -20,20 +20,23 @@
 
 /**
  * Benchmark to monitor performance for adding longs in GWT.
+ *
+ * This benchmark in particular only uses numbers that can be represented with only 31 bits
+ * (see SMI implementation in V8).
  */
-public class LongAddBenchmark extends AbstractBenchmark {
+public class LongAddSmallNumbersBenchmark extends AbstractBenchmark {
 
   public static class EntryPoint extends AbstractBenchmarkEntryPoint {
     @Override
     protected AbstractBenchmark getBenchmark() {
-      return new LongAddBenchmark();
+      return new LongAddSmallNumbersBenchmark();
     }
   }
 
   private long[] array;
 
-  public LongAddBenchmark() {
-    super("LongAdd");
+  public LongAddSmallNumbersBenchmark() {
+    super("LongAddSmallNumbersBenchmark");
   }
 
   @Override
@@ -43,8 +46,8 @@
       sum += array[i];
     }
 
-    if (sum != 49995000L) {
-      throw new RuntimeException();
+    if (sum != -500) {
+      throw new RuntimeException("Sum should be -5000, but is: " + sum);
     }
 
     return Long.valueOf(sum);
@@ -52,9 +55,13 @@
 
   @Override
   public void setupOneTime() {
-    array = new long[10000];
+    array = new long[1000];
     for (int i = 0; i < array.length; i++) {
-      array[i] = i;
+      if (i % 2 == 0) {
+        array[i] = i;
+      } else {
+        array[i] = -i;
+      }
     }
   }
 }
diff --git a/benchmarks/src/main/java/com/google/gwt/benchmark/benchmarks/java/lang/shared/LongDivisionBigNumbersBenchmark.java b/benchmarks/src/main/java/com/google/gwt/benchmark/benchmarks/java/lang/shared/LongDivisionBigNumbersBenchmark.java
new file mode 100644
index 0000000..ad49f62
--- /dev/null
+++ b/benchmarks/src/main/java/com/google/gwt/benchmark/benchmarks/java/lang/shared/LongDivisionBigNumbersBenchmark.java
@@ -0,0 +1,69 @@
+/*
+ * Copyright 2015 Google Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package com.google.gwt.benchmark.benchmarks.java.lang.shared;
+
+import com.google.gwt.benchmark.framework.client.AbstractBenchmarkEntryPoint;
+import com.google.gwt.benchmark.framework.shared.AbstractBenchmark;
+
+/**
+ * Benchmark to monitor performance for multiplying longs in GWT.
+ *
+ * This benchmarks will only incur values that do not need more than 31 bits to be
+ * represented and thus will potentially fit in a simple JavaScript double.
+ */
+public class LongDivisionBigNumbersBenchmark extends AbstractBenchmark {
+
+  private static final long BITS_63 = 1L << 63;
+  private static final long BITS_55 = 1L << 54;
+
+  public static class EntryPoint extends AbstractBenchmarkEntryPoint {
+    @Override
+    protected AbstractBenchmark getBenchmark() {
+      return new LongDivisionBigNumbersBenchmark();
+    }
+  }
+
+  private long[] array;
+  private long[] result;
+
+  public LongDivisionBigNumbersBenchmark() {
+    super("LongDivisionBigNumbersBenchmark");
+  }
+
+  @Override
+  public Object run() {
+    for (int i = 0; i < array.length; i++) {
+      result[i] = BITS_63 / array[i];
+    }
+    if(result[0] != -9223372036854775808L) {
+      throw new RuntimeException("Expected value -9223372036854775808L but was: " + result[0]);
+    }
+
+    if(result[result.length - 1] != 20L) {
+      throw new RuntimeException("Expected value 20L but was: " + result[result.length - 1]);
+    }
+    return result;
+  }
+
+  @Override
+  public void setupOneTime() {
+    array = new long[1000];
+    result = new long[1000];
+    for (int i = 0; i < array.length; i++) {
+      array[i] = BITS_55 * i + 1;
+    }
+  }
+}
diff --git a/benchmarks/src/main/java/com/google/gwt/benchmark/benchmarks/java/lang/shared/LongDivisionSmallNumbersBenchmark.java b/benchmarks/src/main/java/com/google/gwt/benchmark/benchmarks/java/lang/shared/LongDivisionSmallNumbersBenchmark.java
new file mode 100644
index 0000000..e5d4a76
--- /dev/null
+++ b/benchmarks/src/main/java/com/google/gwt/benchmark/benchmarks/java/lang/shared/LongDivisionSmallNumbersBenchmark.java
@@ -0,0 +1,68 @@
+/*
+ * Copyright 2015 Google Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package com.google.gwt.benchmark.benchmarks.java.lang.shared;
+
+import com.google.gwt.benchmark.framework.client.AbstractBenchmarkEntryPoint;
+import com.google.gwt.benchmark.framework.shared.AbstractBenchmark;
+
+/**
+ * Benchmark to monitor performance for multiplying longs in GWT.
+ *
+ * This benchmarks will only incur values that do not need more than 31 bits to be
+ * represented and thus will potentially fit in a simple JavaScript double.
+ */
+public class LongDivisionSmallNumbersBenchmark extends AbstractBenchmark {
+
+  private static final long BITS_31 = 1L << 31;
+
+  public static class EntryPoint extends AbstractBenchmarkEntryPoint {
+    @Override
+    protected AbstractBenchmark getBenchmark() {
+      return new LongDivisionSmallNumbersBenchmark();
+    }
+  }
+
+  private long[] array;
+  private long[] result;
+
+  public LongDivisionSmallNumbersBenchmark() {
+    super("LongDivisionSmallNumbersBenchmark");
+  }
+
+  @Override
+  public Object run() {
+    for (int i = 0; i < array.length; i++) {
+      result[i] = BITS_31 / array[i];
+    }
+    if(result[0] != 2147483648L) {
+      throw new RuntimeException("Expected value 2147483648L but was: " + result[0]);
+    }
+
+    if(result[result.length - 1] != 2147483L) {
+      throw new RuntimeException("Expected value 2147483L but was: " + result[result.length - 1]);
+    }
+    return result;
+  }
+
+  @Override
+  public void setupOneTime() {
+    array = new long[1000];
+    result = new long[1000];
+    for (int i = 0; i < array.length; i++) {
+      array[i] = i + 1;
+    }
+  }
+}
diff --git a/benchmarks/src/main/java/com/google/gwt/benchmark/benchmarks/java/lang/shared/LongMultiplyBenchmark.java b/benchmarks/src/main/java/com/google/gwt/benchmark/benchmarks/java/lang/shared/LongMultiplyBenchmark.java
deleted file mode 100644
index e2cabdf..0000000
--- a/benchmarks/src/main/java/com/google/gwt/benchmark/benchmarks/java/lang/shared/LongMultiplyBenchmark.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * Copyright 2014 Google Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not
- * use this file except in compliance with the License. You may obtain a copy of
- * the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations under
- * the License.
- */
-package com.google.gwt.benchmark.benchmarks.java.lang.shared;
-
-import com.google.gwt.benchmark.framework.client.AbstractBenchmarkEntryPoint;
-import com.google.gwt.benchmark.framework.shared.AbstractBenchmark;
-
-/**
- * Benchmark to monitor performance for multiplying longs in GWT.
- */
-public class LongMultiplyBenchmark extends AbstractBenchmark {
-
-  public static class EntryPoint extends AbstractBenchmarkEntryPoint {
-    @Override
-    protected AbstractBenchmark getBenchmark() {
-      return new LongMultiplyBenchmark();
-    }
-  }
-
-  private long[] array;
-
-  public LongMultiplyBenchmark() {
-    super("LongMultiply");
-  }
-
-  @Override
-  public Object run() {
-    long product = 1;
-    for (int i = 0; i < array.length; i++) {
-      product *= array[i];
-    }
-    if(product != 7114059635456803793L) {
-      throw new RuntimeException();
-    }
-    return Long.valueOf(product);
-  }
-
-  @Override
-  public void setupOneTime() {
-    array = new long[1000];
-    for (int i = 0; i < array.length; i++) {
-      // only use odd numbers so we are not overflowing into zero.
-      array[i] = 2 * i + 1;
-    }
-  }
-}
diff --git a/benchmarks/src/main/java/com/google/gwt/benchmark/benchmarks/java/lang/shared/LongMultiplyBigNumbersBenchmark.java b/benchmarks/src/main/java/com/google/gwt/benchmark/benchmarks/java/lang/shared/LongMultiplyBigNumbersBenchmark.java
new file mode 100644
index 0000000..22c1f0e
--- /dev/null
+++ b/benchmarks/src/main/java/com/google/gwt/benchmark/benchmarks/java/lang/shared/LongMultiplyBigNumbersBenchmark.java
@@ -0,0 +1,69 @@
+/*
+ * Copyright 2015 Google Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package com.google.gwt.benchmark.benchmarks.java.lang.shared;
+
+import com.google.gwt.benchmark.framework.client.AbstractBenchmarkEntryPoint;
+import com.google.gwt.benchmark.framework.shared.AbstractBenchmark;
+
+/**
+ * Benchmark to monitor performance for multiplying longs in GWT.
+ *
+ * This benchmarks will incur values that need more than 54 bits to be
+ * represented and thus will not fit in a simple JavaScript double.
+ */
+public class LongMultiplyBigNumbersBenchmark extends AbstractBenchmark {
+
+  private static final long BITS_54 = 1L << 54;
+
+  public static class EntryPoint extends AbstractBenchmarkEntryPoint {
+    @Override
+    protected AbstractBenchmark getBenchmark() {
+      return new LongMultiplyBigNumbersBenchmark();
+    }
+  }
+
+  private long[] array;
+  private long[] result;
+
+  public LongMultiplyBigNumbersBenchmark() {
+    super("LongMultiplyBigNumbersBenchmark");
+  }
+
+  @Override
+  public Object run() {
+    for (int i = 0; i < array.length - 1; i++) {
+      result[i] = array[i] * array[i + 1];
+    }
+    if(result[0] != 54043195528445954L) {
+      throw new RuntimeException("Expected value 54043195528445954L but was: " + result[0]);
+    }
+
+    if(result[result.length - 1] != -882705526963618216L) {
+      throw new RuntimeException("Expected value -882705526963618216 but was: " + result[result.length - 1]);
+    }
+    return result;
+  }
+
+  @Override
+  public void setupOneTime() {
+    array = new long[1000];
+    result = new long[999];
+    for (int i = 0; i < array.length; i++) {
+      array[i] = i + 1 + BITS_54;
+    }
+    result[0] = 1L << 55; // to avoid reallocations in v8 since number type might change
+  }
+}
diff --git a/benchmarks/src/main/java/com/google/gwt/benchmark/benchmarks/java/lang/shared/LongMultiplySmallNumbersBenchmark.java b/benchmarks/src/main/java/com/google/gwt/benchmark/benchmarks/java/lang/shared/LongMultiplySmallNumbersBenchmark.java
new file mode 100644
index 0000000..f5301dd
--- /dev/null
+++ b/benchmarks/src/main/java/com/google/gwt/benchmark/benchmarks/java/lang/shared/LongMultiplySmallNumbersBenchmark.java
@@ -0,0 +1,66 @@
+/*
+ * Copyright 2015 Google Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package com.google.gwt.benchmark.benchmarks.java.lang.shared;
+
+import com.google.gwt.benchmark.framework.client.AbstractBenchmarkEntryPoint;
+import com.google.gwt.benchmark.framework.shared.AbstractBenchmark;
+
+/**
+ * Benchmark to monitor performance for multiplying longs in GWT.
+ *
+ * This benchmarks will only incur values that do not need more than 31 bits to be
+ * represented and thus will potentially fit in a simple JavaScript double.
+ */
+public class LongMultiplySmallNumbersBenchmark extends AbstractBenchmark {
+
+  public static class EntryPoint extends AbstractBenchmarkEntryPoint {
+    @Override
+    protected AbstractBenchmark getBenchmark() {
+      return new LongMultiplySmallNumbersBenchmark();
+    }
+  }
+
+  private long[] array;
+  private long[] result;
+
+  public LongMultiplySmallNumbersBenchmark() {
+    super("LongMultiplySmallNumbersBenchmark");
+  }
+
+  @Override
+  public Object run() {
+    for (int i = 0; i < array.length - 1; i++) {
+      result[i] = array[i] * array[i + 1];
+    }
+    if(result[0] != 2L) {
+      throw new RuntimeException("Expected value 2lL but was: " + result[0]);
+    }
+
+    if(result[result.length - 1] != 999000L) {
+      throw new RuntimeException("Expected value 999000L but was: " + result[result.length - 1]);
+    }
+    return result;
+  }
+
+  @Override
+  public void setupOneTime() {
+    array = new long[1000];
+    result = new long[999];
+    for (int i = 0; i < array.length; i++) {
+      array[i] = i + 1;
+    }
+  }
+}
diff --git a/benchmarks/src/main/java/com/google/gwt/benchmark/benchmarks/java/lang/shared/LongShiftBigNumbersBenchmark.java b/benchmarks/src/main/java/com/google/gwt/benchmark/benchmarks/java/lang/shared/LongShiftBigNumbersBenchmark.java
new file mode 100644
index 0000000..34ca60e
--- /dev/null
+++ b/benchmarks/src/main/java/com/google/gwt/benchmark/benchmarks/java/lang/shared/LongShiftBigNumbersBenchmark.java
@@ -0,0 +1,72 @@
+/*
+ * Copyright 2015 Google Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package com.google.gwt.benchmark.benchmarks.java.lang.shared;
+
+import com.google.gwt.benchmark.framework.client.AbstractBenchmarkEntryPoint;
+import com.google.gwt.benchmark.framework.shared.AbstractBenchmark;
+
+/**
+ * Benchmark to monitor performance for shifting longs in GWT.
+ *
+ * This benchmarks will incur values that need more than 54 bits to be
+ * represented and thus will not fit in a simple JavaScript double.
+ */
+public class LongShiftBigNumbersBenchmark extends AbstractBenchmark {
+
+  private static final long BITS_55 = 1L << 55;
+
+  public static class EntryPoint extends AbstractBenchmarkEntryPoint {
+    @Override
+    protected AbstractBenchmark getBenchmark() {
+      return new LongShiftBigNumbersBenchmark();
+    }
+  }
+
+  private long[] array;
+  private long[] result;
+
+  public LongShiftBigNumbersBenchmark() {
+    super("LongShiftBigNumbersBenchmark");
+  }
+
+  @Override
+  public Object run() {
+    long product = 1;
+    for (int i = 0; i < array.length; i++) {
+      result[i] = array[i] << 2;
+    }
+    if (result[0] != 144115188075855872L) {
+      throw new RuntimeException("Expected value to be 144115188075855872L, but is: " + result[0]);
+    }
+
+    if (result[result.length - 1] != 144115188075859868L) {
+      throw new RuntimeException(
+          "Expected value to be 144115188075859868, but is: " + result[result.length - 1]);
+    }
+
+    return Long.valueOf(product);
+  }
+
+  @Override
+  public void setupOneTime() {
+    array = new long[1000];
+    result = new long[1000];
+    for (int i = 0; i < array.length; i++) {
+      array[i] = BITS_55 +  i;
+      result[i] = BITS_55; // to avoid reallocations in v8 since number type might change
+    }
+  }
+}
diff --git a/benchmarks/src/main/java/com/google/gwt/benchmark/benchmarks/java/lang/shared/LongShiftSmallNumbersBenchmark.java b/benchmarks/src/main/java/com/google/gwt/benchmark/benchmarks/java/lang/shared/LongShiftSmallNumbersBenchmark.java
new file mode 100644
index 0000000..9e700ec
--- /dev/null
+++ b/benchmarks/src/main/java/com/google/gwt/benchmark/benchmarks/java/lang/shared/LongShiftSmallNumbersBenchmark.java
@@ -0,0 +1,68 @@
+/*
+ * Copyright 2015 Google Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package com.google.gwt.benchmark.benchmarks.java.lang.shared;
+
+import com.google.gwt.benchmark.framework.client.AbstractBenchmarkEntryPoint;
+import com.google.gwt.benchmark.framework.shared.AbstractBenchmark;
+
+/**
+ * Benchmark to monitor performance for shifting longs in GWT.
+ *
+ * This benchmarks will only incur values that do not need more than 31 bits to be
+ * represented and thus will potentially fit in a simple JavaScript double.
+ */
+public class LongShiftSmallNumbersBenchmark extends AbstractBenchmark {
+
+  public static class EntryPoint extends AbstractBenchmarkEntryPoint {
+    @Override
+    protected AbstractBenchmark getBenchmark() {
+      return new LongShiftSmallNumbersBenchmark();
+    }
+  }
+
+  private long[] array;
+  private long[] result;
+
+  public LongShiftSmallNumbersBenchmark() {
+    super("LongShiftSmallNumbersBenchmark");
+  }
+
+  @Override
+  public Object run() {
+    for (int i = 0; i < array.length; i++) {
+      result[i] = array[i] << 2;
+    }
+    if (result[0] != 4L) {
+      throw new RuntimeException("Expected value to be 2L, but is: " + result[0]);
+    }
+
+    if (result[result.length - 1] != 4000L) {
+      throw new RuntimeException(
+          "Expected value to be 4000L, but is: " + result[result.length - 1]);
+    }
+
+    return result;
+  }
+
+  @Override
+  public void setupOneTime() {
+    array = new long[1000];
+    for (int i = 0; i < array.length; i++) {
+      array[i] = i + 1;
+    }
+    result = new long[1000];
+  }
+}