| 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 2209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2220 | 2220 |
| 2221 String* str = String::cast(js_value->value()); | 2221 String* str = String::cast(js_value->value()); |
| 2222 if (index >= static_cast<uint32_t>(str->length())) return false; | 2222 if (index >= static_cast<uint32_t>(str->length())) return false; |
| 2223 | 2223 |
| 2224 return true; | 2224 return true; |
| 2225 } | 2225 } |
| 2226 | 2226 |
| 2227 | 2227 |
| 2228 void Object::VerifyApiCallResultType() { | 2228 void Object::VerifyApiCallResultType() { |
| 2229 #if DEBUG | 2229 #if DEBUG |
| 2230 if (!(IsSmi() || | 2230 if (!(IsSmi() || IsString() || IsSymbol() || IsSpecObject() || |
| 2231 IsString() || | 2231 IsHeapNumber() || IsFloat32x4() || IsUndefined() || IsTrue() || |
| 2232 IsSymbol() || | 2232 IsFalse() || IsNull())) { |
| 2233 IsSpecObject() || | |
| 2234 IsHeapNumber() || | |
| 2235 IsUndefined() || | |
| 2236 IsTrue() || | |
| 2237 IsFalse() || | |
| 2238 IsNull())) { | |
| 2239 FATAL("API call returned invalid object"); | 2233 FATAL("API call returned invalid object"); |
| 2240 } | 2234 } |
| 2241 #endif // DEBUG | 2235 #endif // DEBUG |
| 2242 } | 2236 } |
| 2243 | 2237 |
| 2244 | 2238 |
| 2245 Object* FixedArray::get(int index) const { | 2239 Object* FixedArray::get(int index) const { |
| 2246 SLOW_DCHECK(index >= 0 && index < this->length()); | 2240 SLOW_DCHECK(index >= 0 && index < this->length()); |
| 2247 return READ_FIELD(this, kHeaderSize + index * kPointerSize); | 2241 return READ_FIELD(this, kHeaderSize + index * kPointerSize); |
| 2248 } | 2242 } |
| (...skipping 5043 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7292 #undef READ_SHORT_FIELD | 7286 #undef READ_SHORT_FIELD |
| 7293 #undef WRITE_SHORT_FIELD | 7287 #undef WRITE_SHORT_FIELD |
| 7294 #undef READ_BYTE_FIELD | 7288 #undef READ_BYTE_FIELD |
| 7295 #undef WRITE_BYTE_FIELD | 7289 #undef WRITE_BYTE_FIELD |
| 7296 #undef NOBARRIER_READ_BYTE_FIELD | 7290 #undef NOBARRIER_READ_BYTE_FIELD |
| 7297 #undef NOBARRIER_WRITE_BYTE_FIELD | 7291 #undef NOBARRIER_WRITE_BYTE_FIELD |
| 7298 | 7292 |
| 7299 } } // namespace v8::internal | 7293 } } // namespace v8::internal |
| 7300 | 7294 |
| 7301 #endif // V8_OBJECTS_INL_H_ | 7295 #endif // V8_OBJECTS_INL_H_ |
| OLD | NEW |