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

Side by Side Diff: src/runtime.cc

Issue 6698015: Implement strict mode arguments caller/callee. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Kevin's feedback. Created 9 years, 9 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 | « src/messages.js ('k') | src/x64/code-stubs-x64.cc » ('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 4354 matching lines...) Expand 10 before | Expand all | Expand 10 after
4365 if (key->AsArrayIndex(&index)) { 4365 if (key->AsArrayIndex(&index)) {
4366 if (index < n) { 4366 if (index < n) {
4367 return frame->GetParameter(index); 4367 return frame->GetParameter(index);
4368 } else { 4368 } else {
4369 return Top::initial_object_prototype()->GetElement(index); 4369 return Top::initial_object_prototype()->GetElement(index);
4370 } 4370 }
4371 } 4371 }
4372 4372
4373 // Handle special arguments properties. 4373 // Handle special arguments properties.
4374 if (key->Equals(Heap::length_symbol())) return Smi::FromInt(n); 4374 if (key->Equals(Heap::length_symbol())) return Smi::FromInt(n);
4375 if (key->Equals(Heap::callee_symbol())) return frame->function(); 4375 if (key->Equals(Heap::callee_symbol())) {
4376 Object* function = frame->function();
4377 if (function->IsJSFunction() &&
4378 JSFunction::cast(function)->shared()->strict_mode()) {
4379 return Top::Throw(*Factory::NewTypeError("strict_arguments_callee",
4380 HandleVector<Object>(NULL, 0)));
4381 }
4382 return function;
4383 }
4376 4384
4377 // Lookup in the initial Object.prototype object. 4385 // Lookup in the initial Object.prototype object.
4378 return Top::initial_object_prototype()->GetProperty(*key); 4386 return Top::initial_object_prototype()->GetProperty(*key);
4379 } 4387 }
4380 4388
4381 4389
4382 static MaybeObject* Runtime_ToFastProperties(Arguments args) { 4390 static MaybeObject* Runtime_ToFastProperties(Arguments args) {
4383 HandleScope scope; 4391 HandleScope scope;
4384 4392
4385 ASSERT(args.length() == 1); 4393 ASSERT(args.length() == 1);
(...skipping 7242 matching lines...) Expand 10 before | Expand all | Expand 10 after
11628 } else { 11636 } else {
11629 // Handle last resort GC and make sure to allow future allocations 11637 // Handle last resort GC and make sure to allow future allocations
11630 // to grow the heap without causing GCs (if possible). 11638 // to grow the heap without causing GCs (if possible).
11631 Counters::gc_last_resort_from_js.Increment(); 11639 Counters::gc_last_resort_from_js.Increment();
11632 Heap::CollectAllGarbage(false); 11640 Heap::CollectAllGarbage(false);
11633 } 11641 }
11634 } 11642 }
11635 11643
11636 11644
11637 } } // namespace v8::internal 11645 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/messages.js ('k') | src/x64/code-stubs-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698