Fix assertion failure with deferred prefixes.

When running with --load-deferred-eagerly, we don't need to collect
functions for invalidation, but instead insert runtime checks  if
the prefix if loadLibrary was called loaded or not.

BUG=
R=rmacnak@google.com

Review URL: https://codereview.chromium.org/2415743004 .
This commit is contained in:
Florian Schneider 2016-10-14 10:20:46 -07:00
parent 74e6376b5c
commit a0380ffaf6

View file

@ -12210,7 +12210,8 @@ AstNode* Parser::ParseClosurization(AstNode* primary) {
obj = prefix.LookupObject(extractor_name);
}
}
if (!prefix.is_loaded() && (parsed_function() != NULL)) {
if (!prefix.is_loaded() && (parsed_function() != NULL) &&
!FLAG_load_deferred_eagerly) {
// Remember that this function depends on an import prefix of an
// unloaded deferred library.
parsed_function()->AddDeferredPrefix(prefix);
@ -14032,7 +14033,8 @@ AstNode* Parser::ParseNewOperator(Token::Kind op_kind) {
UnresolvedClass::Handle(Z, redirect_type.unresolved_class());
const LibraryPrefix& prefix =
LibraryPrefix::Handle(Z, cls.library_prefix());
if (!prefix.IsNull() && !prefix.is_loaded()) {
if (!prefix.IsNull() && !prefix.is_loaded() &&
!FLAG_load_deferred_eagerly) {
// If the redirection type is unresolved because it refers to
// an unloaded deferred prefix, mark this function as depending
// on the library prefix. It will then get invalidated when the