| OLD | NEW |
| 1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 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 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 } | 65 } |
| 66 HandleScopeImplementer* impl = HandleScopeImplementer::instance(); | 66 HandleScopeImplementer* impl = HandleScopeImplementer::instance(); |
| 67 // If there's more room in the last block, we use that. This is used | 67 // If there's more room in the last block, we use that. This is used |
| 68 // for fast creation of scopes after scope barriers. | 68 // for fast creation of scopes after scope barriers. |
| 69 if (!impl->Blocks()->is_empty()) { | 69 if (!impl->Blocks()->is_empty()) { |
| 70 void** limit = &impl->Blocks()->last()[kHandleBlockSize]; | 70 void** limit = &impl->Blocks()->last()[kHandleBlockSize]; |
| 71 if (current_.limit != limit) { | 71 if (current_.limit != limit) { |
| 72 current_.limit = limit; | 72 current_.limit = limit; |
| 73 } | 73 } |
| 74 } | 74 } |
| 75 | 75 |
| 76 // If we still haven't found a slot for the handle, we extend the | 76 // If we still haven't found a slot for the handle, we extend the |
| 77 // current handle scope by allocating a new handle block. | 77 // current handle scope by allocating a new handle block. |
| 78 if (result == current_.limit) { | 78 if (result == current_.limit) { |
| 79 // If there's a spare block, use it for growing the current scope. | 79 // If there's a spare block, use it for growing the current scope. |
| 80 result = impl->GetSpareOrNewBlock(); | 80 result = impl->GetSpareOrNewBlock(); |
| 81 // Add the extension to the global list of blocks, but count the | 81 // Add the extension to the global list of blocks, but count the |
| 82 // extension as part of the current scope. | 82 // extension as part of the current scope. |
| 83 impl->Blocks()->Add(result); | 83 impl->Blocks()->Add(result); |
| 84 current_.extensions++; | 84 current_.extensions++; |
| 85 current_.limit = &result[kHandleBlockSize]; | 85 current_.limit = &result[kHandleBlockSize]; |
| (...skipping 582 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 668 Handle<Context> compile_context, | 668 Handle<Context> compile_context, |
| 669 Handle<Context> function_context) { | 669 Handle<Context> function_context) { |
| 670 Handle<FixedArray> arr = Factory::NewFixedArray(3); | 670 Handle<FixedArray> arr = Factory::NewFixedArray(3); |
| 671 arr->set(0, Smi::FromInt(index)); | 671 arr->set(0, Smi::FromInt(index)); |
| 672 arr->set(1, *compile_context); // Compile in this context | 672 arr->set(1, *compile_context); // Compile in this context |
| 673 arr->set(2, *function_context); // Set function context to this | 673 arr->set(2, *function_context); // Set function context to this |
| 674 fun->shared()->set_lazy_load_data(*arr); | 674 fun->shared()->set_lazy_load_data(*arr); |
| 675 } | 675 } |
| 676 | 676 |
| 677 } } // namespace v8::internal | 677 } } // namespace v8::internal |
| OLD | NEW |