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

Side by Side Diff: src/handles.cc

Issue 7911: Various API changes (Closed)
Patch Set: "Various API changes Created 12 years, 2 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
« no previous file with comments | « src/debug.cc ('k') | src/objects.h » ('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 2006-2008 the V8 project authors. All rights reserved. 1 // Copyright 2006-2008 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 230 matching lines...) Expand 10 before | Expand all | Expand 10 after
241 CALL_HEAP_FUNCTION(Heap::CopyJSObject(*obj), JSObject); 241 CALL_HEAP_FUNCTION(Heap::CopyJSObject(*obj), JSObject);
242 } 242 }
243 243
244 244
245 // Wrappers for scripts are kept alive and cached in weak global 245 // Wrappers for scripts are kept alive and cached in weak global
246 // handles referred from proxy objects held by the scripts as long as 246 // handles referred from proxy objects held by the scripts as long as
247 // they are used. When they are not used anymore, the garbage 247 // they are used. When they are not used anymore, the garbage
248 // collector will call the weak callback on the global handle 248 // collector will call the weak callback on the global handle
249 // associated with the wrapper and get rid of both the wrapper and the 249 // associated with the wrapper and get rid of both the wrapper and the
250 // handle. 250 // handle.
251 static void ClearWrapperCache(Persistent<v8::Object> handle, void*) { 251 static void ClearWrapperCache(Persistent<v8::Value> handle, void*) {
252 Handle<Object> cache = Utils::OpenHandle(*handle); 252 Handle<Object> cache = Utils::OpenHandle(*handle);
253 JSValue* wrapper = JSValue::cast(*cache); 253 JSValue* wrapper = JSValue::cast(*cache);
254 Proxy* proxy = Script::cast(wrapper->value())->wrapper(); 254 Proxy* proxy = Script::cast(wrapper->value())->wrapper();
255 ASSERT(proxy->proxy() == reinterpret_cast<Address>(cache.location())); 255 ASSERT(proxy->proxy() == reinterpret_cast<Address>(cache.location()));
256 proxy->set_proxy(0); 256 proxy->set_proxy(0);
257 GlobalHandles::Destroy(cache.location()); 257 GlobalHandles::Destroy(cache.location());
258 Counters::script_wrappers.Decrement(); 258 Counters::script_wrappers.Decrement();
259 } 259 }
260 260
261 261
(...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after
540 Handle<Context> compile_context, 540 Handle<Context> compile_context,
541 Handle<Context> function_context) { 541 Handle<Context> function_context) {
542 Handle<FixedArray> arr = Factory::NewFixedArray(3); 542 Handle<FixedArray> arr = Factory::NewFixedArray(3);
543 arr->set(0, Smi::FromInt(index)); 543 arr->set(0, Smi::FromInt(index));
544 arr->set(1, *compile_context); // Compile in this context 544 arr->set(1, *compile_context); // Compile in this context
545 arr->set(2, *function_context); // Set function context to this 545 arr->set(2, *function_context); // Set function context to this
546 fun->shared()->set_lazy_load_data(*arr); 546 fun->shared()->set_lazy_load_data(*arr);
547 } 547 }
548 548
549 } } // namespace v8::internal 549 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/debug.cc ('k') | src/objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698