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

Side by Side Diff: src/interpreter/bytecode-generator.cc

Issue 2604833004: [builtins] FastNewFunctionContextStub becomes a builtin (Closed)
Patch Set: That was unnecessary, reverted :) Created 3 years, 11 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
OLDNEW
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/builtins/builtins-constructor.h"
9 #include "src/code-stubs.h" 10 #include "src/code-stubs.h"
10 #include "src/compilation-info.h" 11 #include "src/compilation-info.h"
11 #include "src/compiler.h" 12 #include "src/compiler.h"
12 #include "src/interpreter/bytecode-flags.h" 13 #include "src/interpreter/bytecode-flags.h"
13 #include "src/interpreter/bytecode-label.h" 14 #include "src/interpreter/bytecode-label.h"
14 #include "src/interpreter/bytecode-register-allocator.h" 15 #include "src/interpreter/bytecode-register-allocator.h"
15 #include "src/interpreter/control-flow-builders.h" 16 #include "src/interpreter/control-flow-builders.h"
16 #include "src/objects.h" 17 #include "src/objects.h"
17 #include "src/parsing/parse-info.h" 18 #include "src/parsing/parse-info.h"
18 #include "src/parsing/token.h" 19 #include "src/parsing/token.h"
(...skipping 2988 matching lines...) Expand 10 before | Expand all | Expand 10 after
3007 builder() 3008 builder()
3008 ->MoveRegister(builder()->Parameter(1), args[0]) 3009 ->MoveRegister(builder()->Parameter(1), args[0])
3009 .LoadAccumulatorWithRegister(Register::function_closure()) 3010 .LoadAccumulatorWithRegister(Register::function_closure())
3010 .StoreAccumulatorInRegister(args[1]) 3011 .StoreAccumulatorInRegister(args[1])
3011 .LoadLiteral(scope->scope_info()) 3012 .LoadLiteral(scope->scope_info())
3012 .StoreAccumulatorInRegister(args[2]) 3013 .StoreAccumulatorInRegister(args[2])
3013 .CallRuntime(Runtime::kPushModuleContext, args); 3014 .CallRuntime(Runtime::kPushModuleContext, args);
3014 } else { 3015 } else {
3015 DCHECK(scope->is_function_scope() || scope->is_eval_scope()); 3016 DCHECK(scope->is_function_scope() || scope->is_eval_scope());
3016 int slot_count = scope->num_heap_slots() - Context::MIN_CONTEXT_SLOTS; 3017 int slot_count = scope->num_heap_slots() - Context::MIN_CONTEXT_SLOTS;
3017 if (slot_count <= FastNewFunctionContextStub::MaximumSlots()) { 3018 if (slot_count <=
3019 ConstructorBuiltinsAssembler::MaximumFunctionContextSlots()) {
3018 switch (scope->scope_type()) { 3020 switch (scope->scope_type()) {
3019 case EVAL_SCOPE: 3021 case EVAL_SCOPE:
3020 builder()->CreateEvalContext(slot_count); 3022 builder()->CreateEvalContext(slot_count);
3021 break; 3023 break;
3022 case FUNCTION_SCOPE: 3024 case FUNCTION_SCOPE:
3023 builder()->CreateFunctionContext(slot_count); 3025 builder()->CreateFunctionContext(slot_count);
3024 break; 3026 break;
3025 default: 3027 default:
3026 UNREACHABLE(); 3028 UNREACHABLE();
3027 } 3029 }
(...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after
3306 } 3308 }
3307 3309
3308 Runtime::FunctionId BytecodeGenerator::StoreKeyedToSuperRuntimeId() { 3310 Runtime::FunctionId BytecodeGenerator::StoreKeyedToSuperRuntimeId() {
3309 return is_strict(language_mode()) ? Runtime::kStoreKeyedToSuper_Strict 3311 return is_strict(language_mode()) ? Runtime::kStoreKeyedToSuper_Strict
3310 : Runtime::kStoreKeyedToSuper_Sloppy; 3312 : Runtime::kStoreKeyedToSuper_Sloppy;
3311 } 3313 }
3312 3314
3313 } // namespace interpreter 3315 } // namespace interpreter
3314 } // namespace internal 3316 } // namespace internal
3315 } // namespace v8 3317 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698