| 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 2263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2274 | 2274 |
| 2275 String* str = String::cast(js_value->value()); | 2275 String* str = String::cast(js_value->value()); |
| 2276 if (index >= static_cast<uint32_t>(str->length())) return false; | 2276 if (index >= static_cast<uint32_t>(str->length())) return false; |
| 2277 | 2277 |
| 2278 return true; | 2278 return true; |
| 2279 } | 2279 } |
| 2280 | 2280 |
| 2281 | 2281 |
| 2282 void Object::VerifyApiCallResultType() { | 2282 void Object::VerifyApiCallResultType() { |
| 2283 #if DEBUG | 2283 #if DEBUG |
| 2284 if (!(IsSmi() || | 2284 if (!(IsSmi() || IsString() || IsSymbol() || IsSpecObject() || |
| 2285 IsString() || | 2285 IsHeapNumber() || IsFloat32x4() || IsUndefined() || IsTrue() || |
| 2286 IsSymbol() || | 2286 IsFalse() || IsNull())) { |
| 2287 IsSpecObject() || | |
| 2288 IsHeapNumber() || | |
| 2289 IsUndefined() || | |
| 2290 IsTrue() || | |
| 2291 IsFalse() || | |
| 2292 IsNull())) { | |
| 2293 FATAL("API call returned invalid object"); | 2287 FATAL("API call returned invalid object"); |
| 2294 } | 2288 } |
| 2295 #endif // DEBUG | 2289 #endif // DEBUG |
| 2296 } | 2290 } |
| 2297 | 2291 |
| 2298 | 2292 |
| 2299 Object* FixedArray::get(int index) const { | 2293 Object* FixedArray::get(int index) const { |
| 2300 SLOW_DCHECK(index >= 0 && index < this->length()); | 2294 SLOW_DCHECK(index >= 0 && index < this->length()); |
| 2301 return READ_FIELD(this, kHeaderSize + index * kPointerSize); | 2295 return READ_FIELD(this, kHeaderSize + index * kPointerSize); |
| 2302 } | 2296 } |
| (...skipping 5072 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7375 #undef READ_SHORT_FIELD | 7369 #undef READ_SHORT_FIELD |
| 7376 #undef WRITE_SHORT_FIELD | 7370 #undef WRITE_SHORT_FIELD |
| 7377 #undef READ_BYTE_FIELD | 7371 #undef READ_BYTE_FIELD |
| 7378 #undef WRITE_BYTE_FIELD | 7372 #undef WRITE_BYTE_FIELD |
| 7379 #undef NOBARRIER_READ_BYTE_FIELD | 7373 #undef NOBARRIER_READ_BYTE_FIELD |
| 7380 #undef NOBARRIER_WRITE_BYTE_FIELD | 7374 #undef NOBARRIER_WRITE_BYTE_FIELD |
| 7381 | 7375 |
| 7382 } } // namespace v8::internal | 7376 } } // namespace v8::internal |
| 7383 | 7377 |
| 7384 #endif // V8_OBJECTS_INL_H_ | 7378 #endif // V8_OBJECTS_INL_H_ |
| OLD | NEW |