OLD | NEW |
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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 function_name_info = NONE; | 67 function_name_info = NONE; |
68 function_variable_mode = VAR; | 68 function_variable_mode = VAR; |
69 } | 69 } |
70 | 70 |
71 const bool has_function_name = function_name_info != NONE; | 71 const bool has_function_name = function_name_info != NONE; |
72 const int parameter_count = scope->num_parameters(); | 72 const int parameter_count = scope->num_parameters(); |
73 const int length = kVariablePartIndex | 73 const int length = kVariablePartIndex |
74 + parameter_count + stack_local_count + 2 * context_local_count | 74 + parameter_count + stack_local_count + 2 * context_local_count |
75 + (has_function_name ? 2 : 0); | 75 + (has_function_name ? 2 : 0); |
76 | 76 |
77 Handle<ScopeInfo> scope_info = FACTORY->NewScopeInfo(length); | 77 Factory* factory = Isolate::Current()->factory(); |
| 78 Handle<ScopeInfo> scope_info = factory->NewScopeInfo(length); |
78 | 79 |
79 // Encode the flags. | 80 // Encode the flags. |
80 int flags = TypeField::encode(scope->type()) | | 81 int flags = TypeField::encode(scope->type()) | |
81 CallsEvalField::encode(scope->calls_eval()) | | 82 CallsEvalField::encode(scope->calls_eval()) | |
82 LanguageModeField::encode(scope->language_mode()) | | 83 LanguageModeField::encode(scope->language_mode()) | |
83 FunctionVariableField::encode(function_name_info) | | 84 FunctionVariableField::encode(function_name_info) | |
84 FunctionVariableMode::encode(function_variable_mode); | 85 FunctionVariableMode::encode(function_variable_mode); |
85 scope_info->SetFlags(flags); | 86 scope_info->SetFlags(flags); |
86 scope_info->SetParameterCount(parameter_count); | 87 scope_info->SetParameterCount(parameter_count); |
87 scope_info->SetStackLocalCount(stack_local_count); | 88 scope_info->SetStackLocalCount(stack_local_count); |
(...skipping 464 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
552 } else { | 553 } else { |
553 ASSERT(var->index() >= 0); | 554 ASSERT(var->index() >= 0); |
554 info->set_index(i, var->index()); | 555 info->set_index(i, var->index()); |
555 } | 556 } |
556 } | 557 } |
557 ASSERT(i == info->length()); | 558 ASSERT(i == info->length()); |
558 return info; | 559 return info; |
559 } | 560 } |
560 | 561 |
561 } } // namespace v8::internal | 562 } } // namespace v8::internal |
OLD | NEW |