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 1058 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1069 double value = HeapNumber::cast(this)->value(); | 1069 double value = HeapNumber::cast(this)->value(); |
1070 int int_value = FastD2I(value); | 1070 int int_value = FastD2I(value); |
1071 if (value == FastI2D(int_value) && Smi::IsValid(int_value)) { | 1071 if (value == FastI2D(int_value) && Smi::IsValid(int_value)) { |
1072 return Smi::FromInt(int_value); | 1072 return Smi::FromInt(int_value); |
1073 } | 1073 } |
1074 } | 1074 } |
1075 return Failure::Exception(); | 1075 return Failure::Exception(); |
1076 } | 1076 } |
1077 | 1077 |
1078 | 1078 |
1079 Handle<JSReceiver> Object::ToObject(Isolate* isolate, Handle<Object> object) { | |
Benedikt Meurer
2014/04/14 07:30:08
Nit: Can we pass the isolate as last parameter, th
| |
1080 return ToObject( | |
1081 isolate, object, handle(isolate->context()->native_context(), isolate)); | |
1082 } | |
1083 | |
1084 | |
1079 bool Object::HasSpecificClassOf(String* name) { | 1085 bool Object::HasSpecificClassOf(String* name) { |
1080 return this->IsJSObject() && (JSObject::cast(this)->class_name() == name); | 1086 return this->IsJSObject() && (JSObject::cast(this)->class_name() == name); |
1081 } | 1087 } |
1082 | 1088 |
1083 | 1089 |
1084 MaybeHandle<Object> Object::GetProperty(Handle<Object> object, | 1090 MaybeHandle<Object> Object::GetProperty(Handle<Object> object, |
1085 Handle<Name> name) { | 1091 Handle<Name> name) { |
1086 PropertyAttributes attributes; | 1092 PropertyAttributes attributes; |
1087 return GetPropertyWithReceiver(object, object, name, &attributes); | 1093 return GetPropertyWithReceiver(object, object, name, &attributes); |
1088 } | 1094 } |
(...skipping 6011 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
7100 #undef READ_SHORT_FIELD | 7106 #undef READ_SHORT_FIELD |
7101 #undef WRITE_SHORT_FIELD | 7107 #undef WRITE_SHORT_FIELD |
7102 #undef READ_BYTE_FIELD | 7108 #undef READ_BYTE_FIELD |
7103 #undef WRITE_BYTE_FIELD | 7109 #undef WRITE_BYTE_FIELD |
7104 #undef NOBARRIER_READ_BYTE_FIELD | 7110 #undef NOBARRIER_READ_BYTE_FIELD |
7105 #undef NOBARRIER_WRITE_BYTE_FIELD | 7111 #undef NOBARRIER_WRITE_BYTE_FIELD |
7106 | 7112 |
7107 } } // namespace v8::internal | 7113 } } // namespace v8::internal |
7108 | 7114 |
7109 #endif // V8_OBJECTS_INL_H_ | 7115 #endif // V8_OBJECTS_INL_H_ |
OLD | NEW |