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/transitions.h" | 5 #include "src/transitions.h" |
6 | 6 |
7 #include "src/objects-inl.h" | 7 #include "src/objects-inl.h" |
8 #include "src/transitions-inl.h" | 8 #include "src/transitions-inl.h" |
9 #include "src/utils.h" | 9 #include "src/utils.h" |
10 | 10 |
(...skipping 377 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
388 } | 388 } |
389 | 389 |
390 | 390 |
391 // Private static helper functions. | 391 // Private static helper functions. |
392 | 392 |
393 Handle<TransitionArray> TransitionArray::Allocate(Isolate* isolate, | 393 Handle<TransitionArray> TransitionArray::Allocate(Isolate* isolate, |
394 int number_of_transitions, | 394 int number_of_transitions, |
395 int slack) { | 395 int slack) { |
396 Handle<FixedArray> array = isolate->factory()->NewTransitionArray( | 396 Handle<FixedArray> array = isolate->factory()->NewTransitionArray( |
397 LengthFor(number_of_transitions + slack)); | 397 LengthFor(number_of_transitions + slack)); |
398 array->set(kPrototypeTransitionsIndex, Smi::kZero); | 398 array->set(kPrototypeTransitionsIndex, Smi::FromInt(0)); |
399 array->set(kTransitionLengthIndex, Smi::FromInt(number_of_transitions)); | 399 array->set(kTransitionLengthIndex, Smi::FromInt(number_of_transitions)); |
400 return Handle<TransitionArray>::cast(array); | 400 return Handle<TransitionArray>::cast(array); |
401 } | 401 } |
402 | 402 |
403 | 403 |
404 // static | 404 // static |
405 void TransitionArray::ZapTransitionArray(TransitionArray* transitions) { | 405 void TransitionArray::ZapTransitionArray(TransitionArray* transitions) { |
406 // Do not zap the next link that is used by GC. | 406 // Do not zap the next link that is used by GC. |
407 STATIC_ASSERT(kNextLinkIndex + 1 == kPrototypeTransitionsIndex); | 407 STATIC_ASSERT(kNextLinkIndex + 1 == kPrototypeTransitionsIndex); |
408 MemsetPointer(transitions->data_start() + kPrototypeTransitionsIndex, | 408 MemsetPointer(transitions->data_start() + kPrototypeTransitionsIndex, |
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
544 | 544 |
545 int TransitionArray::Search(PropertyKind kind, Name* name, | 545 int TransitionArray::Search(PropertyKind kind, Name* name, |
546 PropertyAttributes attributes, | 546 PropertyAttributes attributes, |
547 int* out_insertion_index) { | 547 int* out_insertion_index) { |
548 int transition = SearchName(name, out_insertion_index); | 548 int transition = SearchName(name, out_insertion_index); |
549 if (transition == kNotFound) return kNotFound; | 549 if (transition == kNotFound) return kNotFound; |
550 return SearchDetails(transition, kind, attributes, out_insertion_index); | 550 return SearchDetails(transition, kind, attributes, out_insertion_index); |
551 } | 551 } |
552 } // namespace internal | 552 } // namespace internal |
553 } // namespace v8 | 553 } // namespace v8 |
OLD | NEW |