Chromium Code Reviews| 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 1897 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1908 HInstruction* value = Add<HLoadKeyed>(boilerplate_elements, key_constant, | 1908 HInstruction* value = Add<HLoadKeyed>(boilerplate_elements, key_constant, |
| 1909 static_cast<HValue*>(NULL), kind); | 1909 static_cast<HValue*>(NULL), kind); |
| 1910 Add<HStoreKeyed>(object_elements, key_constant, value, kind); | 1910 Add<HStoreKeyed>(object_elements, key_constant, value, kind); |
| 1911 } | 1911 } |
| 1912 } | 1912 } |
| 1913 | 1913 |
| 1914 return object; | 1914 return object; |
| 1915 } | 1915 } |
| 1916 | 1916 |
| 1917 | 1917 |
| 1918 HValue* HGraphBuilder::BuildElementIndexHash(HValue* index) { | |
|
mvstanton
2013/11/04 15:28:24
Could you update the comment in macro-assembler-X.
danno
2013/11/15 17:54:09
Done.
| |
| 1919 int32_t seed_value = static_cast<uint32_t>(isolate()->heap()->HashSeed()); | |
| 1920 HValue* seed = Add<HConstant>(seed_value); | |
| 1921 HValue* hash = Add<HBitwise>(Token::BIT_XOR, index, seed); | |
| 1922 | |
| 1923 // hash = ~hash + (hash << 15); | |
| 1924 HValue* shifted_hash = Add<HShl>(hash, Add<HConstant>(15)); | |
| 1925 HValue* not_hash = Add<HBitwise>(Token::BIT_XOR, hash, | |
| 1926 graph()->GetConstantMinus1()); | |
| 1927 hash = Add<HAdd>(shifted_hash, not_hash); | |
| 1928 | |
| 1929 // hash = hash ^ (hash >> 12); | |
| 1930 shifted_hash = Add<HShr>(hash, Add<HConstant>(12)); | |
| 1931 hash = Add<HBitwise>(Token::BIT_XOR, hash, shifted_hash); | |
| 1932 | |
| 1933 // hash = hash + (hash << 2); | |
| 1934 shifted_hash = Add<HShl>(hash, Add<HConstant>(2)); | |
| 1935 hash = Add<HAdd>(hash, shifted_hash); | |
| 1936 | |
| 1937 // hash = hash ^ (hash >> 4); | |
| 1938 shifted_hash = Add<HShr>(hash, Add<HConstant>(4)); | |
| 1939 hash = Add<HBitwise>(Token::BIT_XOR, hash, shifted_hash); | |
| 1940 | |
| 1941 // hash = hash * 2057; | |
| 1942 hash = Add<HMul>(hash, Add<HConstant>(2057)); | |
| 1943 hash->ClearFlag(HValue::kCanOverflow); | |
| 1944 | |
| 1945 // hash = hash ^ (hash >> 16); | |
| 1946 shifted_hash = Add<HShr>(hash, Add<HConstant>(16)); | |
| 1947 return Add<HBitwise>(Token::BIT_XOR, hash, shifted_hash); | |
| 1948 } | |
| 1949 | |
| 1950 | |
| 1918 void HGraphBuilder::BuildCompareNil( | 1951 void HGraphBuilder::BuildCompareNil( |
| 1919 HValue* value, | 1952 HValue* value, |
| 1920 Handle<Type> type, | 1953 Handle<Type> type, |
| 1921 HIfContinuation* continuation) { | 1954 HIfContinuation* continuation) { |
| 1922 IfBuilder if_nil(this); | 1955 IfBuilder if_nil(this); |
| 1923 bool some_case_handled = false; | 1956 bool some_case_handled = false; |
| 1924 bool some_case_missing = false; | 1957 bool some_case_missing = false; |
| 1925 | 1958 |
| 1926 if (type->Maybe(Type::Null())) { | 1959 if (type->Maybe(Type::Null())) { |
| 1927 if (some_case_handled) if_nil.Or(); | 1960 if (some_case_handled) if_nil.Or(); |
| (...skipping 7896 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 9824 if (ShouldProduceTraceOutput()) { | 9857 if (ShouldProduceTraceOutput()) { |
| 9825 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); | 9858 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); |
| 9826 } | 9859 } |
| 9827 | 9860 |
| 9828 #ifdef DEBUG | 9861 #ifdef DEBUG |
| 9829 graph_->Verify(false); // No full verify. | 9862 graph_->Verify(false); // No full verify. |
| 9830 #endif | 9863 #endif |
| 9831 } | 9864 } |
| 9832 | 9865 |
| 9833 } } // namespace v8::internal | 9866 } } // namespace v8::internal |
| OLD | NEW |