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

Side by Side Diff: src/runtime.cc

Issue 111613003: Load the global proxy from the context of the target function. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: don't embed global object or receiver in hydrogen Created 7 years 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
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 9228 matching lines...) Expand 10 before | Expand all | Expand 10 after
9239 9239
9240 // Otherwise, if the slot was found the holder is a context extension 9240 // Otherwise, if the slot was found the holder is a context extension
9241 // object, subject of a with, or a global object. We read the named 9241 // object, subject of a with, or a global object. We read the named
9242 // property from it. 9242 // property from it.
9243 if (!holder.is_null()) { 9243 if (!holder.is_null()) {
9244 Handle<JSReceiver> object = Handle<JSReceiver>::cast(holder); 9244 Handle<JSReceiver> object = Handle<JSReceiver>::cast(holder);
9245 ASSERT(object->IsJSProxy() || JSReceiver::HasProperty(object, name)); 9245 ASSERT(object->IsJSProxy() || JSReceiver::HasProperty(object, name));
9246 // GetProperty below can cause GC. 9246 // GetProperty below can cause GC.
9247 Handle<Object> receiver_handle( 9247 Handle<Object> receiver_handle(
9248 object->IsGlobalObject() 9248 object->IsGlobalObject()
9249 ? GlobalObject::cast(*object)->global_receiver() 9249 ? Object::cast(isolate->heap()->the_hole_value())
9250 : object->IsJSProxy() ? static_cast<Object*>(*object) 9250 : object->IsJSProxy() ? static_cast<Object*>(*object)
9251 : ComputeReceiverForNonGlobal(isolate, JSObject::cast(*object)), 9251 : ComputeReceiverForNonGlobal(isolate, JSObject::cast(*object)),
9252 isolate); 9252 isolate);
9253 9253
9254 // No need to unhole the value here. This is taken care of by the 9254 // No need to unhole the value here. This is taken care of by the
9255 // GetProperty function. 9255 // GetProperty function.
9256 MaybeObject* value = object->GetProperty(*name); 9256 MaybeObject* value = object->GetProperty(*name);
9257 return MakePair(value, *receiver_handle); 9257 return MakePair(value, *receiver_handle);
9258 } 9258 }
9259 9259
(...skipping 5642 matching lines...) Expand 10 before | Expand all | Expand 10 after
14902 // Handle last resort GC and make sure to allow future allocations 14902 // Handle last resort GC and make sure to allow future allocations
14903 // to grow the heap without causing GCs (if possible). 14903 // to grow the heap without causing GCs (if possible).
14904 isolate->counters()->gc_last_resort_from_js()->Increment(); 14904 isolate->counters()->gc_last_resort_from_js()->Increment();
14905 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags, 14905 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags,
14906 "Runtime::PerformGC"); 14906 "Runtime::PerformGC");
14907 } 14907 }
14908 } 14908 }
14909 14909
14910 14910
14911 } } // namespace v8::internal 14911 } } // namespace v8::internal
OLDNEW
« src/ia32/code-stubs-ia32.cc ('K') | « src/ia32/stub-cache-ia32.cc ('k') | src/runtime.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698