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

Side by Side Diff: src/isolate.cc

Issue 2572623002: PromiseHandle port to TF (Closed)
Patch Set: Address comments Created 4 years 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/interface-descriptors.h ('k') | src/js/promise.js » ('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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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/isolate.h" 5 #include "src/isolate.h"
6 6
7 #include <stdlib.h> 7 #include <stdlib.h>
8 8
9 #include <fstream> // NOLINT(readability/streams) 9 #include <fstream> // NOLINT(readability/streams)
10 #include <sstream> 10 #include <sstream>
(...skipping 1324 matching lines...) Expand 10 before | Expand all | Expand 10 after
1335 HandlerTable::CatchPrediction prediction; 1335 HandlerTable::CatchPrediction prediction;
1336 if (frame->is_optimized()) { 1336 if (frame->is_optimized()) {
1337 if (frame->LookupExceptionHandlerInTable(nullptr, nullptr) > 0) { 1337 if (frame->LookupExceptionHandlerInTable(nullptr, nullptr) > 0) {
1338 // This optimized frame will catch. It's handler table does not include 1338 // This optimized frame will catch. It's handler table does not include
1339 // exception prediction, and we need to use the corresponding handler 1339 // exception prediction, and we need to use the corresponding handler
1340 // tables on the unoptimized code objects. 1340 // tables on the unoptimized code objects.
1341 List<FrameSummary> summaries; 1341 List<FrameSummary> summaries;
1342 frame->Summarize(&summaries); 1342 frame->Summarize(&summaries);
1343 for (const FrameSummary& summary : summaries) { 1343 for (const FrameSummary& summary : summaries) {
1344 Handle<AbstractCode> code = summary.abstract_code(); 1344 Handle<AbstractCode> code = summary.abstract_code();
1345 if (code->IsCode() && code->kind() == AbstractCode::BUILTIN && 1345 if (code->IsCode() && code->kind() == AbstractCode::BUILTIN) {
1346 code->GetCode()->is_promise_rejection()) { 1346 if (code->GetCode()->is_promise_rejection()) {
1347 return HandlerTable::PROMISE; 1347 return HandlerTable::PROMISE;
1348 }
1349
1350 // This the exception throw in PromiseHandle which doesn't
1351 // cause a promise rejection.
1352 if (code->GetCode()->is_exception_caught()) {
1353 return HandlerTable::CAUGHT;
1354 }
1348 } 1355 }
1356
1349 if (code->kind() == AbstractCode::OPTIMIZED_FUNCTION) { 1357 if (code->kind() == AbstractCode::OPTIMIZED_FUNCTION) {
1350 DCHECK(summary.function()->shared()->asm_function()); 1358 DCHECK(summary.function()->shared()->asm_function());
1351 // asm code cannot contain try-catch. 1359 // asm code cannot contain try-catch.
1352 continue; 1360 continue;
1353 } 1361 }
1354 // Must have been constructed from a bytecode array. 1362 // Must have been constructed from a bytecode array.
1355 CHECK_EQ(AbstractCode::INTERPRETED_FUNCTION, code->kind()); 1363 CHECK_EQ(AbstractCode::INTERPRETED_FUNCTION, code->kind());
1356 int code_offset = summary.code_offset(); 1364 int code_offset = summary.code_offset();
1357 BytecodeArray* bytecode = code->GetBytecodeArray(); 1365 BytecodeArray* bytecode = code->GetBytecodeArray();
1358 HandlerTable* table = HandlerTable::cast(bytecode->handler_table()); 1366 HandlerTable* table = HandlerTable::cast(bytecode->handler_table());
(...skipping 2194 matching lines...) Expand 10 before | Expand all | Expand 10 after
3553 // Then check whether this scope intercepts. 3561 // Then check whether this scope intercepts.
3554 if ((flag & intercept_mask_)) { 3562 if ((flag & intercept_mask_)) {
3555 intercepted_flags_ |= flag; 3563 intercepted_flags_ |= flag;
3556 return true; 3564 return true;
3557 } 3565 }
3558 return false; 3566 return false;
3559 } 3567 }
3560 3568
3561 } // namespace internal 3569 } // namespace internal
3562 } // namespace v8 3570 } // namespace v8
OLDNEW
« no previous file with comments | « src/interface-descriptors.h ('k') | src/js/promise.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698