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 11739 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
11750 // converted to a number type further up in the call chain. | 11750 // converted to a number type further up in the call chain. |
11751 ASSERT(value->IsUndefined()); | 11751 ASSERT(value->IsUndefined()); |
11752 } | 11752 } |
11753 set(index, cast_value); | 11753 set(index, cast_value); |
11754 } | 11754 } |
11755 return heap->NumberFromUint32(cast_value); | 11755 return heap->NumberFromUint32(cast_value); |
11756 } | 11756 } |
11757 | 11757 |
11758 | 11758 |
11759 MaybeObject* ExternalFloatArray::SetValue(uint32_t index, Object* value) { | 11759 MaybeObject* ExternalFloatArray::SetValue(uint32_t index, Object* value) { |
11760 float cast_value = OS::nan_value(); | 11760 float cast_value = static_cast<float>(OS::nan_value()); |
11761 Heap* heap = GetHeap(); | 11761 Heap* heap = GetHeap(); |
11762 if (index < static_cast<uint32_t>(length())) { | 11762 if (index < static_cast<uint32_t>(length())) { |
11763 if (value->IsSmi()) { | 11763 if (value->IsSmi()) { |
11764 int int_value = Smi::cast(value)->value(); | 11764 int int_value = Smi::cast(value)->value(); |
11765 cast_value = static_cast<float>(int_value); | 11765 cast_value = static_cast<float>(int_value); |
11766 } else if (value->IsHeapNumber()) { | 11766 } else if (value->IsHeapNumber()) { |
11767 double double_value = HeapNumber::cast(value)->value(); | 11767 double double_value = HeapNumber::cast(value)->value(); |
11768 cast_value = static_cast<float>(double_value); | 11768 cast_value = static_cast<float>(double_value); |
11769 } else { | 11769 } else { |
11770 // Clamp undefined to NaN (default). All other types have been | 11770 // Clamp undefined to NaN (default). All other types have been |
(...skipping 1300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
13071 if (break_point_objects()->IsUndefined()) return 0; | 13071 if (break_point_objects()->IsUndefined()) return 0; |
13072 // Single break point. | 13072 // Single break point. |
13073 if (!break_point_objects()->IsFixedArray()) return 1; | 13073 if (!break_point_objects()->IsFixedArray()) return 1; |
13074 // Multiple break points. | 13074 // Multiple break points. |
13075 return FixedArray::cast(break_point_objects())->length(); | 13075 return FixedArray::cast(break_point_objects())->length(); |
13076 } | 13076 } |
13077 #endif // ENABLE_DEBUGGER_SUPPORT | 13077 #endif // ENABLE_DEBUGGER_SUPPORT |
13078 | 13078 |
13079 | 13079 |
13080 } } // namespace v8::internal | 13080 } } // namespace v8::internal |
OLD | NEW |