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

Side by Side Diff: src/objects-inl.h

Issue 1365503005: [es6] Fix invalid ToString in implementation of ToName. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Meh! Created 5 years, 2 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
« no previous file with comments | « src/objects.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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_
OLDNEW
« no previous file with comments | « src/objects.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698