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

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

Issue 1008004: Improve Math.round(). Fix the bug in r4146. Further improve performance by ch... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 10 years, 9 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/objects.h ('k') | src/runtime.h » ('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 2006-2008 the V8 project authors. All rights reserved. 1 // Copyright 2006-2008 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 1103 matching lines...) Expand 10 before | Expand all | Expand 10 after
1114 double HeapNumber::value() { 1114 double HeapNumber::value() {
1115 return READ_DOUBLE_FIELD(this, kValueOffset); 1115 return READ_DOUBLE_FIELD(this, kValueOffset);
1116 } 1116 }
1117 1117
1118 1118
1119 void HeapNumber::set_value(double value) { 1119 void HeapNumber::set_value(double value) {
1120 WRITE_DOUBLE_FIELD(this, kValueOffset, value); 1120 WRITE_DOUBLE_FIELD(this, kValueOffset, value);
1121 } 1121 }
1122 1122
1123 1123
1124 int HeapNumber::get_exponent() {
1125 return ((READ_INT_FIELD(this, kExponentOffset) & kExponentMask) >>
1126 kExponentShift) - kExponentBias;
1127 }
1128
1129
1130 int HeapNumber::get_sign() {
1131 return READ_INT_FIELD(this, kExponentOffset) & kSignMask;
1132 }
1133
1134
1124 ACCESSORS(JSObject, properties, FixedArray, kPropertiesOffset) 1135 ACCESSORS(JSObject, properties, FixedArray, kPropertiesOffset)
1125 1136
1126 1137
1127 Array* JSObject::elements() { 1138 Array* JSObject::elements() {
1128 Object* array = READ_FIELD(this, kElementsOffset); 1139 Object* array = READ_FIELD(this, kElementsOffset);
1129 // In the assert below Dictionary is covered under FixedArray. 1140 // In the assert below Dictionary is covered under FixedArray.
1130 ASSERT(array->IsFixedArray() || array->IsPixelArray() || 1141 ASSERT(array->IsFixedArray() || array->IsPixelArray() ||
1131 array->IsExternalArray()); 1142 array->IsExternalArray());
1132 return reinterpret_cast<Array*>(array); 1143 return reinterpret_cast<Array*>(array);
1133 } 1144 }
(...skipping 1943 matching lines...) Expand 10 before | Expand all | Expand 10 after
3077 #undef WRITE_INT_FIELD 3088 #undef WRITE_INT_FIELD
3078 #undef READ_SHORT_FIELD 3089 #undef READ_SHORT_FIELD
3079 #undef WRITE_SHORT_FIELD 3090 #undef WRITE_SHORT_FIELD
3080 #undef READ_BYTE_FIELD 3091 #undef READ_BYTE_FIELD
3081 #undef WRITE_BYTE_FIELD 3092 #undef WRITE_BYTE_FIELD
3082 3093
3083 3094
3084 } } // namespace v8::internal 3095 } } // namespace v8::internal
3085 3096
3086 #endif // V8_OBJECTS_INL_H_ 3097 #endif // V8_OBJECTS_INL_H_
OLDNEW
« no previous file with comments | « src/objects.h ('k') | src/runtime.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698