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

Side by Side Diff: src/deoptimizer.cc

Issue 8917014: Guard against undefined fields in global context. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Fix more global context accesses. Created 9 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
« no previous file with comments | « src/assembler.cc ('k') | src/heap.cc » ('j') | src/heap.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 246 matching lines...) Expand 10 before | Expand all | Expand 10 after
257 GlobalObject::cast(object)->global_context(), visitor); 257 GlobalObject::cast(object)->global_context(), visitor);
258 } 258 }
259 } 259 }
260 260
261 261
262 void Deoptimizer::VisitAllOptimizedFunctions( 262 void Deoptimizer::VisitAllOptimizedFunctions(
263 OptimizedFunctionVisitor* visitor) { 263 OptimizedFunctionVisitor* visitor) {
264 AssertNoAllocation no_allocation; 264 AssertNoAllocation no_allocation;
265 265
266 // Run through the list of all global contexts and deoptimize. 266 // Run through the list of all global contexts and deoptimize.
267 Object* global = Isolate::Current()->heap()->global_contexts_list(); 267 Object* context = Isolate::Current()->heap()->global_contexts_list();
268 while (!global->IsUndefined()) { 268 while (!context->IsUndefined()) {
269 VisitAllOptimizedFunctionsForGlobalObject(Context::cast(global)->global(), 269 Object* global = Context::cast(context)->get(Context::GLOBAL_INDEX);
ulan 2011/12/12 19:11:16 Do we need check here? Is global object always def
Vyacheslav Egorov (Chromium) 2011/12/13 12:26:20 I think we need it. Judging from the control flow
ulan 2011/12/13 13:02:58 Done.
270 visitor); 270 if (!global->IsUndefined()) {
271 global = Context::cast(global)->get(Context::NEXT_CONTEXT_LINK); 271 VisitAllOptimizedFunctionsForGlobalObject(JSObject::cast(global),
272 visitor);
273 }
274 context = Context::cast(context)->get(Context::NEXT_CONTEXT_LINK);
272 } 275 }
273 } 276 }
274 277
275 278
276 void Deoptimizer::HandleWeakDeoptimizedCode( 279 void Deoptimizer::HandleWeakDeoptimizedCode(
277 v8::Persistent<v8::Value> obj, void* data) { 280 v8::Persistent<v8::Value> obj, void* data) {
278 DeoptimizingCodeListNode* node = 281 DeoptimizingCodeListNode* node =
279 reinterpret_cast<DeoptimizingCodeListNode*>(data); 282 reinterpret_cast<DeoptimizingCodeListNode*>(data);
280 RemoveDeoptimizingCode(*node->code()); 283 RemoveDeoptimizingCode(*node->code());
281 #ifdef DEBUG 284 #ifdef DEBUG
(...skipping 1211 matching lines...) Expand 10 before | Expand all | Expand 10 after
1493 1496
1494 void DeoptimizedFrameInfo::Iterate(ObjectVisitor* v) { 1497 void DeoptimizedFrameInfo::Iterate(ObjectVisitor* v) {
1495 v->VisitPointer(BitCast<Object**>(&function_)); 1498 v->VisitPointer(BitCast<Object**>(&function_));
1496 v->VisitPointers(parameters_, parameters_ + parameters_count_); 1499 v->VisitPointers(parameters_, parameters_ + parameters_count_);
1497 v->VisitPointers(expression_stack_, expression_stack_ + expression_count_); 1500 v->VisitPointers(expression_stack_, expression_stack_ + expression_count_);
1498 } 1501 }
1499 1502
1500 #endif // ENABLE_DEBUGGER_SUPPORT 1503 #endif // ENABLE_DEBUGGER_SUPPORT
1501 1504
1502 } } // namespace v8::internal 1505 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/assembler.cc ('k') | src/heap.cc » ('j') | src/heap.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698