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

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

Issue 2435023002: Use a different map to distinguish eval contexts (Closed)
Patch Set: relax dchecks Created 4 years, 1 month 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/code-stubs.h" 9 #include "src/code-stubs.h"
10 #include "src/compilation-info.h" 10 #include "src/compilation-info.h"
(...skipping 2915 matching lines...) Expand 10 before | Expand all | Expand 10 after
2926 // A JSFunction representing a module is called with the module object as 2926 // A JSFunction representing a module is called with the module object as
2927 // its sole argument, which we pass on to PushModuleContext. 2927 // its sole argument, which we pass on to PushModuleContext.
2928 RegisterList args = register_allocator()->NewRegisterList(3); 2928 RegisterList args = register_allocator()->NewRegisterList(3);
2929 builder() 2929 builder()
2930 ->MoveRegister(builder()->Parameter(1), args[0]) 2930 ->MoveRegister(builder()->Parameter(1), args[0])
2931 .LoadAccumulatorWithRegister(Register::function_closure()) 2931 .LoadAccumulatorWithRegister(Register::function_closure())
2932 .StoreAccumulatorInRegister(args[1]) 2932 .StoreAccumulatorInRegister(args[1])
2933 .LoadLiteral(scope->scope_info()) 2933 .LoadLiteral(scope->scope_info())
2934 .StoreAccumulatorInRegister(args[2]) 2934 .StoreAccumulatorInRegister(args[2])
2935 .CallRuntime(Runtime::kPushModuleContext, args); 2935 .CallRuntime(Runtime::kPushModuleContext, args);
2936 } else if (scope->is_eval_scope()) {
2937 int slot_count = scope->num_heap_slots() - Context::MIN_CONTEXT_SLOTS;
2938 builder()->CreateEvalContext(slot_count);
adamk 2016/11/12 00:26:05 Does this need the same branch as we have everywhe
Dan Ehrenberg 2016/12/07 05:41:26 Yes, fixed.
2936 } else { 2939 } else {
2937 int slot_count = scope->num_heap_slots() - Context::MIN_CONTEXT_SLOTS; 2940 int slot_count = scope->num_heap_slots() - Context::MIN_CONTEXT_SLOTS;
2938 if (slot_count <= FastNewFunctionContextStub::kMaximumSlots) { 2941 if (slot_count <= FastNewFunctionContextStub::kMaximumSlots) {
2939 builder()->CreateFunctionContext(slot_count); 2942 builder()->CreateFunctionContext(slot_count);
2940 } else { 2943 } else {
2941 builder()->CallRuntime(Runtime::kNewFunctionContext, 2944 builder()->CallRuntime(Runtime::kNewFunctionContext,
2942 Register::function_closure()); 2945 Register::function_closure());
2943 } 2946 }
2944 } 2947 }
2945 } 2948 }
(...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after
3192 } 3195 }
3193 3196
3194 Runtime::FunctionId BytecodeGenerator::StoreKeyedToSuperRuntimeId() { 3197 Runtime::FunctionId BytecodeGenerator::StoreKeyedToSuperRuntimeId() {
3195 return is_strict(language_mode()) ? Runtime::kStoreKeyedToSuper_Strict 3198 return is_strict(language_mode()) ? Runtime::kStoreKeyedToSuper_Strict
3196 : Runtime::kStoreKeyedToSuper_Sloppy; 3199 : Runtime::kStoreKeyedToSuper_Sloppy;
3197 } 3200 }
3198 3201
3199 } // namespace interpreter 3202 } // namespace interpreter
3200 } // namespace internal 3203 } // namespace internal
3201 } // namespace v8 3204 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698