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

Side by Side Diff: src/interpreter/handler-table-builder.cc

Issue 1670983003: [interpreter] Rename HandlerTable::depth field. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@local_interpreter-test-enable
Patch Set: Rebased. 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/full-codegen/full-codegen.cc ('k') | src/isolate.cc » ('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 2016 the V8 project authors. All rights reserved. 1 // Copyright 2016 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/handler-table-builder.h" 5 #include "src/interpreter/handler-table-builder.h"
6 6
7 #include "src/factory.h" 7 #include "src/factory.h"
8 #include "src/isolate.h" 8 #include "src/isolate.h"
9 #include "src/objects-inl.h" 9 #include "src/objects-inl.h"
10 10
11 namespace v8 { 11 namespace v8 {
12 namespace internal { 12 namespace internal {
13 namespace interpreter { 13 namespace interpreter {
14 14
15 HandlerTableBuilder::HandlerTableBuilder(Isolate* isolate, Zone* zone) 15 HandlerTableBuilder::HandlerTableBuilder(Isolate* isolate, Zone* zone)
16 : isolate_(isolate), entries_(zone) {} 16 : isolate_(isolate), entries_(zone) {}
17 17
18 Handle<HandlerTable> HandlerTableBuilder::ToHandlerTable() { 18 Handle<HandlerTable> HandlerTableBuilder::ToHandlerTable() {
19 int handler_table_size = static_cast<int>(entries_.size()); 19 int handler_table_size = static_cast<int>(entries_.size());
20 Handle<HandlerTable> table = 20 Handle<HandlerTable> table =
21 Handle<HandlerTable>::cast(isolate_->factory()->NewFixedArray( 21 Handle<HandlerTable>::cast(isolate_->factory()->NewFixedArray(
22 HandlerTable::LengthForRange(handler_table_size), TENURED)); 22 HandlerTable::LengthForRange(handler_table_size), TENURED));
23 for (int i = 0; i < handler_table_size; ++i) { 23 for (int i = 0; i < handler_table_size; ++i) {
24 Entry& entry = entries_[i]; 24 Entry& entry = entries_[i];
25 HandlerTable::CatchPrediction pred = 25 HandlerTable::CatchPrediction pred =
26 entry.will_catch ? HandlerTable::CAUGHT : HandlerTable::UNCAUGHT; 26 entry.will_catch ? HandlerTable::CAUGHT : HandlerTable::UNCAUGHT;
27 table->SetRangeStart(i, static_cast<int>(entry.offset_start)); 27 table->SetRangeStart(i, static_cast<int>(entry.offset_start));
28 table->SetRangeEnd(i, static_cast<int>(entry.offset_end)); 28 table->SetRangeEnd(i, static_cast<int>(entry.offset_end));
29 table->SetRangeHandler(i, static_cast<int>(entry.offset_target), pred); 29 table->SetRangeHandler(i, static_cast<int>(entry.offset_target), pred);
30 table->SetRangeDepth(i, entry.context.index()); 30 table->SetRangeData(i, entry.context.index());
31 } 31 }
32 return table; 32 return table;
33 } 33 }
34 34
35 35
36 int HandlerTableBuilder::NewHandlerEntry() { 36 int HandlerTableBuilder::NewHandlerEntry() {
37 int handler_id = static_cast<int>(entries_.size()); 37 int handler_id = static_cast<int>(entries_.size());
38 Entry entry = {0, 0, 0, Register(), false}; 38 Entry entry = {0, 0, 0, Register(), false};
39 entries_.push_back(entry); 39 entries_.push_back(entry);
40 return handler_id; 40 return handler_id;
(...skipping 23 matching lines...) Expand all
64 } 64 }
65 65
66 66
67 void HandlerTableBuilder::SetContextRegister(int handler_id, Register reg) { 67 void HandlerTableBuilder::SetContextRegister(int handler_id, Register reg) {
68 entries_[handler_id].context = reg; 68 entries_[handler_id].context = reg;
69 } 69 }
70 70
71 } // namespace interpreter 71 } // namespace interpreter
72 } // namespace internal 72 } // namespace internal
73 } // namespace v8 73 } // namespace v8
OLDNEW
« no previous file with comments | « src/full-codegen/full-codegen.cc ('k') | src/isolate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698