OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 17 matching lines...) Expand all Loading... |
28 #include "v8.h" | 28 #include "v8.h" |
29 | 29 |
30 #include "accessors.h" | 30 #include "accessors.h" |
31 #include "api.h" | 31 #include "api.h" |
32 #include "arguments.h" | 32 #include "arguments.h" |
33 #include "codegen.h" | 33 #include "codegen.h" |
34 #include "execution.h" | 34 #include "execution.h" |
35 #include "ic-inl.h" | 35 #include "ic-inl.h" |
36 #include "runtime.h" | 36 #include "runtime.h" |
37 #include "stub-cache.h" | 37 #include "stub-cache.h" |
| 38 #include "v8conversions.h" |
38 | 39 |
39 namespace v8 { | 40 namespace v8 { |
40 namespace internal { | 41 namespace internal { |
41 | 42 |
42 #ifdef DEBUG | 43 #ifdef DEBUG |
43 char IC::TransitionMarkFromState(IC::State state) { | 44 char IC::TransitionMarkFromState(IC::State state) { |
44 switch (state) { | 45 switch (state) { |
45 case UNINITIALIZED: return '0'; | 46 case UNINITIALIZED: return '0'; |
46 case PREMONOMORPHIC: return '.'; | 47 case PREMONOMORPHIC: return '.'; |
47 case MONOMORPHIC: return '1'; | 48 case MONOMORPHIC: return '1'; |
(...skipping 2619 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2667 if (object->IsBoolean() && is_truncating) { | 2668 if (object->IsBoolean() && is_truncating) { |
2668 // Booleans will be automatically truncated by HChange. | 2669 // Booleans will be automatically truncated by HChange. |
2669 new_kind = INT32; | 2670 new_kind = INT32; |
2670 } else if (object->IsUndefined()) { | 2671 } else if (object->IsUndefined()) { |
2671 // Undefined will be automatically truncated by HChange. | 2672 // Undefined will be automatically truncated by HChange. |
2672 new_kind = is_truncating ? INT32 : NUMBER; | 2673 new_kind = is_truncating ? INT32 : NUMBER; |
2673 } else if (object->IsSmi()) { | 2674 } else if (object->IsSmi()) { |
2674 new_kind = SMI; | 2675 new_kind = SMI; |
2675 } else if (object->IsHeapNumber()) { | 2676 } else if (object->IsHeapNumber()) { |
2676 double value = Handle<HeapNumber>::cast(object)->value(); | 2677 double value = Handle<HeapNumber>::cast(object)->value(); |
2677 new_kind = TypeInfo::IsInt32Double(value) ? INT32 : NUMBER; | 2678 new_kind = IsInt32Double(value) ? INT32 : NUMBER; |
2678 } else if (object->IsString() && op() == Token::ADD) { | 2679 } else if (object->IsString() && op() == Token::ADD) { |
2679 new_kind = STRING; | 2680 new_kind = STRING; |
2680 } | 2681 } |
2681 if (new_kind == INT32 && SmiValuesAre32Bits()) { | 2682 if (new_kind == INT32 && SmiValuesAre32Bits()) { |
2682 new_kind = NUMBER; | 2683 new_kind = NUMBER; |
2683 } | 2684 } |
2684 if (kind != NONE && | 2685 if (kind != NONE && |
2685 ((new_kind <= NUMBER && kind > NUMBER) || | 2686 ((new_kind <= NUMBER && kind > NUMBER) || |
2686 (new_kind > NUMBER && kind <= NUMBER))) { | 2687 (new_kind > NUMBER && kind <= NUMBER))) { |
2687 new_kind = GENERIC; | 2688 new_kind = GENERIC; |
(...skipping 450 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3138 #undef ADDR | 3139 #undef ADDR |
3139 }; | 3140 }; |
3140 | 3141 |
3141 | 3142 |
3142 Address IC::AddressFromUtilityId(IC::UtilityId id) { | 3143 Address IC::AddressFromUtilityId(IC::UtilityId id) { |
3143 return IC_utilities[id]; | 3144 return IC_utilities[id]; |
3144 } | 3145 } |
3145 | 3146 |
3146 | 3147 |
3147 } } // namespace v8::internal | 3148 } } // namespace v8::internal |
OLD | NEW |