Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(49)

Side by Side Diff: src/property-details-inl.h

Issue 535093002: Version 3.28.71.7 (merged r23397) (Closed) Base URL: https://v8.googlecode.com/svn/branches/3.28
Patch Set: Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/property-details.h ('k') | src/version.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef V8_PROPERTY_DETAILS_INL_H_ 5 #ifndef V8_PROPERTY_DETAILS_INL_H_
6 #define V8_PROPERTY_DETAILS_INL_H_ 6 #define V8_PROPERTY_DETAILS_INL_H_
7 7
8 #include "src/conversions.h" 8 #include "src/conversions.h"
9 #include "src/objects.h" 9 #include "src/objects.h"
10 #include "src/property-details.h" 10 #include "src/property-details.h"
11 #include "src/types.h" 11 #include "src/types.h"
12 12
13 namespace v8 { 13 namespace v8 {
14 namespace internal { 14 namespace internal {
15 15
16 inline bool Representation::CanContainDouble(double value) {
17 if (IsDouble() || is_more_general_than(Representation::Double())) {
18 return true;
19 }
20 if (IsInt32Double(value)) {
21 if (IsInteger32()) return true;
22 if (IsSmi()) return Smi::IsValid(static_cast<int32_t>(value));
23 }
24 return false;
25 }
26
27
28 Representation Representation::FromType(Type* type) { 16 Representation Representation::FromType(Type* type) {
29 DisallowHeapAllocation no_allocation; 17 DisallowHeapAllocation no_allocation;
30 if (type->Is(Type::None())) return Representation::None(); 18 if (type->Is(Type::None())) return Representation::None();
31 if (type->Is(Type::SignedSmall())) return Representation::Smi(); 19 if (type->Is(Type::SignedSmall())) return Representation::Smi();
32 if (type->Is(Type::Signed32())) return Representation::Integer32(); 20 if (type->Is(Type::Signed32())) return Representation::Integer32();
33 if (type->Is(Type::Number())) return Representation::Double(); 21 if (type->Is(Type::Number())) return Representation::Double();
34 return Representation::Tagged(); 22 return Representation::Tagged();
35 } 23 }
36 24
37 } } // namespace v8::internal 25 } } // namespace v8::internal
38 26
39 #endif // V8_PROPERTY_DETAILS_INL_H_ 27 #endif // V8_PROPERTY_DETAILS_INL_H_
OLDNEW
« no previous file with comments | « src/property-details.h ('k') | src/version.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698