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

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

Issue 2625873009: [ast] Remove heap accesses from AST numbering (Closed)
Patch Set: Change climit to real_climit Created 3 years, 11 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
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 1089 matching lines...) Expand 10 before | Expand all | Expand 10 after
1100 1100
1101 bool Object::ToUint32(uint32_t* value) { 1101 bool Object::ToUint32(uint32_t* value) {
1102 if (IsSmi()) { 1102 if (IsSmi()) {
1103 int num = Smi::cast(this)->value(); 1103 int num = Smi::cast(this)->value();
1104 if (num < 0) return false; 1104 if (num < 0) return false;
1105 *value = static_cast<uint32_t>(num); 1105 *value = static_cast<uint32_t>(num);
1106 return true; 1106 return true;
1107 } 1107 }
1108 if (IsHeapNumber()) { 1108 if (IsHeapNumber()) {
1109 double num = HeapNumber::cast(this)->value(); 1109 double num = HeapNumber::cast(this)->value();
1110 if (num < 0) return false; 1110 return DoubleToUint32IfEqualToSelf(num, value);
1111 uint32_t uint_value = FastD2UI(num);
1112 if (FastUI2D(uint_value) == num) {
1113 *value = uint_value;
1114 return true;
1115 }
1116 } 1111 }
1117 return false; 1112 return false;
1118 } 1113 }
1119 1114
1120 // static 1115 // static
1121 MaybeHandle<JSReceiver> Object::ToObject(Isolate* isolate, 1116 MaybeHandle<JSReceiver> Object::ToObject(Isolate* isolate,
1122 Handle<Object> object) { 1117 Handle<Object> object) {
1123 if (object->IsJSReceiver()) return Handle<JSReceiver>::cast(object); 1118 if (object->IsJSReceiver()) return Handle<JSReceiver>::cast(object);
1124 return ToObject(isolate, object, isolate->native_context()); 1119 return ToObject(isolate, object, isolate->native_context());
1125 } 1120 }
(...skipping 7327 matching lines...) Expand 10 before | Expand all | Expand 10 after
8453 #undef WRITE_INT64_FIELD 8448 #undef WRITE_INT64_FIELD
8454 #undef READ_BYTE_FIELD 8449 #undef READ_BYTE_FIELD
8455 #undef WRITE_BYTE_FIELD 8450 #undef WRITE_BYTE_FIELD
8456 #undef NOBARRIER_READ_BYTE_FIELD 8451 #undef NOBARRIER_READ_BYTE_FIELD
8457 #undef NOBARRIER_WRITE_BYTE_FIELD 8452 #undef NOBARRIER_WRITE_BYTE_FIELD
8458 8453
8459 } // namespace internal 8454 } // namespace internal
8460 } // namespace v8 8455 } // namespace v8
8461 8456
8462 #endif // V8_OBJECTS_INL_H_ 8457 #endif // V8_OBJECTS_INL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698