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

Side by Side Diff: src/type-info.cc

Issue 1077623002: Version 4.2.77.15 (cherry-pick) (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@4.2
Patch Set: Created 5 years, 8 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 | « include/v8-version.h ('k') | no next file » | 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 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/v8.h" 5 #include "src/v8.h"
6 6
7 #include "src/ast.h" 7 #include "src/ast.h"
8 #include "src/code-stubs.h" 8 #include "src/code-stubs.h"
9 #include "src/compiler.h" 9 #include "src/compiler.h"
10 #include "src/ic/ic.h" 10 #include "src/ic/ic.h"
(...skipping 419 matching lines...) Expand 10 before | Expand all | Expand 10 after
430 // Check if the constructor directly references a foreign context. 430 // Check if the constructor directly references a foreign context.
431 if (CanRetainOtherContext(JSFunction::cast(constructor), 431 if (CanRetainOtherContext(JSFunction::cast(constructor),
432 native_context)) { 432 native_context)) {
433 return true; 433 return true;
434 } 434 }
435 } 435 }
436 map = HeapObject::cast(map->prototype())->map(); 436 map = HeapObject::cast(map->prototype())->map();
437 } 437 }
438 constructor = map->constructor(); 438 constructor = map->constructor();
439 if (constructor->IsNull()) return false; 439 if (constructor->IsNull()) return false;
440 // If the constructor is not null or a JSFunction, we have to conservatively
441 // assume that it may retain a native context.
442 if (!constructor->IsJSFunction()) return true;
440 JSFunction* function = JSFunction::cast(constructor); 443 JSFunction* function = JSFunction::cast(constructor);
441 return CanRetainOtherContext(function, native_context); 444 return CanRetainOtherContext(function, native_context);
442 } 445 }
443 446
444 447
445 bool TypeFeedbackOracle::CanRetainOtherContext(JSFunction* function, 448 bool TypeFeedbackOracle::CanRetainOtherContext(JSFunction* function,
446 Context* native_context) { 449 Context* native_context) {
447 return function->context()->global_object() != native_context->global_object() 450 return function->context()->global_object() != native_context->global_object()
448 && function->context()->global_object() != native_context->builtins(); 451 && function->context()->global_object() != native_context->builtins();
449 } 452 }
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
562 UnseededNumberDictionary::kNotFound); 565 UnseededNumberDictionary::kNotFound);
563 // Dictionary has been allocated with sufficient size for all elements. 566 // Dictionary has been allocated with sufficient size for all elements.
564 DisallowHeapAllocation no_need_to_resize_dictionary; 567 DisallowHeapAllocation no_need_to_resize_dictionary;
565 HandleScope scope(isolate()); 568 HandleScope scope(isolate());
566 USE(UnseededNumberDictionary::AtNumberPut( 569 USE(UnseededNumberDictionary::AtNumberPut(
567 dictionary_, IdToKey(ast_id), handle(target, isolate()))); 570 dictionary_, IdToKey(ast_id), handle(target, isolate())));
568 } 571 }
569 572
570 573
571 } } // namespace v8::internal 574 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « include/v8-version.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698