Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1)

Side by Side Diff: src/runtime.cc

Issue 6765026: [Arguments] Fix a small bug and change some test expectations. (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/arguments
Patch Set: Created 9 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | test/mozilla/mozilla.status » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | test/mozilla/mozilla.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698