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

Side by Side Diff: src/deoptimizer.cc

Issue 1684073002: [Interpreter] Save and restore dispatch table pointer during calls. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@int_assm
Patch Set: Address review comments Created 4 years, 10 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
« no previous file with comments | « src/arm64/builtins-arm64.cc ('k') | src/frames.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 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/deoptimizer.h" 5 #include "src/deoptimizer.h"
6 6
7 #include "src/accessors.h" 7 #include "src/accessors.h"
8 #include "src/ast/prettyprinter.h" 8 #include "src/ast/prettyprinter.h"
9 #include "src/codegen.h" 9 #include "src/codegen.h"
10 #include "src/disasm.h" 10 #include "src/disasm.h"
11 #include "src/frames-inl.h" 11 #include "src/frames-inl.h"
12 #include "src/full-codegen/full-codegen.h" 12 #include "src/full-codegen/full-codegen.h"
13 #include "src/global-handles.h" 13 #include "src/global-handles.h"
14 #include "src/interpreter/interpreter.h"
14 #include "src/macro-assembler.h" 15 #include "src/macro-assembler.h"
15 #include "src/profiler/cpu-profiler.h" 16 #include "src/profiler/cpu-profiler.h"
16 #include "src/v8.h" 17 #include "src/v8.h"
17 18
18 19
19 namespace v8 { 20 namespace v8 {
20 namespace internal { 21 namespace internal {
21 22
22 static MemoryChunk* AllocateCodeChunk(MemoryAllocator* allocator) { 23 static MemoryChunk* AllocateCodeChunk(MemoryAllocator* allocator) {
23 return allocator->AllocateChunk(Deoptimizer::GetMaxDeoptTableSize(), 24 return allocator->AllocateChunk(Deoptimizer::GetMaxDeoptTableSize(),
(...skipping 1149 matching lines...) Expand 10 before | Expand all | Expand 10 after
1173 1174
1174 // The function was mentioned explicitly in the BEGIN_FRAME. 1175 // The function was mentioned explicitly in the BEGIN_FRAME.
1175 output_offset -= kPointerSize; 1176 output_offset -= kPointerSize;
1176 input_offset -= kPointerSize; 1177 input_offset -= kPointerSize;
1177 value = reinterpret_cast<intptr_t>(function); 1178 value = reinterpret_cast<intptr_t>(function);
1178 // The function for the bottommost output frame should also agree with the 1179 // The function for the bottommost output frame should also agree with the
1179 // input frame. 1180 // input frame.
1180 DCHECK(!is_bottommost || input_->GetFrameSlot(input_offset) == value); 1181 DCHECK(!is_bottommost || input_->GetFrameSlot(input_offset) == value);
1181 WriteValueToOutput(function, 0, frame_index, output_offset, "function "); 1182 WriteValueToOutput(function, 0, frame_index, output_offset, "function ");
1182 1183
1183 // TODO(rmcilroy): Deal with new.target correctly - currently just set it to 1184 // The new.target slot is only used during function activiation which is
1185 // before the first deopt point, so should never be needed. Just set it to
1184 // undefined. 1186 // undefined.
1185 output_offset -= kPointerSize; 1187 output_offset -= kPointerSize;
1186 input_offset -= kPointerSize; 1188 input_offset -= kPointerSize;
1187 Object* new_target = isolate_->heap()->undefined_value(); 1189 Object* new_target = isolate_->heap()->undefined_value();
1188 WriteValueToOutput(new_target, 0, frame_index, output_offset, "new_target "); 1190 WriteValueToOutput(new_target, 0, frame_index, output_offset, "new_target ");
1189 1191
1192 // Set the dispatch table pointer.
1193 output_offset -= kPointerSize;
1194 input_offset -= kPointerSize;
1195 Address dispatch_table = isolate()->interpreter()->dispatch_table_address();
1196 WriteValueToOutput(reinterpret_cast<Object*>(dispatch_table), 0, frame_index,
1197 output_offset, "dispatch_table ");
1198
1190 // The bytecode offset was mentioned explicitly in the BEGIN_FRAME. 1199 // The bytecode offset was mentioned explicitly in the BEGIN_FRAME.
1191 output_offset -= kPointerSize; 1200 output_offset -= kPointerSize;
1192 input_offset -= kPointerSize; 1201 input_offset -= kPointerSize;
1193 int raw_bytecode_offset = 1202 int raw_bytecode_offset =
1194 BytecodeArray::kHeaderSize - kHeapObjectTag + bytecode_offset.ToInt(); 1203 BytecodeArray::kHeaderSize - kHeapObjectTag + bytecode_offset.ToInt();
1195 Smi* smi_bytecode_offset = Smi::FromInt(raw_bytecode_offset); 1204 Smi* smi_bytecode_offset = Smi::FromInt(raw_bytecode_offset);
1196 WriteValueToOutput(smi_bytecode_offset, 0, frame_index, output_offset, 1205 WriteValueToOutput(smi_bytecode_offset, 0, frame_index, output_offset,
1197 "bytecode offset "); 1206 "bytecode offset ");
1198 1207
1199 // Translate the rest of the interpreter registers in the frame. 1208 // Translate the rest of the interpreter registers in the frame.
(...skipping 2511 matching lines...) Expand 10 before | Expand all | Expand 10 after
3711 DCHECK(value_info->IsMaterializedObject()); 3720 DCHECK(value_info->IsMaterializedObject());
3712 3721
3713 value_info->value_ = 3722 value_info->value_ =
3714 Handle<Object>(previously_materialized_objects->get(i), isolate_); 3723 Handle<Object>(previously_materialized_objects->get(i), isolate_);
3715 } 3724 }
3716 } 3725 }
3717 } 3726 }
3718 3727
3719 } // namespace internal 3728 } // namespace internal
3720 } // namespace v8 3729 } // namespace v8
OLDNEW
« no previous file with comments | « src/arm64/builtins-arm64.cc ('k') | src/frames.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698