• Simon Zünd's avatar
    [torque] Add unsafe cast to Torque. · 9ef4df2f
    Simon Zünd authored
    This CL is a proposal to add "checked" casts (CAST in CSA) to the Torque language.
    The CL adds the "unsafe_cast<>" operator that emits a "CAST".
    
    Example:
    
    let n: Number = ...;
    ...
    if (TaggedIsSmi(n)) {
      let m: Smi = unsafe_cast<Smi>(n);
      ...
    }
    
    The cast wont incur a runtime overhead now.
    
    R=tebbi@chromium.org
    
    Change-Id: I9fca90d1d11e61617ba0270e5022fd66200e2195
    Reviewed-on: https://chromium-review.googlesource.com/1070151
    Commit-Queue: Simon Zünd <szuend@google.com>
    Reviewed-by: 's avatarTobias Tebbi <tebbi@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#53416}
    9ef4df2f
Name
Last commit
Last update
..
Torque.g4 Loading commit data...
TorqueBaseListener.cpp Loading commit data...
TorqueBaseListener.h Loading commit data...
TorqueBaseVisitor.cpp Loading commit data...
TorqueBaseVisitor.h Loading commit data...
TorqueLexer.cpp Loading commit data...
TorqueLexer.h Loading commit data...
TorqueListener.cpp Loading commit data...
TorqueListener.h Loading commit data...
TorqueParser.cpp Loading commit data...
TorqueParser.h Loading commit data...
TorqueVisitor.cpp Loading commit data...
TorqueVisitor.h Loading commit data...
ast-generator.cc Loading commit data...
ast-generator.h Loading commit data...
ast.h Loading commit data...
contextual.h Loading commit data...
declarable.cc Loading commit data...
declarable.h Loading commit data...
declaration-visitor.cc Loading commit data...
declaration-visitor.h Loading commit data...
declarations.cc Loading commit data...
declarations.h Loading commit data...
file-visitor.cc Loading commit data...
file-visitor.h Loading commit data...
global-context.h Loading commit data...
implementation-visitor.cc Loading commit data...
implementation-visitor.h Loading commit data...
scope.cc Loading commit data...
scope.h Loading commit data...
torque.cc Loading commit data...
type-oracle.h Loading commit data...
types.cc Loading commit data...
types.h Loading commit data...
utils.cc Loading commit data...
utils.h Loading commit data...