OLD | NEW |
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 Loading... |
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 = wasm::WasmIsAsmJs(*instance, this) | 526 int flags = 0; |
527 ? FrameArray::kIsAsmJsWasmFrame | 527 if (wasm::WasmIsAsmJs(*instance, this)) { |
528 : FrameArray::kIsWasmFrame; | 528 flags |= FrameArray::kIsAsmJsWasmFrame; |
| 529 if (wasm_frame->at_to_number_conversion()) { |
| 530 flags |= FrameArray::kAsmJsAtNumberConversion; |
| 531 } |
| 532 } else { |
| 533 flags |= FrameArray::kIsWasmFrame; |
| 534 } |
529 | 535 |
530 elements = | 536 elements = |
531 FrameArray::AppendWasmFrame(elements, instance, wasm_function_index, | 537 FrameArray::AppendWasmFrame(elements, instance, wasm_function_index, |
532 abstract_code, offset, flags); | 538 abstract_code, offset, flags); |
533 } break; | 539 } break; |
534 | 540 |
535 default: | 541 default: |
536 break; | 542 break; |
537 } | 543 } |
538 } | 544 } |
(...skipping 1012 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1551 continue; | 1557 continue; |
1552 } | 1558 } |
1553 | 1559 |
1554 if (elements->IsAsmJsWasmFrame(i)) { | 1560 if (elements->IsAsmJsWasmFrame(i)) { |
1555 Handle<WasmCompiledModule> compiled_module( | 1561 Handle<WasmCompiledModule> compiled_module( |
1556 WasmInstanceObject::cast(elements->WasmInstance(i)) | 1562 WasmInstanceObject::cast(elements->WasmInstance(i)) |
1557 ->get_compiled_module()); | 1563 ->get_compiled_module()); |
1558 int func_index = elements->WasmFunctionIndex(i)->value(); | 1564 int func_index = elements->WasmFunctionIndex(i)->value(); |
1559 int code_offset = elements->Offset(i)->value(); | 1565 int code_offset = elements->Offset(i)->value(); |
1560 int byte_pos = elements->Code(i)->SourcePosition(code_offset); | 1566 int byte_pos = elements->Code(i)->SourcePosition(code_offset); |
| 1567 bool at_tonumber_conversion = |
| 1568 elements->Flags(i)->value() & FrameArray::kAsmJsAtNumberConversion; |
1561 int source_pos = WasmCompiledModule::GetAsmJsSourcePosition( | 1569 int source_pos = WasmCompiledModule::GetAsmJsSourcePosition( |
1562 compiled_module, func_index, byte_pos); | 1570 compiled_module, func_index, byte_pos, at_tonumber_conversion); |
1563 Handle<Script> script = compiled_module->script(); | 1571 Handle<Script> script = compiled_module->script(); |
1564 | 1572 |
1565 *target = MessageLocation(script, source_pos, source_pos + 1); | 1573 *target = MessageLocation(script, source_pos, source_pos + 1); |
1566 return true; | 1574 return true; |
1567 } | 1575 } |
1568 | 1576 |
1569 Handle<JSFunction> fun = handle(elements->Function(i), this); | 1577 Handle<JSFunction> fun = handle(elements->Function(i), this); |
1570 if (!fun->shared()->IsSubjectToDebugging()) continue; | 1578 if (!fun->shared()->IsSubjectToDebugging()) continue; |
1571 | 1579 |
1572 Object* script = fun->shared()->script(); | 1580 Object* script = fun->shared()->script(); |
(...skipping 1964 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3537 // Then check whether this scope intercepts. | 3545 // Then check whether this scope intercepts. |
3538 if ((flag & intercept_mask_)) { | 3546 if ((flag & intercept_mask_)) { |
3539 intercepted_flags_ |= flag; | 3547 intercepted_flags_ |= flag; |
3540 return true; | 3548 return true; |
3541 } | 3549 } |
3542 return false; | 3550 return false; |
3543 } | 3551 } |
3544 | 3552 |
3545 } // namespace internal | 3553 } // namespace internal |
3546 } // namespace v8 | 3554 } // namespace v8 |
OLD | NEW |