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/isolate.cc

Issue 2563613003: Revert of [wasm] Fix location for error in asm.js ToNumber conversion (Closed)
Patch Set: 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/frames.cc ('k') | src/messages.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 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 505 matching lines...) Expand 10 before | Expand all | Expand 10 after
516 const int wasm_function_index = wasm_frame->function_index(); 516 const int wasm_function_index = wasm_frame->function_index();
517 Code* code = wasm_frame->unchecked_code(); 517 Code* code = wasm_frame->unchecked_code();
518 Handle<AbstractCode> abstract_code(AbstractCode::cast(code), this); 518 Handle<AbstractCode> abstract_code(AbstractCode::cast(code), this);
519 const int offset = 519 const int offset =
520 static_cast<int>(wasm_frame->pc() - code->instruction_start()); 520 static_cast<int>(wasm_frame->pc() - code->instruction_start());
521 521
522 // TODO(wasm): The wasm object returned by the WasmFrame should always 522 // TODO(wasm): The wasm object returned by the WasmFrame should always
523 // be a wasm object. 523 // be a wasm object.
524 DCHECK(wasm::IsWasmInstance(*instance) || instance->IsUndefined(this)); 524 DCHECK(wasm::IsWasmInstance(*instance) || instance->IsUndefined(this));
525 525
526 int flags = 0; 526 int flags = wasm::WasmIsAsmJs(*instance, this)
527 if (wasm::WasmIsAsmJs(*instance, this)) { 527 ? FrameArray::kIsAsmJsWasmFrame
528 flags |= FrameArray::kIsAsmJsWasmFrame; 528 : FrameArray::kIsWasmFrame;
529 if (wasm_frame->at_to_number_conversion()) {
530 flags |= FrameArray::kAsmJsAtNumberConversion;
531 }
532 } else {
533 flags |= FrameArray::kIsWasmFrame;
534 }
535 529
536 elements = 530 elements =
537 FrameArray::AppendWasmFrame(elements, instance, wasm_function_index, 531 FrameArray::AppendWasmFrame(elements, instance, wasm_function_index,
538 abstract_code, offset, flags); 532 abstract_code, offset, flags);
539 } break; 533 } break;
540 534
541 default: 535 default:
542 break; 536 break;
543 } 537 }
544 } 538 }
(...skipping 1011 matching lines...) Expand 10 before | Expand all | Expand 10 after
1556 continue; 1550 continue;
1557 } 1551 }
1558 1552
1559 if (elements->IsAsmJsWasmFrame(i)) { 1553 if (elements->IsAsmJsWasmFrame(i)) {
1560 Handle<WasmCompiledModule> compiled_module( 1554 Handle<WasmCompiledModule> compiled_module(
1561 WasmInstanceObject::cast(elements->WasmInstance(i)) 1555 WasmInstanceObject::cast(elements->WasmInstance(i))
1562 ->get_compiled_module()); 1556 ->get_compiled_module());
1563 int func_index = elements->WasmFunctionIndex(i)->value(); 1557 int func_index = elements->WasmFunctionIndex(i)->value();
1564 int code_offset = elements->Offset(i)->value(); 1558 int code_offset = elements->Offset(i)->value();
1565 int byte_pos = elements->Code(i)->SourcePosition(code_offset); 1559 int byte_pos = elements->Code(i)->SourcePosition(code_offset);
1566 bool at_to_number_conversion =
1567 elements->Flags(i)->value() & FrameArray::kAsmJsAtNumberConversion;
1568 int source_pos = WasmCompiledModule::GetAsmJsSourcePosition( 1560 int source_pos = WasmCompiledModule::GetAsmJsSourcePosition(
1569 compiled_module, func_index, byte_pos, at_to_number_conversion); 1561 compiled_module, func_index, byte_pos);
1570 Handle<Script> script = compiled_module->script(); 1562 Handle<Script> script = compiled_module->script();
1571 1563
1572 *target = MessageLocation(script, source_pos, source_pos + 1); 1564 *target = MessageLocation(script, source_pos, source_pos + 1);
1573 return true; 1565 return true;
1574 } 1566 }
1575 1567
1576 Handle<JSFunction> fun = handle(elements->Function(i), this); 1568 Handle<JSFunction> fun = handle(elements->Function(i), this);
1577 if (!fun->shared()->IsSubjectToDebugging()) continue; 1569 if (!fun->shared()->IsSubjectToDebugging()) continue;
1578 1570
1579 Object* script = fun->shared()->script(); 1571 Object* script = fun->shared()->script();
(...skipping 1944 matching lines...) Expand 10 before | Expand all | Expand 10 after
3524 // Then check whether this scope intercepts. 3516 // Then check whether this scope intercepts.
3525 if ((flag & intercept_mask_)) { 3517 if ((flag & intercept_mask_)) {
3526 intercepted_flags_ |= flag; 3518 intercepted_flags_ |= flag;
3527 return true; 3519 return true;
3528 } 3520 }
3529 return false; 3521 return false;
3530 } 3522 }
3531 3523
3532 } // namespace internal 3524 } // namespace internal
3533 } // namespace v8 3525 } // namespace v8
OLDNEW
« no previous file with comments | « src/frames.cc ('k') | src/messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698