Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 10281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 10292 | 10292 |
| 10293 // Add the value being returned. | 10293 // Add the value being returned. |
| 10294 if (at_return) { | 10294 if (at_return) { |
| 10295 details->set(details_index++, *return_value); | 10295 details->set(details_index++, *return_value); |
| 10296 } | 10296 } |
| 10297 | 10297 |
| 10298 // Add the receiver (same as in function frame). | 10298 // Add the receiver (same as in function frame). |
| 10299 // THIS MUST BE DONE LAST SINCE WE MIGHT ADVANCE | 10299 // THIS MUST BE DONE LAST SINCE WE MIGHT ADVANCE |
| 10300 // THE FRAME ITERATOR TO WRAP THE RECEIVER. | 10300 // THE FRAME ITERATOR TO WRAP THE RECEIVER. |
| 10301 Handle<Object> receiver(it.frame()->receiver(), isolate); | 10301 Handle<Object> receiver(it.frame()->receiver(), isolate); |
| 10302 if (!receiver->IsJSObject()) { | 10302 if (!receiver->IsJSObject() && !receiver->IsUndefined()) { |
|
Vyacheslav Egorov (Chromium)
2011/07/15 12:43:13
I think we should check for strict || builtin func
Mads Ager (chromium)
2011/07/15 16:32:10
D'oh! You are absolutely right. Thank you. :-)
Th
| |
| 10303 // If the receiver is NOT a JSObject we have hit an optimization | 10303 // If the receiver is not a JSObject and is not undefined we have |
| 10304 // where a value object is not converted into a wrapped JS objects. | 10304 // hit an optimization where a value object is not converted into |
| 10305 // To hide this optimization from the debugger, we wrap the receiver | 10305 // a wrapped JS objects. To hide this optimization from the |
| 10306 // by creating correct wrapper object based on the calling frame's | 10306 // debugger, we wrap the receiver by creating correct wrapper |
| 10307 // global context. | 10307 // object based on the calling frame's global context. |
| 10308 it.Advance(); | 10308 it.Advance(); |
| 10309 Handle<Context> calling_frames_global_context( | 10309 Handle<Context> calling_frames_global_context( |
| 10310 Context::cast(Context::cast(it.frame()->context())->global_context())); | 10310 Context::cast(Context::cast(it.frame()->context())->global_context())); |
| 10311 receiver = | 10311 receiver = |
| 10312 isolate->factory()->ToObject(receiver, calling_frames_global_context); | 10312 isolate->factory()->ToObject(receiver, calling_frames_global_context); |
| 10313 } | 10313 } |
| 10314 details->set(kFrameDetailsReceiverIndex, *receiver); | 10314 details->set(kFrameDetailsReceiverIndex, *receiver); |
| 10315 | 10315 |
| 10316 ASSERT_EQ(details_size, details_index); | 10316 ASSERT_EQ(details_size, details_index); |
| 10317 return *isolate->factory()->NewJSArrayWithElements(details); | 10317 return *isolate->factory()->NewJSArrayWithElements(details); |
| (...skipping 2351 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 12669 } else { | 12669 } else { |
| 12670 // Handle last resort GC and make sure to allow future allocations | 12670 // Handle last resort GC and make sure to allow future allocations |
| 12671 // to grow the heap without causing GCs (if possible). | 12671 // to grow the heap without causing GCs (if possible). |
| 12672 isolate->counters()->gc_last_resort_from_js()->Increment(); | 12672 isolate->counters()->gc_last_resort_from_js()->Increment(); |
| 12673 isolate->heap()->CollectAllGarbage(false); | 12673 isolate->heap()->CollectAllGarbage(false); |
| 12674 } | 12674 } |
| 12675 } | 12675 } |
| 12676 | 12676 |
| 12677 | 12677 |
| 12678 } } // namespace v8::internal | 12678 } } // namespace v8::internal |
| OLD | NEW |