| OLD | NEW |
| 1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 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/interpreter/bytecode-generator.h" | 5 #include "src/interpreter/bytecode-generator.h" |
| 6 | 6 |
| 7 #include "src/ast/compile-time-value.h" | 7 #include "src/ast/compile-time-value.h" |
| 8 #include "src/ast/scopes.h" | 8 #include "src/ast/scopes.h" |
| 9 #include "src/code-stubs.h" | 9 #include "src/code-stubs.h" |
| 10 #include "src/compilation-info.h" | 10 #include "src/compilation-info.h" |
| (...skipping 2899 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2910 RegisterList args = register_allocator()->NewRegisterList(3); | 2910 RegisterList args = register_allocator()->NewRegisterList(3); |
| 2911 builder() | 2911 builder() |
| 2912 ->MoveRegister(builder()->Parameter(1), args[0]) | 2912 ->MoveRegister(builder()->Parameter(1), args[0]) |
| 2913 .LoadAccumulatorWithRegister(Register::function_closure()) | 2913 .LoadAccumulatorWithRegister(Register::function_closure()) |
| 2914 .StoreAccumulatorInRegister(args[1]) | 2914 .StoreAccumulatorInRegister(args[1]) |
| 2915 .LoadLiteral(scope->scope_info()) | 2915 .LoadLiteral(scope->scope_info()) |
| 2916 .StoreAccumulatorInRegister(args[2]) | 2916 .StoreAccumulatorInRegister(args[2]) |
| 2917 .CallRuntime(Runtime::kPushModuleContext, args); | 2917 .CallRuntime(Runtime::kPushModuleContext, args); |
| 2918 } else { | 2918 } else { |
| 2919 int slot_count = scope->num_heap_slots() - Context::MIN_CONTEXT_SLOTS; | 2919 int slot_count = scope->num_heap_slots() - Context::MIN_CONTEXT_SLOTS; |
| 2920 builder()->CreateFunctionContext(slot_count); | 2920 if (slot_count <= FastNewFunctionContextStub::kMaximumSlots) { |
| 2921 builder()->CreateFunctionContext(slot_count); |
| 2922 } else { |
| 2923 builder()->CallRuntime(Runtime::kNewFunctionContext, |
| 2924 Register::function_closure()); |
| 2925 } |
| 2921 } | 2926 } |
| 2922 } | 2927 } |
| 2923 | 2928 |
| 2924 void BytecodeGenerator::BuildLocalActivationContextInitialization() { | 2929 void BytecodeGenerator::BuildLocalActivationContextInitialization() { |
| 2925 DeclarationScope* scope = this->scope(); | 2930 DeclarationScope* scope = this->scope(); |
| 2926 | 2931 |
| 2927 if (scope->has_this_declaration() && scope->receiver()->IsContextSlot()) { | 2932 if (scope->has_this_declaration() && scope->receiver()->IsContextSlot()) { |
| 2928 Variable* variable = scope->receiver(); | 2933 Variable* variable = scope->receiver(); |
| 2929 Register receiver(builder()->Parameter(0)); | 2934 Register receiver(builder()->Parameter(0)); |
| 2930 // Context variable (at bottom of the context chain). | 2935 // Context variable (at bottom of the context chain). |
| (...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3165 } | 3170 } |
| 3166 | 3171 |
| 3167 Runtime::FunctionId BytecodeGenerator::StoreKeyedToSuperRuntimeId() { | 3172 Runtime::FunctionId BytecodeGenerator::StoreKeyedToSuperRuntimeId() { |
| 3168 return is_strict(language_mode()) ? Runtime::kStoreKeyedToSuper_Strict | 3173 return is_strict(language_mode()) ? Runtime::kStoreKeyedToSuper_Strict |
| 3169 : Runtime::kStoreKeyedToSuper_Sloppy; | 3174 : Runtime::kStoreKeyedToSuper_Sloppy; |
| 3170 } | 3175 } |
| 3171 | 3176 |
| 3172 } // namespace interpreter | 3177 } // namespace interpreter |
| 3173 } // namespace internal | 3178 } // namespace internal |
| 3174 } // namespace v8 | 3179 } // namespace v8 |
| OLD | NEW |