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

Side by Side Diff: src/runtime.cc

Issue 18900004: Do not implicitly convert receivers for builtin functions when inspecting frames. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 5 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/mjsunit/regress/regress-frame-details-null-receiver.js » ('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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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 11043 matching lines...) Expand 10 before | Expand all | Expand 10 after
11054 if (at_return) { 11054 if (at_return) {
11055 details->set(details_index++, *return_value); 11055 details->set(details_index++, *return_value);
11056 } 11056 }
11057 11057
11058 // Add the receiver (same as in function frame). 11058 // Add the receiver (same as in function frame).
11059 // THIS MUST BE DONE LAST SINCE WE MIGHT ADVANCE 11059 // THIS MUST BE DONE LAST SINCE WE MIGHT ADVANCE
11060 // THE FRAME ITERATOR TO WRAP THE RECEIVER. 11060 // THE FRAME ITERATOR TO WRAP THE RECEIVER.
11061 Handle<Object> receiver(it.frame()->receiver(), isolate); 11061 Handle<Object> receiver(it.frame()->receiver(), isolate);
11062 if (!receiver->IsJSObject() && 11062 if (!receiver->IsJSObject() &&
11063 shared->is_classic_mode() && 11063 shared->is_classic_mode() &&
11064 !shared->native()) { 11064 !function->IsBuiltin()) {
11065 // If the receiver is not a JSObject and the function is not a 11065 // If the receiver is not a JSObject and the function is not a
11066 // builtin or strict-mode we have hit an optimization where a 11066 // builtin or strict-mode we have hit an optimization where a
11067 // value object is not converted into a wrapped JS objects. To 11067 // value object is not converted into a wrapped JS objects. To
11068 // hide this optimization from the debugger, we wrap the receiver 11068 // hide this optimization from the debugger, we wrap the receiver
11069 // by creating correct wrapper object based on the calling frame's 11069 // by creating correct wrapper object based on the calling frame's
11070 // native context. 11070 // native context.
11071 it.Advance(); 11071 it.Advance();
11072 Handle<Context> calling_frames_native_context( 11072 Handle<Context> calling_frames_native_context(
11073 Context::cast(Context::cast(it.frame()->context())->native_context())); 11073 Context::cast(Context::cast(it.frame()->context())->native_context()));
11074 ASSERT(!receiver->IsUndefined() && !receiver->IsNull());
11074 receiver = 11075 receiver =
11075 isolate->factory()->ToObject(receiver, calling_frames_native_context); 11076 isolate->factory()->ToObject(receiver, calling_frames_native_context);
11076 } 11077 }
11077 details->set(kFrameDetailsReceiverIndex, *receiver); 11078 details->set(kFrameDetailsReceiverIndex, *receiver);
11078 11079
11079 ASSERT_EQ(details_size, details_index); 11080 ASSERT_EQ(details_size, details_index);
11080 return *isolate->factory()->NewJSArrayWithElements(details); 11081 return *isolate->factory()->NewJSArrayWithElements(details);
11081 } 11082 }
11082 11083
11083 11084
(...skipping 2911 matching lines...) Expand 10 before | Expand all | Expand 10 after
13995 // Handle last resort GC and make sure to allow future allocations 13996 // Handle last resort GC and make sure to allow future allocations
13996 // to grow the heap without causing GCs (if possible). 13997 // to grow the heap without causing GCs (if possible).
13997 isolate->counters()->gc_last_resort_from_js()->Increment(); 13998 isolate->counters()->gc_last_resort_from_js()->Increment();
13998 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags, 13999 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags,
13999 "Runtime::PerformGC"); 14000 "Runtime::PerformGC");
14000 } 14001 }
14001 } 14002 }
14002 14003
14003 14004
14004 } } // namespace v8::internal 14005 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-frame-details-null-receiver.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698