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 2215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2226 | 2226 |
2227 String* str = String::cast(js_value->value()); | 2227 String* str = String::cast(js_value->value()); |
2228 if (index >= static_cast<uint32_t>(str->length())) return false; | 2228 if (index >= static_cast<uint32_t>(str->length())) return false; |
2229 | 2229 |
2230 return true; | 2230 return true; |
2231 } | 2231 } |
2232 | 2232 |
2233 | 2233 |
2234 void Object::VerifyApiCallResultType() { | 2234 void Object::VerifyApiCallResultType() { |
2235 #if DEBUG | 2235 #if DEBUG |
2236 if (!(IsSmi() || | 2236 if (!(IsSmi() || IsString() || IsSymbol() || IsSpecObject() || |
2237 IsString() || | 2237 IsHeapNumber() || IsFloat32x4() || IsUndefined() || IsTrue() || |
2238 IsSymbol() || | 2238 IsFalse() || IsNull())) { |
2239 IsSpecObject() || | |
2240 IsHeapNumber() || | |
2241 IsUndefined() || | |
2242 IsTrue() || | |
2243 IsFalse() || | |
2244 IsNull())) { | |
2245 FATAL("API call returned invalid object"); | 2239 FATAL("API call returned invalid object"); |
2246 } | 2240 } |
2247 #endif // DEBUG | 2241 #endif // DEBUG |
2248 } | 2242 } |
2249 | 2243 |
2250 | 2244 |
2251 Object* FixedArray::get(int index) const { | 2245 Object* FixedArray::get(int index) const { |
2252 SLOW_DCHECK(index >= 0 && index < this->length()); | 2246 SLOW_DCHECK(index >= 0 && index < this->length()); |
2253 return READ_FIELD(this, kHeaderSize + index * kPointerSize); | 2247 return READ_FIELD(this, kHeaderSize + index * kPointerSize); |
2254 } | 2248 } |
(...skipping 5068 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7323 #undef READ_SHORT_FIELD | 7317 #undef READ_SHORT_FIELD |
7324 #undef WRITE_SHORT_FIELD | 7318 #undef WRITE_SHORT_FIELD |
7325 #undef READ_BYTE_FIELD | 7319 #undef READ_BYTE_FIELD |
7326 #undef WRITE_BYTE_FIELD | 7320 #undef WRITE_BYTE_FIELD |
7327 #undef NOBARRIER_READ_BYTE_FIELD | 7321 #undef NOBARRIER_READ_BYTE_FIELD |
7328 #undef NOBARRIER_WRITE_BYTE_FIELD | 7322 #undef NOBARRIER_WRITE_BYTE_FIELD |
7329 | 7323 |
7330 } } // namespace v8::internal | 7324 } } // namespace v8::internal |
7331 | 7325 |
7332 #endif // V8_OBJECTS_INL_H_ | 7326 #endif // V8_OBJECTS_INL_H_ |
OLD | NEW |