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 2219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2230 if (!js_value->value()->IsString()) return false; | 2230 if (!js_value->value()->IsString()) return false; |
2231 | 2231 |
2232 String* str = String::cast(js_value->value()); | 2232 String* str = String::cast(js_value->value()); |
2233 if (index >= static_cast<uint32_t>(str->length())) return false; | 2233 if (index >= static_cast<uint32_t>(str->length())) return false; |
2234 | 2234 |
2235 return true; | 2235 return true; |
2236 } | 2236 } |
2237 | 2237 |
2238 | 2238 |
2239 void Object::VerifyApiCallResultType() { | 2239 void Object::VerifyApiCallResultType() { |
2240 #if ENABLE_EXTRA_CHECKS | 2240 #if DEBUG |
2241 if (!(IsSmi() || | 2241 if (!(IsSmi() || |
2242 IsString() || | 2242 IsString() || |
2243 IsSymbol() || | 2243 IsSymbol() || |
2244 IsSpecObject() || | 2244 IsSpecObject() || |
2245 IsHeapNumber() || | 2245 IsHeapNumber() || |
2246 IsUndefined() || | 2246 IsUndefined() || |
2247 IsTrue() || | 2247 IsTrue() || |
2248 IsFalse() || | 2248 IsFalse() || |
2249 IsNull())) { | 2249 IsNull())) { |
2250 FATAL("API call returned invalid object"); | 2250 FATAL("API call returned invalid object"); |
2251 } | 2251 } |
2252 #endif // ENABLE_EXTRA_CHECKS | 2252 #endif // DEBUG |
2253 } | 2253 } |
2254 | 2254 |
2255 | 2255 |
2256 Object* FixedArray::get(int index) const { | 2256 Object* FixedArray::get(int index) const { |
2257 SLOW_DCHECK(index >= 0 && index < this->length()); | 2257 SLOW_DCHECK(index >= 0 && index < this->length()); |
2258 return READ_FIELD(this, kHeaderSize + index * kPointerSize); | 2258 return READ_FIELD(this, kHeaderSize + index * kPointerSize); |
2259 } | 2259 } |
2260 | 2260 |
2261 | 2261 |
2262 Handle<Object> FixedArray::get(Handle<FixedArray> array, int index) { | 2262 Handle<Object> FixedArray::get(Handle<FixedArray> array, int index) { |
(...skipping 5247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7510 #undef READ_SHORT_FIELD | 7510 #undef READ_SHORT_FIELD |
7511 #undef WRITE_SHORT_FIELD | 7511 #undef WRITE_SHORT_FIELD |
7512 #undef READ_BYTE_FIELD | 7512 #undef READ_BYTE_FIELD |
7513 #undef WRITE_BYTE_FIELD | 7513 #undef WRITE_BYTE_FIELD |
7514 #undef NOBARRIER_READ_BYTE_FIELD | 7514 #undef NOBARRIER_READ_BYTE_FIELD |
7515 #undef NOBARRIER_WRITE_BYTE_FIELD | 7515 #undef NOBARRIER_WRITE_BYTE_FIELD |
7516 | 7516 |
7517 } } // namespace v8::internal | 7517 } } // namespace v8::internal |
7518 | 7518 |
7519 #endif // V8_OBJECTS_INL_H_ | 7519 #endif // V8_OBJECTS_INL_H_ |
OLD | NEW |