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

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: Also fix bug on ARM. Created 6 years, 11 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/ia32/stub-cache-ia32.cc ('k') | src/runtime.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 9211 matching lines...) Expand 10 before | Expand all | Expand 10 after
9222 9222
9223 // Otherwise, if the slot was found the holder is a context extension 9223 // Otherwise, if the slot was found the holder is a context extension
9224 // object, subject of a with, or a global object. We read the named 9224 // object, subject of a with, or a global object. We read the named
9225 // property from it. 9225 // property from it.
9226 if (!holder.is_null()) { 9226 if (!holder.is_null()) {
9227 Handle<JSReceiver> object = Handle<JSReceiver>::cast(holder); 9227 Handle<JSReceiver> object = Handle<JSReceiver>::cast(holder);
9228 ASSERT(object->IsJSProxy() || JSReceiver::HasProperty(object, name)); 9228 ASSERT(object->IsJSProxy() || JSReceiver::HasProperty(object, name));
9229 // GetProperty below can cause GC. 9229 // GetProperty below can cause GC.
9230 Handle<Object> receiver_handle( 9230 Handle<Object> receiver_handle(
9231 object->IsGlobalObject() 9231 object->IsGlobalObject()
9232 ? GlobalObject::cast(*object)->global_receiver() 9232 ? Object::cast(isolate->heap()->the_hole_value())
9233 : object->IsJSProxy() ? static_cast<Object*>(*object) 9233 : object->IsJSProxy() ? static_cast<Object*>(*object)
9234 : ComputeReceiverForNonGlobal(isolate, JSObject::cast(*object)), 9234 : ComputeReceiverForNonGlobal(isolate, JSObject::cast(*object)),
9235 isolate); 9235 isolate);
9236 9236
9237 // No need to unhole the value here. This is taken care of by the 9237 // No need to unhole the value here. This is taken care of by the
9238 // GetProperty function. 9238 // GetProperty function.
9239 MaybeObject* value = object->GetProperty(*name); 9239 MaybeObject* value = object->GetProperty(*name);
9240 return MakePair(value, *receiver_handle); 9240 return MakePair(value, *receiver_handle);
9241 } 9241 }
9242 9242
(...skipping 5625 matching lines...) Expand 10 before | Expand all | Expand 10 after
14868 // Handle last resort GC and make sure to allow future allocations 14868 // Handle last resort GC and make sure to allow future allocations
14869 // to grow the heap without causing GCs (if possible). 14869 // to grow the heap without causing GCs (if possible).
14870 isolate->counters()->gc_last_resort_from_js()->Increment(); 14870 isolate->counters()->gc_last_resort_from_js()->Increment();
14871 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags, 14871 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags,
14872 "Runtime::PerformGC"); 14872 "Runtime::PerformGC");
14873 } 14873 }
14874 } 14874 }
14875 14875
14876 14876
14877 } } // namespace v8::internal 14877 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « 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