d8131cd63a
Stubs and builtins are very similar. The main differences are that stubs can be parameterized and may be generated at runtime, whereas builtins are generated at mksnapshot-time and shipped with the snapshot (or embedded into the binary). My main motivation for these conversions is that we can generate faster calls and jumps to (embedded) builtins callees from (embedded) builtin callers. Instead of going through the builtins constants table indirection, we can simply do a pc-relative call/jump. This also unlocks other refactorings, e.g. removal of CallRuntimeDelayed. TBR=mlippautz@chromium.org Bug: v8:6666 Change-Id: I4cd63477f19a330ec70bbf20e2af8a42fb05fabb Reviewed-on: https://chromium-review.googlesource.com/1044245 Reviewed-by: Jakob Gruber <jgruber@chromium.org> Reviewed-by: Michael Starzinger <mstarzinger@chromium.org> Commit-Queue: Jakob Gruber <jgruber@chromium.org> Cr-Commit-Position: refs/heads/master@{#53027}
88 lines
2.5 KiB
C++
88 lines
2.5 KiB
C++
// Copyright 2015 the V8 project authors. All rights reserved.
|
|
// Use of this source code is governed by a BSD-style license that can be
|
|
// found in the LICENSE file.
|
|
|
|
#include "src/type-hints.h"
|
|
|
|
namespace v8 {
|
|
namespace internal {
|
|
|
|
std::ostream& operator<<(std::ostream& os, BinaryOperationHint hint) {
|
|
switch (hint) {
|
|
case BinaryOperationHint::kNone:
|
|
return os << "None";
|
|
case BinaryOperationHint::kSignedSmall:
|
|
return os << "SignedSmall";
|
|
case BinaryOperationHint::kSignedSmallInputs:
|
|
return os << "SignedSmallInputs";
|
|
case BinaryOperationHint::kSigned32:
|
|
return os << "Signed32";
|
|
case BinaryOperationHint::kNumber:
|
|
return os << "Number";
|
|
case BinaryOperationHint::kNumberOrOddball:
|
|
return os << "NumberOrOddball";
|
|
case BinaryOperationHint::kString:
|
|
return os << "String";
|
|
case BinaryOperationHint::kBigInt:
|
|
return os << "BigInt";
|
|
case BinaryOperationHint::kAny:
|
|
return os << "Any";
|
|
}
|
|
UNREACHABLE();
|
|
}
|
|
|
|
std::ostream& operator<<(std::ostream& os, CompareOperationHint hint) {
|
|
switch (hint) {
|
|
case CompareOperationHint::kNone:
|
|
return os << "None";
|
|
case CompareOperationHint::kSignedSmall:
|
|
return os << "SignedSmall";
|
|
case CompareOperationHint::kNumber:
|
|
return os << "Number";
|
|
case CompareOperationHint::kNumberOrOddball:
|
|
return os << "NumberOrOddball";
|
|
case CompareOperationHint::kInternalizedString:
|
|
return os << "InternalizedString";
|
|
case CompareOperationHint::kString:
|
|
return os << "String";
|
|
case CompareOperationHint::kSymbol:
|
|
return os << "Symbol";
|
|
case CompareOperationHint::kBigInt:
|
|
return os << "BigInt";
|
|
case CompareOperationHint::kReceiver:
|
|
return os << "Receiver";
|
|
case CompareOperationHint::kAny:
|
|
return os << "Any";
|
|
}
|
|
UNREACHABLE();
|
|
}
|
|
|
|
std::ostream& operator<<(std::ostream& os, ForInHint hint) {
|
|
switch (hint) {
|
|
case ForInHint::kNone:
|
|
return os << "None";
|
|
case ForInHint::kEnumCacheKeys:
|
|
return os << "EnumCacheKeys";
|
|
case ForInHint::kEnumCacheKeysAndIndices:
|
|
return os << "EnumCacheKeysAndIndices";
|
|
case ForInHint::kAny:
|
|
return os << "Any";
|
|
}
|
|
UNREACHABLE();
|
|
}
|
|
|
|
std::ostream& operator<<(std::ostream& os, const StringAddFlags& flags) {
|
|
switch (flags) {
|
|
case STRING_ADD_CHECK_NONE:
|
|
return os << "CheckNone";
|
|
case STRING_ADD_CONVERT_LEFT:
|
|
return os << "ConvertLeft";
|
|
case STRING_ADD_CONVERT_RIGHT:
|
|
return os << "ConvertRight";
|
|
}
|
|
UNREACHABLE();
|
|
}
|
|
|
|
} // namespace internal
|
|
} // namespace v8
|