OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 // Review notes: | 5 // Review notes: |
6 // | 6 // |
7 // - The use of macros in these inline functions may seem superfluous | 7 // - The use of macros in these inline functions may seem superfluous |
8 // but it is absolutely needed to make sure gcc generates optimal | 8 // but it is absolutely needed to make sure gcc generates optimal |
9 // code. gcc is not happy when attempting to inline too deep. | 9 // code. gcc is not happy when attempting to inline too deep. |
10 // | 10 // |
(...skipping 1128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1139 | 1139 |
1140 // static | 1140 // static |
1141 MaybeHandle<JSReceiver> Object::ToObject(Isolate* isolate, | 1141 MaybeHandle<JSReceiver> Object::ToObject(Isolate* isolate, |
1142 Handle<Object> object) { | 1142 Handle<Object> object) { |
1143 return ToObject( | 1143 return ToObject( |
1144 isolate, object, handle(isolate->context()->native_context(), isolate)); | 1144 isolate, object, handle(isolate->context()->native_context(), isolate)); |
1145 } | 1145 } |
1146 | 1146 |
1147 | 1147 |
1148 // static | 1148 // static |
1149 MaybeHandle<Name> Object::ToName(Isolate* isolate, Handle<Object> input) { | |
1150 if (input->IsName()) return Handle<Name>::cast(input); | |
1151 return ToString(isolate, input); | |
1152 } | |
1153 | |
1154 | |
1155 // static | |
1156 MaybeHandle<Object> Object::ToPrimitive(Handle<Object> input, | 1149 MaybeHandle<Object> Object::ToPrimitive(Handle<Object> input, |
1157 ToPrimitiveHint hint) { | 1150 ToPrimitiveHint hint) { |
1158 if (input->IsPrimitive()) return input; | 1151 if (input->IsPrimitive()) return input; |
1159 return JSReceiver::ToPrimitive(Handle<JSReceiver>::cast(input), hint); | 1152 return JSReceiver::ToPrimitive(Handle<JSReceiver>::cast(input), hint); |
1160 } | 1153 } |
1161 | 1154 |
1162 | 1155 |
1163 bool Object::HasSpecificClassOf(String* name) { | 1156 bool Object::HasSpecificClassOf(String* name) { |
1164 return this->IsJSObject() && (JSObject::cast(this)->class_name() == name); | 1157 return this->IsJSObject() && (JSObject::cast(this)->class_name() == name); |
1165 } | 1158 } |
(...skipping 6847 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8013 #undef READ_INT64_FIELD | 8006 #undef READ_INT64_FIELD |
8014 #undef WRITE_INT64_FIELD | 8007 #undef WRITE_INT64_FIELD |
8015 #undef READ_BYTE_FIELD | 8008 #undef READ_BYTE_FIELD |
8016 #undef WRITE_BYTE_FIELD | 8009 #undef WRITE_BYTE_FIELD |
8017 #undef NOBARRIER_READ_BYTE_FIELD | 8010 #undef NOBARRIER_READ_BYTE_FIELD |
8018 #undef NOBARRIER_WRITE_BYTE_FIELD | 8011 #undef NOBARRIER_WRITE_BYTE_FIELD |
8019 | 8012 |
8020 } } // namespace v8::internal | 8013 } } // namespace v8::internal |
8021 | 8014 |
8022 #endif // V8_OBJECTS_INL_H_ | 8015 #endif // V8_OBJECTS_INL_H_ |
OLD | NEW |