| OLD | NEW |
| 1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 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 7216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7227 int index = argument_count - 1; | 7227 int index = argument_count - 1; |
| 7228 while (index >= mapped_count) { | 7228 while (index >= mapped_count) { |
| 7229 // These go directly in the arguments array and have no | 7229 // These go directly in the arguments array and have no |
| 7230 // corresponding slot in the parameter map. | 7230 // corresponding slot in the parameter map. |
| 7231 arguments->set(index, *(parameters - index - 1)); | 7231 arguments->set(index, *(parameters - index - 1)); |
| 7232 --index; | 7232 --index; |
| 7233 } | 7233 } |
| 7234 | 7234 |
| 7235 ScopeInfo<> scope_info(callee->shared()->scope_info()); | 7235 ScopeInfo<> scope_info(callee->shared()->scope_info()); |
| 7236 while (index >= 0) { | 7236 while (index >= 0) { |
| 7237 // Detect duplicate names. | 7237 // Detect duplicate names to the right in the parameter list. |
| 7238 Handle<String> name = scope_info.parameter_name(index); | 7238 Handle<String> name = scope_info.parameter_name(index); |
| 7239 int context_slot_count = scope_info.number_of_context_slots(); | 7239 int context_slot_count = scope_info.number_of_context_slots(); |
| 7240 bool duplicate = false; | 7240 bool duplicate = false; |
| 7241 for (int j = 0; j < index; ++j) { | 7241 for (int j = index + 1; j < parameter_count; ++j) { |
| 7242 if (scope_info.parameter_name(j).is_identical_to(name)) { | 7242 if (scope_info.parameter_name(j).is_identical_to(name)) { |
| 7243 duplicate = true; | 7243 duplicate = true; |
| 7244 break; | 7244 break; |
| 7245 } | 7245 } |
| 7246 } | 7246 } |
| 7247 | 7247 |
| 7248 if (duplicate) { | 7248 if (duplicate) { |
| 7249 // This goes directly in the arguments array with a hole in the | 7249 // This goes directly in the arguments array with a hole in the |
| 7250 // parameter map. | 7250 // parameter map. |
| 7251 arguments->set(index, *(parameters - index - 1)); | 7251 arguments->set(index, *(parameters - index - 1)); |
| (...skipping 5051 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 12303 } else { | 12303 } else { |
| 12304 // Handle last resort GC and make sure to allow future allocations | 12304 // Handle last resort GC and make sure to allow future allocations |
| 12305 // to grow the heap without causing GCs (if possible). | 12305 // to grow the heap without causing GCs (if possible). |
| 12306 COUNTERS->gc_last_resort_from_js()->Increment(); | 12306 COUNTERS->gc_last_resort_from_js()->Increment(); |
| 12307 HEAP->CollectAllGarbage(false); | 12307 HEAP->CollectAllGarbage(false); |
| 12308 } | 12308 } |
| 12309 } | 12309 } |
| 12310 | 12310 |
| 12311 | 12311 |
| 12312 } } // namespace v8::internal | 12312 } } // namespace v8::internal |
| OLD | NEW |