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 4352 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
4363 | 4363 |
4364 // Try to convert the string key into an array index. | 4364 // Try to convert the string key into an array index. |
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. |
Martin Maly
2011/03/15 02:50:36
Runtime_GetArgumentsProperty ... it only appears t
| |
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 Loading... | |
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 |
OLD | NEW |