OLD | NEW |
1 // Copyright 2009 the V8 project authors. All rights reserved. | 1 // Copyright 2009 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 namespace internal { | 43 namespace internal { |
44 | 44 |
45 | 45 |
46 v8::ImplementationUtilities::HandleScopeData HandleScope::current_ = | 46 v8::ImplementationUtilities::HandleScopeData HandleScope::current_ = |
47 { -1, NULL, NULL }; | 47 { -1, NULL, NULL }; |
48 | 48 |
49 | 49 |
50 int HandleScope::NumberOfHandles() { | 50 int HandleScope::NumberOfHandles() { |
51 int n = HandleScopeImplementer::instance()->blocks()->length(); | 51 int n = HandleScopeImplementer::instance()->blocks()->length(); |
52 if (n == 0) return 0; | 52 if (n == 0) return 0; |
53 return ((n - 1) * kHandleBlockSize) + | 53 return ((n - 1) * kHandleBlockSize) + static_cast<int>( |
54 (current_.next - HandleScopeImplementer::instance()->blocks()->last()); | 54 (current_.next - HandleScopeImplementer::instance()->blocks()->last())); |
55 } | 55 } |
56 | 56 |
57 | 57 |
58 Object** HandleScope::Extend() { | 58 Object** HandleScope::Extend() { |
59 Object** result = current_.next; | 59 Object** result = current_.next; |
60 | 60 |
61 ASSERT(result == current_.limit); | 61 ASSERT(result == current_.limit); |
62 // Make sure there's at least one scope on the stack and that the | 62 // Make sure there's at least one scope on the stack and that the |
63 // top of the scope stack isn't a barrier. | 63 // top of the scope stack isn't a barrier. |
64 if (current_.extensions < 0) { | 64 if (current_.extensions < 0) { |
(...skipping 713 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
778 Handle<Map> new_map = Factory::CopyMapDropTransitions(old_map); | 778 Handle<Map> new_map = Factory::CopyMapDropTransitions(old_map); |
779 obj->set_map(*new_map); | 779 obj->set_map(*new_map); |
780 new_map->set_needs_loading(true); | 780 new_map->set_needs_loading(true); |
781 // Store the lazy loading info in the constructor field. We'll | 781 // Store the lazy loading info in the constructor field. We'll |
782 // reestablish the constructor from the fixed array after loading. | 782 // reestablish the constructor from the fixed array after loading. |
783 new_map->set_constructor(*arr); | 783 new_map->set_constructor(*arr); |
784 ASSERT(!obj->IsLoaded()); | 784 ASSERT(!obj->IsLoaded()); |
785 } | 785 } |
786 | 786 |
787 } } // namespace v8::internal | 787 } } // namespace v8::internal |
OLD | NEW |