OLD | NEW |
1 // Copyright 2006-2009 the V8 project authors. All rights reserved. | 1 // Copyright 2006-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 1933 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1944 return MONOMORPHIC; | 1944 return MONOMORPHIC; |
1945 case GENERIC: | 1945 case GENERIC: |
1946 return MEGAMORPHIC; | 1946 return MEGAMORPHIC; |
1947 } | 1947 } |
1948 UNREACHABLE(); | 1948 UNREACHABLE(); |
1949 return ::v8::internal::UNINITIALIZED; | 1949 return ::v8::internal::UNINITIALIZED; |
1950 } | 1950 } |
1951 | 1951 |
1952 | 1952 |
1953 TRBinaryOpIC::TypeInfo TRBinaryOpIC::JoinTypes(TRBinaryOpIC::TypeInfo x, | 1953 TRBinaryOpIC::TypeInfo TRBinaryOpIC::JoinTypes(TRBinaryOpIC::TypeInfo x, |
1954 TRBinaryOpIC::TypeInfo y) { | 1954 TRBinaryOpIC::TypeInfo y) { |
1955 if (x == UNINITIALIZED) return y; | 1955 if (x == UNINITIALIZED) return y; |
1956 if (y == UNINITIALIZED) return x; | 1956 if (y == UNINITIALIZED) return x; |
1957 if (x == STRING && y == STRING) return STRING; | 1957 if (x == STRING && y == STRING) return STRING; |
1958 if (x == STRING || y == STRING) return GENERIC; | 1958 if (x == STRING || y == STRING) return GENERIC; |
1959 if (x >= y) return x; | 1959 if (x >= y) return x; |
1960 return y; | 1960 return y; |
1961 } | 1961 } |
1962 | 1962 |
1963 TRBinaryOpIC::TypeInfo TRBinaryOpIC::GetTypeInfo(Handle<Object> left, | 1963 TRBinaryOpIC::TypeInfo TRBinaryOpIC::GetTypeInfo(Handle<Object> left, |
1964 Handle<Object> right) { | 1964 Handle<Object> right) { |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2034 if (!code.is_null()) { | 2034 if (!code.is_null()) { |
2035 TRBinaryOpIC ic; | 2035 TRBinaryOpIC ic; |
2036 ic.patch(*code); | 2036 ic.patch(*code); |
2037 if (FLAG_trace_ic) { | 2037 if (FLAG_trace_ic) { |
2038 PrintF("[TypeRecordingBinaryOpIC (%s->(%s->%s))#%s]\n", | 2038 PrintF("[TypeRecordingBinaryOpIC (%s->(%s->%s))#%s]\n", |
2039 TRBinaryOpIC::GetName(previous_type), | 2039 TRBinaryOpIC::GetName(previous_type), |
2040 TRBinaryOpIC::GetName(type), | 2040 TRBinaryOpIC::GetName(type), |
2041 TRBinaryOpIC::GetName(result_type), | 2041 TRBinaryOpIC::GetName(result_type), |
2042 Token::Name(op)); | 2042 Token::Name(op)); |
2043 } | 2043 } |
| 2044 |
| 2045 // Activate inlined smi code. |
| 2046 if (previous_type == TRBinaryOpIC::UNINITIALIZED) { |
| 2047 ic.PatchInlinedSmiCode(ic.address()); |
| 2048 } |
2044 } | 2049 } |
2045 | 2050 |
2046 Handle<JSBuiltinsObject> builtins = Top::builtins(); | 2051 Handle<JSBuiltinsObject> builtins = Top::builtins(); |
2047 Object* builtin = NULL; // Initialization calms down the compiler. | 2052 Object* builtin = NULL; // Initialization calms down the compiler. |
2048 switch (op) { | 2053 switch (op) { |
2049 case Token::ADD: | 2054 case Token::ADD: |
2050 builtin = builtins->javascript_builtin(Builtins::ADD); | 2055 builtin = builtins->javascript_builtin(Builtins::ADD); |
2051 break; | 2056 break; |
2052 case Token::SUB: | 2057 case Token::SUB: |
2053 builtin = builtins->javascript_builtin(Builtins::SUB); | 2058 builtin = builtins->javascript_builtin(Builtins::SUB); |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2155 #undef ADDR | 2160 #undef ADDR |
2156 }; | 2161 }; |
2157 | 2162 |
2158 | 2163 |
2159 Address IC::AddressFromUtilityId(IC::UtilityId id) { | 2164 Address IC::AddressFromUtilityId(IC::UtilityId id) { |
2160 return IC_utilities[id]; | 2165 return IC_utilities[id]; |
2161 } | 2166 } |
2162 | 2167 |
2163 | 2168 |
2164 } } // namespace v8::internal | 2169 } } // namespace v8::internal |
OLD | NEW |