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 #include "src/builtins.h" | 5 #include "src/builtins.h" |
6 | 6 |
7 #include "src/api.h" | 7 #include "src/api.h" |
8 #include "src/api-natives.h" | 8 #include "src/api-natives.h" |
9 #include "src/arguments.h" | 9 #include "src/arguments.h" |
10 #include "src/base/once.h" | 10 #include "src/base/once.h" |
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
201 } | 201 } |
202 return false; | 202 return false; |
203 } | 203 } |
204 | 204 |
205 | 205 |
206 inline bool GetSloppyArgumentsLength(Isolate* isolate, Handle<JSObject> object, | 206 inline bool GetSloppyArgumentsLength(Isolate* isolate, Handle<JSObject> object, |
207 int* out) { | 207 int* out) { |
208 Map* arguments_map = isolate->native_context()->sloppy_arguments_map(); | 208 Map* arguments_map = isolate->native_context()->sloppy_arguments_map(); |
209 if (object->map() != arguments_map) return false; | 209 if (object->map() != arguments_map) return false; |
210 DCHECK(object->HasFastElements()); | 210 DCHECK(object->HasFastElements()); |
211 Object* len_obj = object->InObjectPropertyAt(Heap::kArgumentsLengthIndex); | 211 Object* len_obj = object->InObjectPropertyAt(JSArgumentsObject::kLengthIndex); |
212 if (!len_obj->IsSmi()) return false; | 212 if (!len_obj->IsSmi()) return false; |
213 *out = Max(0, Smi::cast(len_obj)->value()); | 213 *out = Max(0, Smi::cast(len_obj)->value()); |
214 return *out <= object->elements()->length(); | 214 return *out <= object->elements()->length(); |
215 } | 215 } |
216 | 216 |
217 | 217 |
218 inline bool PrototypeHasNoElements(PrototypeIterator* iter) { | 218 inline bool PrototypeHasNoElements(PrototypeIterator* iter) { |
219 DisallowHeapAllocation no_gc; | 219 DisallowHeapAllocation no_gc; |
220 for (; !iter->IsAtEnd(); iter->Advance()) { | 220 for (; !iter->IsAtEnd(); iter->Advance()) { |
221 if (iter->GetCurrent()->IsJSProxy()) return false; | 221 if (iter->GetCurrent()->IsJSProxy()) return false; |
(...skipping 4160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4382 BUILTIN_LIST_C(DEFINE_BUILTIN_ACCESSOR_C) | 4382 BUILTIN_LIST_C(DEFINE_BUILTIN_ACCESSOR_C) |
4383 BUILTIN_LIST_A(DEFINE_BUILTIN_ACCESSOR_A) | 4383 BUILTIN_LIST_A(DEFINE_BUILTIN_ACCESSOR_A) |
4384 BUILTIN_LIST_H(DEFINE_BUILTIN_ACCESSOR_H) | 4384 BUILTIN_LIST_H(DEFINE_BUILTIN_ACCESSOR_H) |
4385 BUILTIN_LIST_DEBUG_A(DEFINE_BUILTIN_ACCESSOR_A) | 4385 BUILTIN_LIST_DEBUG_A(DEFINE_BUILTIN_ACCESSOR_A) |
4386 #undef DEFINE_BUILTIN_ACCESSOR_C | 4386 #undef DEFINE_BUILTIN_ACCESSOR_C |
4387 #undef DEFINE_BUILTIN_ACCESSOR_A | 4387 #undef DEFINE_BUILTIN_ACCESSOR_A |
4388 | 4388 |
4389 | 4389 |
4390 } // namespace internal | 4390 } // namespace internal |
4391 } // namespace v8 | 4391 } // namespace v8 |
OLD | NEW |