| OLD | NEW |
| 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/api.h" | 7 #include "src/api.h" |
| 8 #include "src/ast.h" | 8 #include "src/ast.h" |
| 9 #include "src/bailout-reason.h" | 9 #include "src/bailout-reason.h" |
| 10 #include "src/base/platform/platform.h" | 10 #include "src/base/platform/platform.h" |
| (...skipping 976 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 987 // string table to internalize strings and values right after they're | 987 // string table to internalize strings and values right after they're |
| 988 // created. This kind of parsing can only be done in the main thread. | 988 // created. This kind of parsing can only be done in the main thread. |
| 989 DCHECK(parsing_on_main_thread_); | 989 DCHECK(parsing_on_main_thread_); |
| 990 ast_value_factory()->Internalize(info->isolate()); | 990 ast_value_factory()->Internalize(info->isolate()); |
| 991 } | 991 } |
| 992 original_scope_ = *scope; | 992 original_scope_ = *scope; |
| 993 if (info->is_eval()) { | 993 if (info->is_eval()) { |
| 994 if (!(*scope)->is_script_scope() || is_strict(info->language_mode())) { | 994 if (!(*scope)->is_script_scope() || is_strict(info->language_mode())) { |
| 995 *scope = NewScope(*scope, EVAL_SCOPE); | 995 *scope = NewScope(*scope, EVAL_SCOPE); |
| 996 } | 996 } |
| 997 } else if (info->is_global()) { | |
| 998 *scope = NewScope(*scope, SCRIPT_SCOPE); | |
| 999 } else if (info->is_module()) { | 997 } else if (info->is_module()) { |
| 1000 *scope = NewScope(*scope, MODULE_SCOPE); | 998 *scope = NewScope(*scope, MODULE_SCOPE); |
| 1001 } | 999 } |
| 1002 (*scope)->set_start_position(0); | 1000 (*scope)->set_start_position(0); |
| 1003 // End position will be set by the caller. | 1001 // End position will be set by the caller. |
| 1004 | 1002 |
| 1005 // Compute the parsing mode. | 1003 // Compute the parsing mode. |
| 1006 Mode mode = (FLAG_lazy && allow_lazy()) ? PARSE_LAZILY : PARSE_EAGERLY; | 1004 Mode mode = (FLAG_lazy && allow_lazy()) ? PARSE_LAZILY : PARSE_EAGERLY; |
| 1007 if (allow_natives() || extension_ != NULL || | 1005 if (allow_natives() || extension_ != NULL || |
| 1008 (*scope)->is_eval_scope()) { | 1006 (*scope)->is_eval_scope()) { |
| (...skipping 4515 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5524 } else { | 5522 } else { |
| 5525 const uc16* data = reinterpret_cast<const uc16*>(raw_string->raw_data()); | 5523 const uc16* data = reinterpret_cast<const uc16*>(raw_string->raw_data()); |
| 5526 running_hash = StringHasher::ComputeRunningHash(running_hash, data, | 5524 running_hash = StringHasher::ComputeRunningHash(running_hash, data, |
| 5527 raw_string->length()); | 5525 raw_string->length()); |
| 5528 } | 5526 } |
| 5529 } | 5527 } |
| 5530 | 5528 |
| 5531 return running_hash; | 5529 return running_hash; |
| 5532 } | 5530 } |
| 5533 } } // namespace v8::internal | 5531 } } // namespace v8::internal |
| OLD | NEW |