Rename NumberInfo to TypeInfo.

Since we add more type (StringType, PrimitiveType) the name
NumberInfo does not make sense anymore.

Review URL: http://codereview.chromium.org/1207006

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4268 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 4cd39f12
...@@ -295,7 +295,7 @@ void VirtualFrame::EmitPop(Register reg) { ...@@ -295,7 +295,7 @@ void VirtualFrame::EmitPop(Register reg) {
void VirtualFrame::EmitPush(Register reg) { void VirtualFrame::EmitPush(Register reg) {
ASSERT(stack_pointer_ == element_count() - 1); ASSERT(stack_pointer_ == element_count() - 1);
elements_.Add(FrameElement::MemoryElement(NumberInfo::Unknown())); elements_.Add(FrameElement::MemoryElement(TypeInfo::Unknown()));
stack_pointer_++; stack_pointer_++;
__ push(reg); __ push(reg);
} }
......
...@@ -69,7 +69,7 @@ class VirtualFrame : public ZoneObject { ...@@ -69,7 +69,7 @@ class VirtualFrame : public ZoneObject {
// Create a duplicate of an existing valid frame element. // Create a duplicate of an existing valid frame element.
FrameElement CopyElementAt(int index, FrameElement CopyElementAt(int index,
NumberInfo info = NumberInfo::Unknown()); TypeInfo info = TypeInfo::Unknown());
// The number of elements on the virtual frame. // The number of elements on the virtual frame.
int element_count() { return elements_.length(); } int element_count() { return elements_.length(); }
...@@ -344,7 +344,7 @@ class VirtualFrame : public ZoneObject { ...@@ -344,7 +344,7 @@ class VirtualFrame : public ZoneObject {
void EmitPushMultiple(int count, int src_regs); void EmitPushMultiple(int count, int src_regs);
// Push an element on the virtual frame. // Push an element on the virtual frame.
inline void Push(Register reg, NumberInfo info = NumberInfo::Unknown()); inline void Push(Register reg, TypeInfo info = TypeInfo::Unknown());
inline void Push(Handle<Object> value); inline void Push(Handle<Object> value);
inline void Push(Smi* value); inline void Push(Smi* value);
...@@ -364,8 +364,8 @@ class VirtualFrame : public ZoneObject { ...@@ -364,8 +364,8 @@ class VirtualFrame : public ZoneObject {
// the frame. Nip(k) is equivalent to x = Pop(), Drop(k), Push(x). // the frame. Nip(k) is equivalent to x = Pop(), Drop(k), Push(x).
inline void Nip(int num_dropped); inline void Nip(int num_dropped);
inline void SetTypeForLocalAt(int index, NumberInfo info); inline void SetTypeForLocalAt(int index, TypeInfo info);
inline void SetTypeForParamAt(int index, NumberInfo info); inline void SetTypeForParamAt(int index, TypeInfo info);
private: private:
static const int kLocal0Offset = JavaScriptFrameConstants::kLocal0Offset; static const int kLocal0Offset = JavaScriptFrameConstants::kLocal0Offset;
......
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
#include "ast.h" #include "ast.h"
#include "code-stubs.h" #include "code-stubs.h"
#include "runtime.h" #include "runtime.h"
#include "number-info.h" #include "type-info.h"
// Include the declaration of the architecture defined class CodeGenerator. // Include the declaration of the architecture defined class CodeGenerator.
// The contract to the shared code is that the the CodeGenerator is a subclass // The contract to the shared code is that the the CodeGenerator is a subclass
......
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
#ifndef V8_FRAME_ELEMENT_H_ #ifndef V8_FRAME_ELEMENT_H_
#define V8_FRAME_ELEMENT_H_ #define V8_FRAME_ELEMENT_H_
#include "number-info-inl.h" #include "type-info-inl.h"
#include "macro-assembler.h" #include "macro-assembler.h"
#include "zone.h" #include "zone.h"
...@@ -54,19 +54,19 @@ class FrameElement BASE_EMBEDDED { ...@@ -54,19 +54,19 @@ class FrameElement BASE_EMBEDDED {
SYNCED SYNCED
}; };
inline NumberInfo number_info() { inline TypeInfo type_info() {
// Copied elements do not have number info. Instead // Copied elements do not have type info. Instead
// we have to inspect their backing element in the frame. // we have to inspect their backing element in the frame.
ASSERT(!is_copy()); ASSERT(!is_copy());
return NumberInfo::FromInt(NumberInfoField::decode(value_)); return TypeInfo::FromInt(TypeInfoField::decode(value_));
} }
inline void set_number_info(NumberInfo info) { inline void set_type_info(TypeInfo info) {
// Copied elements do not have number info. Instead // Copied elements do not have type info. Instead
// we have to inspect their backing element in the frame. // we have to inspect their backing element in the frame.
ASSERT(!is_copy()); ASSERT(!is_copy());
value_ = value_ & ~NumberInfoField::mask(); value_ = value_ & ~TypeInfoField::mask();
value_ = value_ | NumberInfoField::encode(info.ToInt()); value_ = value_ | TypeInfoField::encode(info.ToInt());
} }
// The default constructor creates an invalid frame element. // The default constructor creates an invalid frame element.
...@@ -74,7 +74,7 @@ class FrameElement BASE_EMBEDDED { ...@@ -74,7 +74,7 @@ class FrameElement BASE_EMBEDDED {
value_ = TypeField::encode(INVALID) value_ = TypeField::encode(INVALID)
| CopiedField::encode(false) | CopiedField::encode(false)
| SyncedField::encode(false) | SyncedField::encode(false)
| NumberInfoField::encode(NumberInfo::Uninitialized().ToInt()) | TypeInfoField::encode(TypeInfo::Uninitialized().ToInt())
| DataField::encode(0); | DataField::encode(0);
} }
...@@ -85,7 +85,7 @@ class FrameElement BASE_EMBEDDED { ...@@ -85,7 +85,7 @@ class FrameElement BASE_EMBEDDED {
} }
// Factory function to construct an in-memory frame element. // Factory function to construct an in-memory frame element.
static FrameElement MemoryElement(NumberInfo info) { static FrameElement MemoryElement(TypeInfo info) {
FrameElement result(MEMORY, no_reg, SYNCED, info); FrameElement result(MEMORY, no_reg, SYNCED, info);
return result; return result;
} }
...@@ -93,7 +93,7 @@ class FrameElement BASE_EMBEDDED { ...@@ -93,7 +93,7 @@ class FrameElement BASE_EMBEDDED {
// Factory function to construct an in-register frame element. // Factory function to construct an in-register frame element.
static FrameElement RegisterElement(Register reg, static FrameElement RegisterElement(Register reg,
SyncFlag is_synced, SyncFlag is_synced,
NumberInfo info) { TypeInfo info) {
return FrameElement(REGISTER, reg, is_synced, info); return FrameElement(REGISTER, reg, is_synced, info);
} }
...@@ -101,7 +101,7 @@ class FrameElement BASE_EMBEDDED { ...@@ -101,7 +101,7 @@ class FrameElement BASE_EMBEDDED {
// compile time. // compile time.
static FrameElement ConstantElement(Handle<Object> value, static FrameElement ConstantElement(Handle<Object> value,
SyncFlag is_synced) { SyncFlag is_synced) {
NumberInfo info = NumberInfo::TypeFromValue(value); TypeInfo info = TypeInfo::TypeFromValue(value);
FrameElement result(value, is_synced, info); FrameElement result(value, is_synced, info);
return result; return result;
} }
...@@ -218,20 +218,20 @@ class FrameElement BASE_EMBEDDED { ...@@ -218,20 +218,20 @@ class FrameElement BASE_EMBEDDED {
FrameElement(Type type, FrameElement(Type type,
Register reg, Register reg,
SyncFlag is_synced, SyncFlag is_synced,
NumberInfo info) { TypeInfo info) {
value_ = TypeField::encode(type) value_ = TypeField::encode(type)
| CopiedField::encode(false) | CopiedField::encode(false)
| SyncedField::encode(is_synced != NOT_SYNCED) | SyncedField::encode(is_synced != NOT_SYNCED)
| NumberInfoField::encode(info.ToInt()) | TypeInfoField::encode(info.ToInt())
| DataField::encode(reg.code_ > 0 ? reg.code_ : 0); | DataField::encode(reg.code_ > 0 ? reg.code_ : 0);
} }
// Used to construct constant elements. // Used to construct constant elements.
FrameElement(Handle<Object> value, SyncFlag is_synced, NumberInfo info) { FrameElement(Handle<Object> value, SyncFlag is_synced, TypeInfo info) {
value_ = TypeField::encode(CONSTANT) value_ = TypeField::encode(CONSTANT)
| CopiedField::encode(false) | CopiedField::encode(false)
| SyncedField::encode(is_synced != NOT_SYNCED) | SyncedField::encode(is_synced != NOT_SYNCED)
| NumberInfoField::encode(info.ToInt()) | TypeInfoField::encode(info.ToInt())
| DataField::encode(ConstantList()->length()); | DataField::encode(ConstantList()->length());
ConstantList()->Add(value); ConstantList()->Add(value);
} }
...@@ -262,7 +262,7 @@ class FrameElement BASE_EMBEDDED { ...@@ -262,7 +262,7 @@ class FrameElement BASE_EMBEDDED {
class CopiedField: public BitField<bool, 3, 1> {}; class CopiedField: public BitField<bool, 3, 1> {};
class SyncedField: public BitField<bool, 4, 1> {}; class SyncedField: public BitField<bool, 4, 1> {};
class UntaggedInt32Field: public BitField<bool, 5, 1> {}; class UntaggedInt32Field: public BitField<bool, 5, 1> {};
class NumberInfoField: public BitField<int, 6, 6> {}; class TypeInfoField: public BitField<int, 6, 6> {};
class DataField: public BitField<uint32_t, 12, 32 - 12> {}; class DataField: public BitField<uint32_t, 12, 32 - 12> {};
friend class VirtualFrame; friend class VirtualFrame;
......
...@@ -850,7 +850,7 @@ void CodeGenerator::ToBoolean(ControlDestination* dest) { ...@@ -850,7 +850,7 @@ void CodeGenerator::ToBoolean(ControlDestination* dest) {
dest->Split(not_zero); dest->Split(not_zero);
} else if (value.is_number()) { } else if (value.is_number()) {
Comment cmnt(masm_, "ONLY_NUMBER"); Comment cmnt(masm_, "ONLY_NUMBER");
// Fast case if NumberInfo indicates only numbers. // Fast case if TypeInfo indicates only numbers.
if (FLAG_debug_code) { if (FLAG_debug_code) {
__ AbortIfNotNumber(value.reg()); __ AbortIfNotNumber(value.reg());
} }
...@@ -934,11 +934,11 @@ class FloatingPointHelper : public AllStatic { ...@@ -934,11 +934,11 @@ class FloatingPointHelper : public AllStatic {
// Takes the operands in edx and eax and loads them as integers in eax // Takes the operands in edx and eax and loads them as integers in eax
// and ecx. // and ecx.
static void LoadAsIntegers(MacroAssembler* masm, static void LoadAsIntegers(MacroAssembler* masm,
NumberInfo number_info, TypeInfo type_info,
bool use_sse3, bool use_sse3,
Label* operand_conversion_failure); Label* operand_conversion_failure);
static void LoadNumbersAsIntegers(MacroAssembler* masm, static void LoadNumbersAsIntegers(MacroAssembler* masm,
NumberInfo number_info, TypeInfo type_info,
bool use_sse3, bool use_sse3,
Label* operand_conversion_failure); Label* operand_conversion_failure);
static void LoadUnknownsAsIntegers(MacroAssembler* masm, static void LoadUnknownsAsIntegers(MacroAssembler* masm,
...@@ -996,8 +996,8 @@ class DeferredInlineBinaryOperation: public DeferredCode { ...@@ -996,8 +996,8 @@ class DeferredInlineBinaryOperation: public DeferredCode {
Register dst, Register dst,
Register left, Register left,
Register right, Register right,
NumberInfo left_info, TypeInfo left_info,
NumberInfo right_info, TypeInfo right_info,
OverwriteMode mode) OverwriteMode mode)
: op_(op), dst_(dst), left_(left), right_(right), : op_(op), dst_(dst), left_(left), right_(right),
left_info_(left_info), right_info_(right_info), mode_(mode) { left_info_(left_info), right_info_(right_info), mode_(mode) {
...@@ -1011,8 +1011,8 @@ class DeferredInlineBinaryOperation: public DeferredCode { ...@@ -1011,8 +1011,8 @@ class DeferredInlineBinaryOperation: public DeferredCode {
Register dst_; Register dst_;
Register left_; Register left_;
Register right_; Register right_;
NumberInfo left_info_; TypeInfo left_info_;
NumberInfo right_info_; TypeInfo right_info_;
OverwriteMode mode_; OverwriteMode mode_;
}; };
...@@ -1106,23 +1106,23 @@ void DeferredInlineBinaryOperation::Generate() { ...@@ -1106,23 +1106,23 @@ void DeferredInlineBinaryOperation::Generate() {
GenericBinaryOpStub stub(op_, GenericBinaryOpStub stub(op_,
mode_, mode_,
NO_SMI_CODE_IN_STUB, NO_SMI_CODE_IN_STUB,
NumberInfo::Combine(left_info_, right_info_)); TypeInfo::Combine(left_info_, right_info_));
stub.GenerateCall(masm_, left_, right_); stub.GenerateCall(masm_, left_, right_);
if (!dst_.is(eax)) __ mov(dst_, eax); if (!dst_.is(eax)) __ mov(dst_, eax);
__ bind(&done); __ bind(&done);
} }
static NumberInfo CalculateNumberInfo(NumberInfo operands_type, static TypeInfo CalculateTypeInfo(TypeInfo operands_type,
Token::Value op, Token::Value op,
const Result& right, const Result& right,
const Result& left) { const Result& left) {
// Set NumberInfo of result according to the operation performed. // Set TypeInfo of result according to the operation performed.
// Rely on the fact that smis have a 31 bit payload on ia32. // Rely on the fact that smis have a 31 bit payload on ia32.
ASSERT(kSmiValueSize == 31); ASSERT(kSmiValueSize == 31);
switch (op) { switch (op) {
case Token::COMMA: case Token::COMMA:
return right.number_info(); return right.type_info();
case Token::OR: case Token::OR:
case Token::AND: case Token::AND:
// Result type can be either of the two input types. // Result type can be either of the two input types.
...@@ -1131,74 +1131,74 @@ static NumberInfo CalculateNumberInfo(NumberInfo operands_type, ...@@ -1131,74 +1131,74 @@ static NumberInfo CalculateNumberInfo(NumberInfo operands_type,
// Anding with positive Smis will give you a Smi. // Anding with positive Smis will give you a Smi.
if (right.is_constant() && right.handle()->IsSmi() && if (right.is_constant() && right.handle()->IsSmi() &&
Smi::cast(*right.handle())->value() >= 0) { Smi::cast(*right.handle())->value() >= 0) {
return NumberInfo::Smi(); return TypeInfo::Smi();
} else if (left.is_constant() && left.handle()->IsSmi() && } else if (left.is_constant() && left.handle()->IsSmi() &&
Smi::cast(*left.handle())->value() >= 0) { Smi::cast(*left.handle())->value() >= 0) {
return NumberInfo::Smi(); return TypeInfo::Smi();
} }
return (operands_type.IsSmi()) return (operands_type.IsSmi())
? NumberInfo::Smi() ? TypeInfo::Smi()
: NumberInfo::Integer32(); : TypeInfo::Integer32();
} }
case Token::BIT_OR: { case Token::BIT_OR: {
// Oring with negative Smis will give you a Smi. // Oring with negative Smis will give you a Smi.
if (right.is_constant() && right.handle()->IsSmi() && if (right.is_constant() && right.handle()->IsSmi() &&
Smi::cast(*right.handle())->value() < 0) { Smi::cast(*right.handle())->value() < 0) {
return NumberInfo::Smi(); return TypeInfo::Smi();
} else if (left.is_constant() && left.handle()->IsSmi() && } else if (left.is_constant() && left.handle()->IsSmi() &&
Smi::cast(*left.handle())->value() < 0) { Smi::cast(*left.handle())->value() < 0) {
return NumberInfo::Smi(); return TypeInfo::Smi();
} }
return (operands_type.IsSmi()) return (operands_type.IsSmi())
? NumberInfo::Smi() ? TypeInfo::Smi()
: NumberInfo::Integer32(); : TypeInfo::Integer32();
} }
case Token::BIT_XOR: case Token::BIT_XOR:
// Result is always a 32 bit integer. Smi property of inputs is preserved. // Result is always a 32 bit integer. Smi property of inputs is preserved.
return (operands_type.IsSmi()) return (operands_type.IsSmi())
? NumberInfo::Smi() ? TypeInfo::Smi()
: NumberInfo::Integer32(); : TypeInfo::Integer32();
case Token::SAR: case Token::SAR:
if (left.is_smi()) return NumberInfo::Smi(); if (left.is_smi()) return TypeInfo::Smi();
// Result is a smi if we shift by a constant >= 1, otherwise an integer32. // Result is a smi if we shift by a constant >= 1, otherwise an integer32.
return (right.is_constant() && right.handle()->IsSmi() return (right.is_constant() && right.handle()->IsSmi()
&& Smi::cast(*right.handle())->value() >= 1) && Smi::cast(*right.handle())->value() >= 1)
? NumberInfo::Smi() ? TypeInfo::Smi()
: NumberInfo::Integer32(); : TypeInfo::Integer32();
case Token::SHR: case Token::SHR:
// Result is a smi if we shift by a constant >= 2, otherwise an integer32. // Result is a smi if we shift by a constant >= 2, otherwise an integer32.
return (right.is_constant() && right.handle()->IsSmi() return (right.is_constant() && right.handle()->IsSmi()
&& Smi::cast(*right.handle())->value() >= 2) && Smi::cast(*right.handle())->value() >= 2)
? NumberInfo::Smi() ? TypeInfo::Smi()
: NumberInfo::Integer32(); : TypeInfo::Integer32();
case Token::ADD: case Token::ADD:
if (operands_type.IsSmi()) { if (operands_type.IsSmi()) {
// The Integer32 range is big enough to take the sum of any two Smis. // The Integer32 range is big enough to take the sum of any two Smis.
return NumberInfo::Integer32(); return TypeInfo::Integer32();
} else { } else {
// Result could be a string or a number. Check types of inputs. // Result could be a string or a number. Check types of inputs.
return operands_type.IsNumber() return operands_type.IsNumber()
? NumberInfo::Number() ? TypeInfo::Number()
: NumberInfo::Unknown(); : TypeInfo::Unknown();
} }
case Token::SHL: case Token::SHL:
return NumberInfo::Integer32(); return TypeInfo::Integer32();
case Token::SUB: case Token::SUB:
// The Integer32 range is big enough to take the difference of any two // The Integer32 range is big enough to take the difference of any two
// Smis. // Smis.
return (operands_type.IsSmi()) ? return (operands_type.IsSmi()) ?
NumberInfo::Integer32() : TypeInfo::Integer32() :
NumberInfo::Number(); TypeInfo::Number();
case Token::MUL: case Token::MUL:
case Token::DIV: case Token::DIV:
case Token::MOD: case Token::MOD:
// Result is always a number. // Result is always a number.
return NumberInfo::Number(); return TypeInfo::Number();
default: default:
UNREACHABLE(); UNREACHABLE();
} }
UNREACHABLE(); UNREACHABLE();
return NumberInfo::Unknown(); return TypeInfo::Unknown();
} }
...@@ -1258,10 +1258,10 @@ void CodeGenerator::GenericBinaryOperation(Token::Value op, ...@@ -1258,10 +1258,10 @@ void CodeGenerator::GenericBinaryOperation(Token::Value op,
} }
// Get number type of left and right sub-expressions. // Get number type of left and right sub-expressions.
NumberInfo operands_type = TypeInfo operands_type =
NumberInfo::Combine(left.number_info(), right.number_info()); TypeInfo::Combine(left.type_info(), right.type_info());
NumberInfo result_type = CalculateNumberInfo(operands_type, op, right, left); TypeInfo result_type = CalculateTypeInfo(operands_type, op, right, left);
Result answer; Result answer;
if (left_is_non_smi_constant || right_is_non_smi_constant) { if (left_is_non_smi_constant || right_is_non_smi_constant) {
...@@ -1300,7 +1300,7 @@ void CodeGenerator::GenericBinaryOperation(Token::Value op, ...@@ -1300,7 +1300,7 @@ void CodeGenerator::GenericBinaryOperation(Token::Value op,
} }
} }
answer.set_number_info(result_type); answer.set_type_info(result_type);
frame_->Push(&answer); frame_->Push(&answer);
} }
...@@ -1388,7 +1388,7 @@ bool CodeGenerator::FoldConstantSmis(Token::Value op, int left, int right) { ...@@ -1388,7 +1388,7 @@ bool CodeGenerator::FoldConstantSmis(Token::Value op, int left, int right) {
static void CheckTwoForSminess(MacroAssembler* masm, static void CheckTwoForSminess(MacroAssembler* masm,
Register left, Register right, Register scratch, Register left, Register right, Register scratch,
NumberInfo left_info, NumberInfo right_info, TypeInfo left_info, TypeInfo right_info,
DeferredInlineBinaryOperation* deferred); DeferredInlineBinaryOperation* deferred);
...@@ -1473,8 +1473,8 @@ Result CodeGenerator::LikelySmiBinaryOperation(Token::Value op, ...@@ -1473,8 +1473,8 @@ Result CodeGenerator::LikelySmiBinaryOperation(Token::Value op,
(op == Token::DIV) ? eax : edx, (op == Token::DIV) ? eax : edx,
left->reg(), left->reg(),
right->reg(), right->reg(),
left->number_info(), left->type_info(),
right->number_info(), right->type_info(),
overwrite_mode); overwrite_mode);
if (left->reg().is(right->reg())) { if (left->reg().is(right->reg())) {
__ test(left->reg(), Immediate(kSmiTagMask)); __ test(left->reg(), Immediate(kSmiTagMask));
...@@ -1577,18 +1577,18 @@ Result CodeGenerator::LikelySmiBinaryOperation(Token::Value op, ...@@ -1577,18 +1577,18 @@ Result CodeGenerator::LikelySmiBinaryOperation(Token::Value op,
answer.reg(), answer.reg(),
left->reg(), left->reg(),
ecx, ecx,
left->number_info(), left->type_info(),
right->number_info(), right->type_info(),
overwrite_mode); overwrite_mode);
Label do_op, left_nonsmi; Label do_op, left_nonsmi;
// If right is a smi we make a fast case if left is either a smi // If right is a smi we make a fast case if left is either a smi
// or a heapnumber. // or a heapnumber.
if (CpuFeatures::IsSupported(SSE2) && right->number_info().IsSmi()) { if (CpuFeatures::IsSupported(SSE2) && right->type_info().IsSmi()) {
CpuFeatures::Scope use_sse2(SSE2); CpuFeatures::Scope use_sse2(SSE2);
__ mov(answer.reg(), left->reg()); __ mov(answer.reg(), left->reg());
// Fast case - both are actually smis. // Fast case - both are actually smis.
if (!left->number_info().IsSmi()) { if (!left->type_info().IsSmi()) {
__ test(answer.reg(), Immediate(kSmiTagMask)); __ test(answer.reg(), Immediate(kSmiTagMask));
__ j(not_zero, &left_nonsmi); __ j(not_zero, &left_nonsmi);
} else { } else {
...@@ -1612,7 +1612,7 @@ Result CodeGenerator::LikelySmiBinaryOperation(Token::Value op, ...@@ -1612,7 +1612,7 @@ Result CodeGenerator::LikelySmiBinaryOperation(Token::Value op,
deferred->Branch(negative); deferred->Branch(negative);
} else { } else {
CheckTwoForSminess(masm_, left->reg(), right->reg(), answer.reg(), CheckTwoForSminess(masm_, left->reg(), right->reg(), answer.reg(),
left->number_info(), right->number_info(), deferred); left->type_info(), right->type_info(), deferred);
// Untag both operands. // Untag both operands.
__ mov(answer.reg(), left->reg()); __ mov(answer.reg(), left->reg());
...@@ -1685,11 +1685,11 @@ Result CodeGenerator::LikelySmiBinaryOperation(Token::Value op, ...@@ -1685,11 +1685,11 @@ Result CodeGenerator::LikelySmiBinaryOperation(Token::Value op,
answer.reg(), answer.reg(),
left->reg(), left->reg(),
right->reg(), right->reg(),
left->number_info(), left->type_info(),
right->number_info(), right->type_info(),
overwrite_mode); overwrite_mode);
CheckTwoForSminess(masm_, left->reg(), right->reg(), answer.reg(), CheckTwoForSminess(masm_, left->reg(), right->reg(), answer.reg(),
left->number_info(), right->number_info(), deferred); left->type_info(), right->type_info(), deferred);
__ mov(answer.reg(), left->reg()); __ mov(answer.reg(), left->reg());
switch (op) { switch (op) {
...@@ -1761,16 +1761,16 @@ class DeferredInlineSmiOperation: public DeferredCode { ...@@ -1761,16 +1761,16 @@ class DeferredInlineSmiOperation: public DeferredCode {
DeferredInlineSmiOperation(Token::Value op, DeferredInlineSmiOperation(Token::Value op,
Register dst, Register dst,
Register src, Register src,
NumberInfo number_info, TypeInfo type_info,
Smi* value, Smi* value,
OverwriteMode overwrite_mode) OverwriteMode overwrite_mode)
: op_(op), : op_(op),
dst_(dst), dst_(dst),
src_(src), src_(src),
number_info_(number_info), type_info_(type_info),
value_(value), value_(value),
overwrite_mode_(overwrite_mode) { overwrite_mode_(overwrite_mode) {
if (number_info.IsSmi()) overwrite_mode_ = NO_OVERWRITE; if (type_info.IsSmi()) overwrite_mode_ = NO_OVERWRITE;
set_comment("[ DeferredInlineSmiOperation"); set_comment("[ DeferredInlineSmiOperation");
} }
...@@ -1780,7 +1780,7 @@ class DeferredInlineSmiOperation: public DeferredCode { ...@@ -1780,7 +1780,7 @@ class DeferredInlineSmiOperation: public DeferredCode {
Token::Value op_; Token::Value op_;
Register dst_; Register dst_;
Register src_; Register src_;
NumberInfo number_info_; TypeInfo type_info_;
Smi* value_; Smi* value_;
OverwriteMode overwrite_mode_; OverwriteMode overwrite_mode_;
}; };
...@@ -1792,7 +1792,7 @@ void DeferredInlineSmiOperation::Generate() { ...@@ -1792,7 +1792,7 @@ void DeferredInlineSmiOperation::Generate() {
op_, op_,
overwrite_mode_, overwrite_mode_,
(op_ == Token::MOD) ? NO_GENERIC_BINARY_FLAGS : NO_SMI_CODE_IN_STUB, (op_ == Token::MOD) ? NO_GENERIC_BINARY_FLAGS : NO_SMI_CODE_IN_STUB,
NumberInfo::Combine(NumberInfo::Smi(), number_info_)); TypeInfo::Combine(TypeInfo::Smi(), type_info_));
stub.GenerateCall(masm_, src_, value_); stub.GenerateCall(masm_, src_, value_);
if (!dst_.is(eax)) __ mov(dst_, eax); if (!dst_.is(eax)) __ mov(dst_, eax);
} }
...@@ -1806,11 +1806,11 @@ class DeferredInlineSmiOperationReversed: public DeferredCode { ...@@ -1806,11 +1806,11 @@ class DeferredInlineSmiOperationReversed: public DeferredCode {
Register dst, Register dst,
Smi* value, Smi* value,
Register src, Register src,
NumberInfo number_info, TypeInfo type_info,
OverwriteMode overwrite_mode) OverwriteMode overwrite_mode)
: op_(op), : op_(op),
dst_(dst), dst_(dst),
number_info_(number_info), type_info_(type_info),
value_(value), value_(value),
src_(src), src_(src),
overwrite_mode_(overwrite_mode) { overwrite_mode_(overwrite_mode) {
...@@ -1822,7 +1822,7 @@ class DeferredInlineSmiOperationReversed: public DeferredCode { ...@@ -1822,7 +1822,7 @@ class DeferredInlineSmiOperationReversed: public DeferredCode {
private: private:
Token::Value op_; Token::Value op_;
Register dst_; Register dst_;
NumberInfo number_info_; TypeInfo type_info_;
Smi* value_; Smi* value_;
Register src_; Register src_;
OverwriteMode overwrite_mode_; OverwriteMode overwrite_mode_;
...@@ -1834,7 +1834,7 @@ void DeferredInlineSmiOperationReversed::Generate() { ...@@ -1834,7 +1834,7 @@ void DeferredInlineSmiOperationReversed::Generate() {
op_, op_,
overwrite_mode_, overwrite_mode_,
NO_SMI_CODE_IN_STUB, NO_SMI_CODE_IN_STUB,
NumberInfo::Combine(NumberInfo::Smi(), number_info_)); TypeInfo::Combine(TypeInfo::Smi(), type_info_));
igostub.GenerateCall(masm_, value_, src_); igostub.GenerateCall(masm_, value_, src_);
if (!dst_.is(eax)) __ mov(dst_, eax); if (!dst_.is(eax)) __ mov(dst_, eax);
} }
...@@ -1846,14 +1846,14 @@ void DeferredInlineSmiOperationReversed::Generate() { ...@@ -1846,14 +1846,14 @@ void DeferredInlineSmiOperationReversed::Generate() {
class DeferredInlineSmiAdd: public DeferredCode { class DeferredInlineSmiAdd: public DeferredCode {
public: public:
DeferredInlineSmiAdd(Register dst, DeferredInlineSmiAdd(Register dst,
NumberInfo number_info, TypeInfo type_info,
Smi* value, Smi* value,
OverwriteMode overwrite_mode) OverwriteMode overwrite_mode)
: dst_(dst), : dst_(dst),
number_info_(number_info), type_info_(type_info),
value_(value), value_(value),
overwrite_mode_(overwrite_mode) { overwrite_mode_(overwrite_mode) {
if (number_info_.IsSmi()) overwrite_mode_ = NO_OVERWRITE; if (type_info_.IsSmi()) overwrite_mode_ = NO_OVERWRITE;
set_comment("[ DeferredInlineSmiAdd"); set_comment("[ DeferredInlineSmiAdd");
} }
...@@ -1861,7 +1861,7 @@ class DeferredInlineSmiAdd: public DeferredCode { ...@@ -1861,7 +1861,7 @@ class DeferredInlineSmiAdd: public DeferredCode {
private: private:
Register dst_; Register dst_;
NumberInfo number_info_; TypeInfo type_info_;
Smi* value_; Smi* value_;
OverwriteMode overwrite_mode_; OverwriteMode overwrite_mode_;
}; };
...@@ -1874,7 +1874,7 @@ void DeferredInlineSmiAdd::Generate() { ...@@ -1874,7 +1874,7 @@ void DeferredInlineSmiAdd::Generate() {
Token::ADD, Token::ADD,
overwrite_mode_, overwrite_mode_,
NO_SMI_CODE_IN_STUB, NO_SMI_CODE_IN_STUB,
NumberInfo::Combine(NumberInfo::Smi(), number_info_)); TypeInfo::Combine(TypeInfo::Smi(), type_info_));
igostub.GenerateCall(masm_, dst_, value_); igostub.GenerateCall(masm_, dst_, value_);
if (!dst_.is(eax)) __ mov(dst_, eax); if (!dst_.is(eax)) __ mov(dst_, eax);
} }
...@@ -1886,11 +1886,11 @@ void DeferredInlineSmiAdd::Generate() { ...@@ -1886,11 +1886,11 @@ void DeferredInlineSmiAdd::Generate() {
class DeferredInlineSmiAddReversed: public DeferredCode { class DeferredInlineSmiAddReversed: public DeferredCode {
public: public:
DeferredInlineSmiAddReversed(Register dst, DeferredInlineSmiAddReversed(Register dst,
NumberInfo number_info, TypeInfo type_info,
Smi* value, Smi* value,
OverwriteMode overwrite_mode) OverwriteMode overwrite_mode)
: dst_(dst), : dst_(dst),
number_info_(number_info), type_info_(type_info),
value_(value), value_(value),
overwrite_mode_(overwrite_mode) { overwrite_mode_(overwrite_mode) {
set_comment("[ DeferredInlineSmiAddReversed"); set_comment("[ DeferredInlineSmiAddReversed");
...@@ -1900,7 +1900,7 @@ class DeferredInlineSmiAddReversed: public DeferredCode { ...@@ -1900,7 +1900,7 @@ class DeferredInlineSmiAddReversed: public DeferredCode {
private: private:
Register dst_; Register dst_;
NumberInfo number_info_; TypeInfo type_info_;
Smi* value_; Smi* value_;
OverwriteMode overwrite_mode_; OverwriteMode overwrite_mode_;
}; };
...@@ -1913,7 +1913,7 @@ void DeferredInlineSmiAddReversed::Generate() { ...@@ -1913,7 +1913,7 @@ void DeferredInlineSmiAddReversed::Generate() {
Token::ADD, Token::ADD,
overwrite_mode_, overwrite_mode_,
NO_SMI_CODE_IN_STUB, NO_SMI_CODE_IN_STUB,
NumberInfo::Combine(NumberInfo::Smi(), number_info_)); TypeInfo::Combine(TypeInfo::Smi(), type_info_));
igostub.GenerateCall(masm_, value_, dst_); igostub.GenerateCall(masm_, value_, dst_);
if (!dst_.is(eax)) __ mov(dst_, eax); if (!dst_.is(eax)) __ mov(dst_, eax);
} }
...@@ -1926,14 +1926,14 @@ void DeferredInlineSmiAddReversed::Generate() { ...@@ -1926,14 +1926,14 @@ void DeferredInlineSmiAddReversed::Generate() {
class DeferredInlineSmiSub: public DeferredCode { class DeferredInlineSmiSub: public DeferredCode {
public: public:
DeferredInlineSmiSub(Register dst, DeferredInlineSmiSub(Register dst,
NumberInfo number_info, TypeInfo type_info,
Smi* value, Smi* value,
OverwriteMode overwrite_mode) OverwriteMode overwrite_mode)
: dst_(dst), : dst_(dst),
number_info_(number_info), type_info_(type_info),
value_(value), value_(value),
overwrite_mode_(overwrite_mode) { overwrite_mode_(overwrite_mode) {
if (number_info.IsSmi()) overwrite_mode_ = NO_OVERWRITE; if (type_info.IsSmi()) overwrite_mode_ = NO_OVERWRITE;
set_comment("[ DeferredInlineSmiSub"); set_comment("[ DeferredInlineSmiSub");
} }
...@@ -1941,7 +1941,7 @@ class DeferredInlineSmiSub: public DeferredCode { ...@@ -1941,7 +1941,7 @@ class DeferredInlineSmiSub: public DeferredCode {
private: private:
Register dst_; Register dst_;
NumberInfo number_info_; TypeInfo type_info_;
Smi* value_; Smi* value_;
OverwriteMode overwrite_mode_; OverwriteMode overwrite_mode_;
}; };
...@@ -1954,7 +1954,7 @@ void DeferredInlineSmiSub::Generate() { ...@@ -1954,7 +1954,7 @@ void DeferredInlineSmiSub::Generate() {
Token::SUB, Token::SUB,
overwrite_mode_, overwrite_mode_,
NO_SMI_CODE_IN_STUB, NO_SMI_CODE_IN_STUB,
NumberInfo::Combine(NumberInfo::Smi(), number_info_)); TypeInfo::Combine(TypeInfo::Smi(), type_info_));
igostub.GenerateCall(masm_, dst_, value_); igostub.GenerateCall(masm_, dst_, value_);
if (!dst_.is(eax)) __ mov(dst_, eax); if (!dst_.is(eax)) __ mov(dst_, eax);
} }
...@@ -1999,18 +1999,18 @@ Result CodeGenerator::ConstantSmiBinaryOperation(Token::Value op, ...@@ -1999,18 +1999,18 @@ Result CodeGenerator::ConstantSmiBinaryOperation(Token::Value op,
DeferredCode* deferred = NULL; DeferredCode* deferred = NULL;
if (reversed) { if (reversed) {
deferred = new DeferredInlineSmiAddReversed(operand->reg(), deferred = new DeferredInlineSmiAddReversed(operand->reg(),
operand->number_info(), operand->type_info(),
smi_value, smi_value,
overwrite_mode); overwrite_mode);
} else { } else {
deferred = new DeferredInlineSmiAdd(operand->reg(), deferred = new DeferredInlineSmiAdd(operand->reg(),
operand->number_info(), operand->type_info(),
smi_value, smi_value,
overwrite_mode); overwrite_mode);
} }
__ add(Operand(operand->reg()), Immediate(value)); __ add(Operand(operand->reg()), Immediate(value));
deferred->Branch(overflow); deferred->Branch(overflow);
if (!operand->number_info().IsSmi()) { if (!operand->type_info().IsSmi()) {
__ test(operand->reg(), Immediate(kSmiTagMask)); __ test(operand->reg(), Immediate(kSmiTagMask));
deferred->Branch(not_zero); deferred->Branch(not_zero);
} else { } else {
...@@ -2035,7 +2035,7 @@ Result CodeGenerator::ConstantSmiBinaryOperation(Token::Value op, ...@@ -2035,7 +2035,7 @@ Result CodeGenerator::ConstantSmiBinaryOperation(Token::Value op,
answer.reg(), answer.reg(),
smi_value, smi_value,
operand->reg(), operand->reg(),
operand->number_info(), operand->type_info(),
overwrite_mode); overwrite_mode);
__ sub(answer.reg(), Operand(operand->reg())); __ sub(answer.reg(), Operand(operand->reg()));
} else { } else {
...@@ -2043,13 +2043,13 @@ Result CodeGenerator::ConstantSmiBinaryOperation(Token::Value op, ...@@ -2043,13 +2043,13 @@ Result CodeGenerator::ConstantSmiBinaryOperation(Token::Value op,
frame_->Spill(operand->reg()); frame_->Spill(operand->reg());
answer = *operand; answer = *operand;
deferred = new DeferredInlineSmiSub(operand->reg(), deferred = new DeferredInlineSmiSub(operand->reg(),
operand->number_info(), operand->type_info(),
smi_value, smi_value,
overwrite_mode); overwrite_mode);
__ sub(Operand(operand->reg()), Immediate(value)); __ sub(Operand(operand->reg()), Immediate(value));
} }
deferred->Branch(overflow); deferred->Branch(overflow);
if (!operand->number_info().IsSmi()) { if (!operand->type_info().IsSmi()) {
__ test(answer.reg(), Immediate(kSmiTagMask)); __ test(answer.reg(), Immediate(kSmiTagMask));
deferred->Branch(not_zero); deferred->Branch(not_zero);
} else { } else {
...@@ -2071,12 +2071,12 @@ Result CodeGenerator::ConstantSmiBinaryOperation(Token::Value op, ...@@ -2071,12 +2071,12 @@ Result CodeGenerator::ConstantSmiBinaryOperation(Token::Value op,
int shift_value = int_value & 0x1f; int shift_value = int_value & 0x1f;
operand->ToRegister(); operand->ToRegister();
frame_->Spill(operand->reg()); frame_->Spill(operand->reg());
if (!operand->number_info().IsSmi()) { if (!operand->type_info().IsSmi()) {
DeferredInlineSmiOperation* deferred = DeferredInlineSmiOperation* deferred =
new DeferredInlineSmiOperation(op, new DeferredInlineSmiOperation(op,
operand->reg(), operand->reg(),
operand->reg(), operand->reg(),
operand->number_info(), operand->type_info(),
smi_value, smi_value,
overwrite_mode); overwrite_mode);
__ test(operand->reg(), Immediate(kSmiTagMask)); __ test(operand->reg(), Immediate(kSmiTagMask));
...@@ -2113,10 +2113,10 @@ Result CodeGenerator::ConstantSmiBinaryOperation(Token::Value op, ...@@ -2113,10 +2113,10 @@ Result CodeGenerator::ConstantSmiBinaryOperation(Token::Value op,
new DeferredInlineSmiOperation(op, new DeferredInlineSmiOperation(op,
answer.reg(), answer.reg(),
operand->reg(), operand->reg(),
operand->number_info(), operand->type_info(),
smi_value, smi_value,
overwrite_mode); overwrite_mode);
if (!operand->number_info().IsSmi()) { if (!operand->type_info().IsSmi()) {
__ test(operand->reg(), Immediate(kSmiTagMask)); __ test(operand->reg(), Immediate(kSmiTagMask));
deferred->Branch(not_zero); deferred->Branch(not_zero);
} else { } else {
...@@ -2163,11 +2163,11 @@ Result CodeGenerator::ConstantSmiBinaryOperation(Token::Value op, ...@@ -2163,11 +2163,11 @@ Result CodeGenerator::ConstantSmiBinaryOperation(Token::Value op,
answer.reg(), answer.reg(),
smi_value, smi_value,
right.reg(), right.reg(),
right.number_info(), right.type_info(),
overwrite_mode); overwrite_mode);
__ mov(answer.reg(), Immediate(int_value)); __ mov(answer.reg(), Immediate(int_value));
__ sar(ecx, kSmiTagSize); __ sar(ecx, kSmiTagSize);
if (!right.number_info().IsSmi()) { if (!right.type_info().IsSmi()) {
deferred->Branch(carry); deferred->Branch(carry);
} else { } else {
if (FLAG_debug_code) __ AbortIfNotSmi(right.reg()); if (FLAG_debug_code) __ AbortIfNotSmi(right.reg());
...@@ -2190,7 +2190,7 @@ Result CodeGenerator::ConstantSmiBinaryOperation(Token::Value op, ...@@ -2190,7 +2190,7 @@ Result CodeGenerator::ConstantSmiBinaryOperation(Token::Value op,
new DeferredInlineSmiOperation(op, new DeferredInlineSmiOperation(op,
operand->reg(), operand->reg(),
operand->reg(), operand->reg(),
operand->number_info(), operand->type_info(),
smi_value, smi_value,
overwrite_mode); overwrite_mode);
__ test(operand->reg(), Immediate(kSmiTagMask)); __ test(operand->reg(), Immediate(kSmiTagMask));
...@@ -2205,10 +2205,10 @@ Result CodeGenerator::ConstantSmiBinaryOperation(Token::Value op, ...@@ -2205,10 +2205,10 @@ Result CodeGenerator::ConstantSmiBinaryOperation(Token::Value op,
new DeferredInlineSmiOperation(op, new DeferredInlineSmiOperation(op,
answer.reg(), answer.reg(),
operand->reg(), operand->reg(),
operand->number_info(), operand->type_info(),
smi_value, smi_value,
overwrite_mode); overwrite_mode);
if (!operand->number_info().IsSmi()) { if (!operand->type_info().IsSmi()) {
__ test(operand->reg(), Immediate(kSmiTagMask)); __ test(operand->reg(), Immediate(kSmiTagMask));
deferred->Branch(not_zero); deferred->Branch(not_zero);
} else { } else {
...@@ -2242,17 +2242,17 @@ Result CodeGenerator::ConstantSmiBinaryOperation(Token::Value op, ...@@ -2242,17 +2242,17 @@ Result CodeGenerator::ConstantSmiBinaryOperation(Token::Value op,
operand->reg(), operand->reg(),
smi_value, smi_value,
operand->reg(), operand->reg(),
operand->number_info(), operand->type_info(),
overwrite_mode); overwrite_mode);
} else { } else {
deferred = new DeferredInlineSmiOperation(op, deferred = new DeferredInlineSmiOperation(op,
operand->reg(), operand->reg(),
operand->reg(), operand->reg(),
operand->number_info(), operand->type_info(),
smi_value, smi_value,
overwrite_mode); overwrite_mode);
} }
if (!operand->number_info().IsSmi()) { if (!operand->type_info().IsSmi()) {
__ test(operand->reg(), Immediate(kSmiTagMask)); __ test(operand->reg(), Immediate(kSmiTagMask));
deferred->Branch(not_zero); deferred->Branch(not_zero);
} else { } else {
...@@ -2284,7 +2284,7 @@ Result CodeGenerator::ConstantSmiBinaryOperation(Token::Value op, ...@@ -2284,7 +2284,7 @@ Result CodeGenerator::ConstantSmiBinaryOperation(Token::Value op,
new DeferredInlineSmiOperation(op, new DeferredInlineSmiOperation(op,
operand->reg(), operand->reg(),
operand->reg(), operand->reg(),
operand->number_info(), operand->type_info(),
smi_value, smi_value,
overwrite_mode); overwrite_mode);
// Check that lowest log2(value) bits of operand are zero, and test // Check that lowest log2(value) bits of operand are zero, and test
...@@ -2320,7 +2320,7 @@ Result CodeGenerator::ConstantSmiBinaryOperation(Token::Value op, ...@@ -2320,7 +2320,7 @@ Result CodeGenerator::ConstantSmiBinaryOperation(Token::Value op,
new DeferredInlineSmiOperation(op, new DeferredInlineSmiOperation(op,
operand->reg(), operand->reg(),
operand->reg(), operand->reg(),
operand->number_info(), operand->type_info(),
smi_value, smi_value,
overwrite_mode); overwrite_mode);
// Check for negative or non-Smi left hand side. // Check for negative or non-Smi left hand side.
...@@ -2356,8 +2356,8 @@ Result CodeGenerator::ConstantSmiBinaryOperation(Token::Value op, ...@@ -2356,8 +2356,8 @@ Result CodeGenerator::ConstantSmiBinaryOperation(Token::Value op,
static bool CouldBeNaN(const Result& result) { static bool CouldBeNaN(const Result& result) {
if (result.number_info().IsSmi()) return false; if (result.type_info().IsSmi()) return false;
if (result.number_info().IsInteger32()) return false; if (result.type_info().IsInteger32()) return false;
if (!result.is_constant()) return true; if (!result.is_constant()) return true;
if (!result.handle()->IsHeapNumber()) return false; if (!result.handle()->IsHeapNumber()) return false;
return isnan(HeapNumber::cast(*result.handle())->value()); return isnan(HeapNumber::cast(*result.handle())->value());
...@@ -3851,7 +3851,7 @@ void CodeGenerator::VisitWhileStatement(WhileStatement* node) { ...@@ -3851,7 +3851,7 @@ void CodeGenerator::VisitWhileStatement(WhileStatement* node) {
} }
void CodeGenerator::SetTypeForStackSlot(Slot* slot, NumberInfo info) { void CodeGenerator::SetTypeForStackSlot(Slot* slot, TypeInfo info) {
ASSERT(slot->type() == Slot::LOCAL || slot->type() == Slot::PARAMETER); ASSERT(slot->type() == Slot::LOCAL || slot->type() == Slot::PARAMETER);
if (slot->type() == Slot::LOCAL) { if (slot->type() == Slot::LOCAL) {
frame_->SetTypeForLocalAt(slot->index(), info); frame_->SetTypeForLocalAt(slot->index(), info);
...@@ -3971,7 +3971,7 @@ void CodeGenerator::VisitForStatement(ForStatement* node) { ...@@ -3971,7 +3971,7 @@ void CodeGenerator::VisitForStatement(ForStatement* node) {
// the bottom check of the loop condition. // the bottom check of the loop condition.
if (node->is_fast_smi_loop()) { if (node->is_fast_smi_loop()) {
// Set number type of the loop variable to smi. // Set number type of the loop variable to smi.
SetTypeForStackSlot(node->loop_variable()->slot(), NumberInfo::Smi()); SetTypeForStackSlot(node->loop_variable()->slot(), TypeInfo::Smi());
} }
Visit(node->body()); Visit(node->body());
...@@ -3997,7 +3997,7 @@ void CodeGenerator::VisitForStatement(ForStatement* node) { ...@@ -3997,7 +3997,7 @@ void CodeGenerator::VisitForStatement(ForStatement* node) {
// expression if we are in a fast smi loop condition. // expression if we are in a fast smi loop condition.
if (node->is_fast_smi_loop() && has_valid_frame()) { if (node->is_fast_smi_loop() && has_valid_frame()) {
// Set number type of the loop variable to smi. // Set number type of the loop variable to smi.
SetTypeForStackSlot(node->loop_variable()->slot(), NumberInfo::Smi()); SetTypeForStackSlot(node->loop_variable()->slot(), TypeInfo::Smi());
} }
// Based on the condition analysis, compile the backward jump as // Based on the condition analysis, compile the backward jump as
...@@ -6900,7 +6900,7 @@ void CodeGenerator::VisitUnaryOperation(UnaryOperation* node) { ...@@ -6900,7 +6900,7 @@ void CodeGenerator::VisitUnaryOperation(UnaryOperation* node) {
GenericUnaryOpStub stub(Token::SUB, overwrite); GenericUnaryOpStub stub(Token::SUB, overwrite);
Result operand = frame_->Pop(); Result operand = frame_->Pop();
Result answer = frame_->CallStub(&stub, &operand); Result answer = frame_->CallStub(&stub, &operand);
answer.set_number_info(NumberInfo::Number()); answer.set_type_info(TypeInfo::Number());
frame_->Push(&answer); frame_->Push(&answer);
break; break;
} }
...@@ -6909,7 +6909,7 @@ void CodeGenerator::VisitUnaryOperation(UnaryOperation* node) { ...@@ -6909,7 +6909,7 @@ void CodeGenerator::VisitUnaryOperation(UnaryOperation* node) {
JumpTarget smi_label; JumpTarget smi_label;
JumpTarget continue_label; JumpTarget continue_label;
Result operand = frame_->Pop(); Result operand = frame_->Pop();
NumberInfo operand_info = operand.number_info(); TypeInfo operand_info = operand.type_info();
operand.ToRegister(); operand.ToRegister();
if (operand_info.IsSmi()) { if (operand_info.IsSmi()) {
if (FLAG_debug_code) __ AbortIfNotSmi(operand.reg()); if (FLAG_debug_code) __ AbortIfNotSmi(operand.reg());
...@@ -6918,7 +6918,7 @@ void CodeGenerator::VisitUnaryOperation(UnaryOperation* node) { ...@@ -6918,7 +6918,7 @@ void CodeGenerator::VisitUnaryOperation(UnaryOperation* node) {
__ lea(operand.reg(), Operand(operand.reg(), kSmiTagMask)); __ lea(operand.reg(), Operand(operand.reg(), kSmiTagMask));
__ not_(operand.reg()); __ not_(operand.reg());
Result answer = operand; Result answer = operand;
answer.set_number_info(NumberInfo::Smi()); answer.set_type_info(TypeInfo::Smi());
frame_->Push(&answer); frame_->Push(&answer);
} else { } else {
__ test(operand.reg(), Immediate(kSmiTagMask)); __ test(operand.reg(), Immediate(kSmiTagMask));
...@@ -6937,9 +6937,9 @@ void CodeGenerator::VisitUnaryOperation(UnaryOperation* node) { ...@@ -6937,9 +6937,9 @@ void CodeGenerator::VisitUnaryOperation(UnaryOperation* node) {
continue_label.Bind(&answer); continue_label.Bind(&answer);
if (operand_info.IsInteger32()) { if (operand_info.IsInteger32()) {
answer.set_number_info(NumberInfo::Integer32()); answer.set_type_info(TypeInfo::Integer32());
} else { } else {
answer.set_number_info(NumberInfo::Number()); answer.set_type_info(TypeInfo::Number());
} }
frame_->Push(&answer); frame_->Push(&answer);
} }
...@@ -6949,7 +6949,7 @@ void CodeGenerator::VisitUnaryOperation(UnaryOperation* node) { ...@@ -6949,7 +6949,7 @@ void CodeGenerator::VisitUnaryOperation(UnaryOperation* node) {
// Smi check. // Smi check.
JumpTarget continue_label; JumpTarget continue_label;
Result operand = frame_->Pop(); Result operand = frame_->Pop();
NumberInfo operand_info = operand.number_info(); TypeInfo operand_info = operand.type_info();
operand.ToRegister(); operand.ToRegister();
__ test(operand.reg(), Immediate(kSmiTagMask)); __ test(operand.reg(), Immediate(kSmiTagMask));
continue_label.Branch(zero, &operand, taken); continue_label.Branch(zero, &operand, taken);
...@@ -6960,11 +6960,11 @@ void CodeGenerator::VisitUnaryOperation(UnaryOperation* node) { ...@@ -6960,11 +6960,11 @@ void CodeGenerator::VisitUnaryOperation(UnaryOperation* node) {
continue_label.Bind(&answer); continue_label.Bind(&answer);
if (operand_info.IsSmi()) { if (operand_info.IsSmi()) {
answer.set_number_info(NumberInfo::Smi()); answer.set_type_info(TypeInfo::Smi());
} else if (operand_info.IsInteger32()) { } else if (operand_info.IsInteger32()) {
answer.set_number_info(NumberInfo::Integer32()); answer.set_type_info(TypeInfo::Integer32());
} else { } else {
answer.set_number_info(NumberInfo::Number()); answer.set_type_info(TypeInfo::Number());
} }
frame_->Push(&answer); frame_->Push(&answer);
break; break;
...@@ -7104,7 +7104,7 @@ void CodeGenerator::VisitCountOperation(CountOperation* node) { ...@@ -7104,7 +7104,7 @@ void CodeGenerator::VisitCountOperation(CountOperation* node) {
// The return value for postfix operations is the // The return value for postfix operations is the
// same as the input, and has the same number info. // same as the input, and has the same number info.
old_value.set_number_info(new_value.number_info()); old_value.set_type_info(new_value.type_info());
} }
// Ensure the new value is writable. // Ensure the new value is writable.
...@@ -7171,9 +7171,9 @@ void CodeGenerator::VisitCountOperation(CountOperation* node) { ...@@ -7171,9 +7171,9 @@ void CodeGenerator::VisitCountOperation(CountOperation* node) {
// The result of ++ or -- is an Integer32 if the // The result of ++ or -- is an Integer32 if the
// input is a smi. Otherwise it is a number. // input is a smi. Otherwise it is a number.
if (new_value.is_smi()) { if (new_value.is_smi()) {
new_value.set_number_info(NumberInfo::Integer32()); new_value.set_type_info(TypeInfo::Integer32());
} else { } else {
new_value.set_number_info(NumberInfo::Number()); new_value.set_type_info(TypeInfo::Number());
} }
// Postfix: store the old value in the allocated slot under the // Postfix: store the old value in the allocated slot under the
...@@ -7387,14 +7387,14 @@ void CodeGenerator::Int32BinaryOperation(BinaryOperation* node) { ...@@ -7387,14 +7387,14 @@ void CodeGenerator::Int32BinaryOperation(BinaryOperation* node) {
unsafe_bailout_->Branch(negative); unsafe_bailout_->Branch(negative);
__ bind(&not_negative_zero); __ bind(&not_negative_zero);
} }
Result edx_result(edx, NumberInfo::Integer32()); Result edx_result(edx, TypeInfo::Integer32());
edx_result.set_untagged_int32(true); edx_result.set_untagged_int32(true);
frame_->Push(&edx_result); frame_->Push(&edx_result);
} else { } else {
ASSERT(op == Token::DIV); ASSERT(op == Token::DIV);
__ test(edx, Operand(edx)); __ test(edx, Operand(edx));
unsafe_bailout_->Branch(not_equal); unsafe_bailout_->Branch(not_equal);
Result eax_result(eax, NumberInfo::Integer32()); Result eax_result(eax, TypeInfo::Integer32());
eax_result.set_untagged_int32(true); eax_result.set_untagged_int32(true);
frame_->Push(&eax_result); frame_->Push(&eax_result);
} }
...@@ -8281,7 +8281,7 @@ Result CodeGenerator::EmitKeyedStore(StaticType* key_type) { ...@@ -8281,7 +8281,7 @@ Result CodeGenerator::EmitKeyedStore(StaticType* key_type) {
static void CheckTwoForSminess(MacroAssembler* masm, static void CheckTwoForSminess(MacroAssembler* masm,
Register left, Register right, Register scratch, Register left, Register right, Register scratch,
NumberInfo left_info, NumberInfo right_info, TypeInfo left_info, TypeInfo right_info,
DeferredInlineBinaryOperation* deferred) { DeferredInlineBinaryOperation* deferred) {
if (left.is(right)) { if (left.is(right)) {
if (!left_info.IsSmi()) { if (!left_info.IsSmi()) {
...@@ -9782,14 +9782,14 @@ void TranscendentalCacheStub::GenerateOperation(MacroAssembler* masm) { ...@@ -9782,14 +9782,14 @@ void TranscendentalCacheStub::GenerateOperation(MacroAssembler* masm) {
// trashed registers. // trashed registers.
void IntegerConvert(MacroAssembler* masm, void IntegerConvert(MacroAssembler* masm,
Register source, Register source,
NumberInfo number_info, TypeInfo type_info,
bool use_sse3, bool use_sse3,
Label* conversion_failure) { Label* conversion_failure) {
ASSERT(!source.is(ecx) && !source.is(edi) && !source.is(ebx)); ASSERT(!source.is(ecx) && !source.is(edi) && !source.is(ebx));
Label done, right_exponent, normal_exponent; Label done, right_exponent, normal_exponent;
Register scratch = ebx; Register scratch = ebx;
Register scratch2 = edi; Register scratch2 = edi;
if (!number_info.IsInteger32() || !use_sse3) { if (!type_info.IsInteger32() || !use_sse3) {
// Get exponent word. // Get exponent word.
__ mov(scratch, FieldOperand(source, HeapNumber::kExponentOffset)); __ mov(scratch, FieldOperand(source, HeapNumber::kExponentOffset));
// Get exponent alone in scratch2. // Get exponent alone in scratch2.
...@@ -9798,7 +9798,7 @@ void IntegerConvert(MacroAssembler* masm, ...@@ -9798,7 +9798,7 @@ void IntegerConvert(MacroAssembler* masm,
} }
if (use_sse3) { if (use_sse3) {
CpuFeatures::Scope scope(SSE3); CpuFeatures::Scope scope(SSE3);
if (!number_info.IsInteger32()) { if (!type_info.IsInteger32()) {
// Check whether the exponent is too big for a 64 bit signed integer. // Check whether the exponent is too big for a 64 bit signed integer.
static const uint32_t kTooBigExponent = static const uint32_t kTooBigExponent =
(HeapNumber::kExponentBias + 63) << HeapNumber::kExponentShift; (HeapNumber::kExponentBias + 63) << HeapNumber::kExponentShift;
...@@ -9919,7 +9919,7 @@ void IntegerConvert(MacroAssembler* masm, ...@@ -9919,7 +9919,7 @@ void IntegerConvert(MacroAssembler* masm,
// Input: edx, eax are the left and right objects of a bit op. // Input: edx, eax are the left and right objects of a bit op.
// Output: eax, ecx are left and right integers for a bit op. // Output: eax, ecx are left and right integers for a bit op.
void FloatingPointHelper::LoadNumbersAsIntegers(MacroAssembler* masm, void FloatingPointHelper::LoadNumbersAsIntegers(MacroAssembler* masm,
NumberInfo number_info, TypeInfo type_info,
bool use_sse3, bool use_sse3,
Label* conversion_failure) { Label* conversion_failure) {
// Check float operands. // Check float operands.
...@@ -9927,8 +9927,8 @@ void FloatingPointHelper::LoadNumbersAsIntegers(MacroAssembler* masm, ...@@ -9927,8 +9927,8 @@ void FloatingPointHelper::LoadNumbersAsIntegers(MacroAssembler* masm,
Label arg2_is_object, check_undefined_arg2; Label arg2_is_object, check_undefined_arg2;
Label load_arg2, done; Label load_arg2, done;
if (!number_info.IsDouble()) { if (!type_info.IsDouble()) {
if (!number_info.IsSmi()) { if (!type_info.IsSmi()) {
__ test(edx, Immediate(kSmiTagMask)); __ test(edx, Immediate(kSmiTagMask));
__ j(not_zero, &arg1_is_object); __ j(not_zero, &arg1_is_object);
} else { } else {
...@@ -9941,14 +9941,14 @@ void FloatingPointHelper::LoadNumbersAsIntegers(MacroAssembler* masm, ...@@ -9941,14 +9941,14 @@ void FloatingPointHelper::LoadNumbersAsIntegers(MacroAssembler* masm,
__ bind(&arg1_is_object); __ bind(&arg1_is_object);
// Get the untagged integer version of the edx heap number in ecx. // Get the untagged integer version of the edx heap number in ecx.
IntegerConvert(masm, edx, number_info, use_sse3, conversion_failure); IntegerConvert(masm, edx, type_info, use_sse3, conversion_failure);
__ mov(edx, ecx); __ mov(edx, ecx);
// Here edx has the untagged integer, eax has a Smi or a heap number. // Here edx has the untagged integer, eax has a Smi or a heap number.
__ bind(&load_arg2); __ bind(&load_arg2);
if (!number_info.IsDouble()) { if (!type_info.IsDouble()) {
// Test if arg2 is a Smi. // Test if arg2 is a Smi.
if (!number_info.IsSmi()) { if (!type_info.IsSmi()) {
__ test(eax, Immediate(kSmiTagMask)); __ test(eax, Immediate(kSmiTagMask));
__ j(not_zero, &arg2_is_object); __ j(not_zero, &arg2_is_object);
} else { } else {
...@@ -9962,7 +9962,7 @@ void FloatingPointHelper::LoadNumbersAsIntegers(MacroAssembler* masm, ...@@ -9962,7 +9962,7 @@ void FloatingPointHelper::LoadNumbersAsIntegers(MacroAssembler* masm,
__ bind(&arg2_is_object); __ bind(&arg2_is_object);
// Get the untagged integer version of the eax heap number in ecx. // Get the untagged integer version of the eax heap number in ecx.
IntegerConvert(masm, eax, number_info, use_sse3, conversion_failure); IntegerConvert(masm, eax, type_info, use_sse3, conversion_failure);
__ bind(&done); __ bind(&done);
__ mov(eax, edx); __ mov(eax, edx);
} }
...@@ -10000,7 +10000,7 @@ void FloatingPointHelper::LoadUnknownsAsIntegers(MacroAssembler* masm, ...@@ -10000,7 +10000,7 @@ void FloatingPointHelper::LoadUnknownsAsIntegers(MacroAssembler* masm,
// Get the untagged integer version of the edx heap number in ecx. // Get the untagged integer version of the edx heap number in ecx.
IntegerConvert(masm, IntegerConvert(masm,
edx, edx,
NumberInfo::Unknown(), TypeInfo::Unknown(),
use_sse3, use_sse3,
conversion_failure); conversion_failure);
__ mov(edx, ecx); __ mov(edx, ecx);
...@@ -10031,7 +10031,7 @@ void FloatingPointHelper::LoadUnknownsAsIntegers(MacroAssembler* masm, ...@@ -10031,7 +10031,7 @@ void FloatingPointHelper::LoadUnknownsAsIntegers(MacroAssembler* masm,
// Get the untagged integer version of the eax heap number in ecx. // Get the untagged integer version of the eax heap number in ecx.
IntegerConvert(masm, IntegerConvert(masm,
eax, eax,
NumberInfo::Unknown(), TypeInfo::Unknown(),
use_sse3, use_sse3,
conversion_failure); conversion_failure);
__ bind(&done); __ bind(&done);
...@@ -10040,11 +10040,11 @@ void FloatingPointHelper::LoadUnknownsAsIntegers(MacroAssembler* masm, ...@@ -10040,11 +10040,11 @@ void FloatingPointHelper::LoadUnknownsAsIntegers(MacroAssembler* masm,
void FloatingPointHelper::LoadAsIntegers(MacroAssembler* masm, void FloatingPointHelper::LoadAsIntegers(MacroAssembler* masm,
NumberInfo number_info, TypeInfo type_info,
bool use_sse3, bool use_sse3,
Label* conversion_failure) { Label* conversion_failure) {
if (number_info.IsNumber()) { if (type_info.IsNumber()) {
LoadNumbersAsIntegers(masm, number_info, use_sse3, conversion_failure); LoadNumbersAsIntegers(masm, type_info, use_sse3, conversion_failure);
} else { } else {
LoadUnknownsAsIntegers(masm, use_sse3, conversion_failure); LoadUnknownsAsIntegers(masm, use_sse3, conversion_failure);
} }
...@@ -10289,7 +10289,7 @@ void GenericUnaryOpStub::Generate(MacroAssembler* masm) { ...@@ -10289,7 +10289,7 @@ void GenericUnaryOpStub::Generate(MacroAssembler* masm) {
// Convert the heap number in eax to an untagged integer in ecx. // Convert the heap number in eax to an untagged integer in ecx.
IntegerConvert(masm, IntegerConvert(masm,
eax, eax,
NumberInfo::Unknown(), TypeInfo::Unknown(),
CpuFeatures::IsSupported(SSE3), CpuFeatures::IsSupported(SSE3),
&slow); &slow);
......
...@@ -656,7 +656,7 @@ class CodeGenerator: public AstVisitor { ...@@ -656,7 +656,7 @@ class CodeGenerator: public AstVisitor {
void CodeForDoWhileConditionPosition(DoWhileStatement* stmt); void CodeForDoWhileConditionPosition(DoWhileStatement* stmt);
void CodeForSourcePosition(int pos); void CodeForSourcePosition(int pos);
void SetTypeForStackSlot(Slot* slot, NumberInfo info); void SetTypeForStackSlot(Slot* slot, TypeInfo info);
#ifdef DEBUG #ifdef DEBUG
// True if the registers are valid for entry to a block. There should // True if the registers are valid for entry to a block. There should
...@@ -740,7 +740,7 @@ class GenericBinaryOpStub: public CodeStub { ...@@ -740,7 +740,7 @@ class GenericBinaryOpStub: public CodeStub {
GenericBinaryOpStub(Token::Value op, GenericBinaryOpStub(Token::Value op,
OverwriteMode mode, OverwriteMode mode,
GenericBinaryFlags flags, GenericBinaryFlags flags,
NumberInfo operands_type) TypeInfo operands_type)
: op_(op), : op_(op),
mode_(mode), mode_(mode),
flags_(flags), flags_(flags),
...@@ -763,7 +763,7 @@ class GenericBinaryOpStub: public CodeStub { ...@@ -763,7 +763,7 @@ class GenericBinaryOpStub: public CodeStub {
args_in_registers_(ArgsInRegistersBits::decode(key)), args_in_registers_(ArgsInRegistersBits::decode(key)),
args_reversed_(ArgsReversedBits::decode(key)), args_reversed_(ArgsReversedBits::decode(key)),
use_sse3_(SSE3Bits::decode(key)), use_sse3_(SSE3Bits::decode(key)),
static_operands_type_(NumberInfo::ExpandedRepresentation( static_operands_type_(TypeInfo::ExpandedRepresentation(
StaticTypeInfoBits::decode(key))), StaticTypeInfoBits::decode(key))),
runtime_operands_type_(runtime_operands_type), runtime_operands_type_(runtime_operands_type),
name_(NULL) { name_(NULL) {
...@@ -790,7 +790,7 @@ class GenericBinaryOpStub: public CodeStub { ...@@ -790,7 +790,7 @@ class GenericBinaryOpStub: public CodeStub {
bool use_sse3_; bool use_sse3_;
// Number type information of operands, determined by code generator. // Number type information of operands, determined by code generator.
NumberInfo static_operands_type_; TypeInfo static_operands_type_;
// Operand type information determined at runtime. // Operand type information determined at runtime.
BinaryOpIC::TypeInfo runtime_operands_type_; BinaryOpIC::TypeInfo runtime_operands_type_;
...@@ -802,7 +802,7 @@ class GenericBinaryOpStub: public CodeStub { ...@@ -802,7 +802,7 @@ class GenericBinaryOpStub: public CodeStub {
#ifdef DEBUG #ifdef DEBUG
void Print() { void Print() {
PrintF("GenericBinaryOpStub %d (op %s), " PrintF("GenericBinaryOpStub %d (op %s), "
"(mode %d, flags %d, registers %d, reversed %d, number_info %s)\n", "(mode %d, flags %d, registers %d, reversed %d, type_info %s)\n",
MinorKey(), MinorKey(),
Token::String(op_), Token::String(op_),
static_cast<int>(mode_), static_cast<int>(mode_),
......
...@@ -1130,7 +1130,7 @@ void FullCodeGenerator::EmitBinaryOp(Token::Value op, ...@@ -1130,7 +1130,7 @@ void FullCodeGenerator::EmitBinaryOp(Token::Value op,
GenericBinaryOpStub stub(op, GenericBinaryOpStub stub(op,
NO_OVERWRITE, NO_OVERWRITE,
NO_GENERIC_BINARY_FLAGS, NO_GENERIC_BINARY_FLAGS,
NumberInfo::Unknown()); TypeInfo::Unknown());
__ CallStub(&stub); __ CallStub(&stub);
Apply(context, eax); Apply(context, eax);
} }
...@@ -1745,7 +1745,7 @@ void FullCodeGenerator::VisitCountOperation(CountOperation* expr) { ...@@ -1745,7 +1745,7 @@ void FullCodeGenerator::VisitCountOperation(CountOperation* expr) {
GenericBinaryOpStub stub(expr->binary_op(), GenericBinaryOpStub stub(expr->binary_op(),
NO_OVERWRITE, NO_OVERWRITE,
NO_GENERIC_BINARY_FLAGS, NO_GENERIC_BINARY_FLAGS,
NumberInfo::Unknown()); TypeInfo::Unknown());
stub.GenerateCall(masm(), eax, Smi::FromInt(1)); stub.GenerateCall(masm(), eax, Smi::FromInt(1));
__ bind(&done); __ bind(&done);
......
...@@ -75,7 +75,7 @@ void Result::ToRegister() { ...@@ -75,7 +75,7 @@ void Result::ToRegister() {
Immediate(handle())); Immediate(handle()));
} }
// This result becomes a copy of the fresh one. // This result becomes a copy of the fresh one.
fresh.set_number_info(number_info()); fresh.set_type_info(type_info());
*this = fresh; *this = fresh;
} }
ASSERT(is_register()); ASSERT(is_register());
...@@ -122,7 +122,7 @@ void Result::ToRegister(Register target) { ...@@ -122,7 +122,7 @@ void Result::ToRegister(Register target) {
} }
} }
} }
fresh.set_number_info(number_info()); fresh.set_type_info(type_info());
fresh.set_untagged_int32(is_untagged_int32()); fresh.set_untagged_int32(is_untagged_int32());
*this = fresh; *this = fresh;
} else if (is_register() && reg().is(target)) { } else if (is_register() && reg().is(target)) {
......
...@@ -162,7 +162,7 @@ void VirtualFrame::MakeMergable() { ...@@ -162,7 +162,7 @@ void VirtualFrame::MakeMergable() {
if (element.is_constant() || element.is_copy()) { if (element.is_constant() || element.is_copy()) {
if (element.is_synced()) { if (element.is_synced()) {
// Just spill. // Just spill.
elements_[i] = FrameElement::MemoryElement(NumberInfo::Unknown()); elements_[i] = FrameElement::MemoryElement(TypeInfo::Unknown());
} else { } else {
// Allocate to a register. // Allocate to a register.
FrameElement backing_element; // Invalid if not a copy. FrameElement backing_element; // Invalid if not a copy.
...@@ -174,7 +174,7 @@ void VirtualFrame::MakeMergable() { ...@@ -174,7 +174,7 @@ void VirtualFrame::MakeMergable() {
elements_[i] = elements_[i] =
FrameElement::RegisterElement(fresh.reg(), FrameElement::RegisterElement(fresh.reg(),
FrameElement::NOT_SYNCED, FrameElement::NOT_SYNCED,
NumberInfo::Unknown()); TypeInfo::Unknown());
Use(fresh.reg(), i); Use(fresh.reg(), i);
// Emit a move. // Emit a move.
...@@ -207,7 +207,7 @@ void VirtualFrame::MakeMergable() { ...@@ -207,7 +207,7 @@ void VirtualFrame::MakeMergable() {
// The copy flag is not relied on before the end of this loop, // The copy flag is not relied on before the end of this loop,
// including when registers are spilled. // including when registers are spilled.
elements_[i].clear_copied(); elements_[i].clear_copied();
elements_[i].set_number_info(NumberInfo::Unknown()); elements_[i].set_type_info(TypeInfo::Unknown());
} }
} }
} }
...@@ -597,12 +597,12 @@ int VirtualFrame::InvalidateFrameSlotAt(int index) { ...@@ -597,12 +597,12 @@ int VirtualFrame::InvalidateFrameSlotAt(int index) {
elements_[new_backing_index] = elements_[new_backing_index] =
FrameElement::RegisterElement(backing_reg, FrameElement::RegisterElement(backing_reg,
FrameElement::SYNCED, FrameElement::SYNCED,
original.number_info()); original.type_info());
} else { } else {
elements_[new_backing_index] = elements_[new_backing_index] =
FrameElement::RegisterElement(backing_reg, FrameElement::RegisterElement(backing_reg,
FrameElement::NOT_SYNCED, FrameElement::NOT_SYNCED,
original.number_info()); original.type_info());
} }
// Update the other copies. // Update the other copies.
for (int i = new_backing_index + 1; i < element_count(); i++) { for (int i = new_backing_index + 1; i < element_count(); i++) {
...@@ -634,7 +634,7 @@ void VirtualFrame::TakeFrameSlotAt(int index) { ...@@ -634,7 +634,7 @@ void VirtualFrame::TakeFrameSlotAt(int index) {
FrameElement new_element = FrameElement new_element =
FrameElement::RegisterElement(fresh.reg(), FrameElement::RegisterElement(fresh.reg(),
FrameElement::NOT_SYNCED, FrameElement::NOT_SYNCED,
original.number_info()); original.type_info());
Use(fresh.reg(), element_count()); Use(fresh.reg(), element_count());
elements_.Add(new_element); elements_.Add(new_element);
__ mov(fresh.reg(), Operand(ebp, fp_relative(index))); __ mov(fresh.reg(), Operand(ebp, fp_relative(index)));
...@@ -796,7 +796,7 @@ void VirtualFrame::UntaggedPushFrameSlotAt(int index) { ...@@ -796,7 +796,7 @@ void VirtualFrame::UntaggedPushFrameSlotAt(int index) {
FrameElement new_element = FrameElement new_element =
FrameElement::RegisterElement(fresh_reg, FrameElement::RegisterElement(fresh_reg,
FrameElement::NOT_SYNCED, FrameElement::NOT_SYNCED,
original.number_info()); original.type_info());
new_element.set_untagged_int32(true); new_element.set_untagged_int32(true);
Use(fresh_reg, element_count()); Use(fresh_reg, element_count());
fresh.Unuse(); // BreakTarget does not handle a live Result well. fresh.Unuse(); // BreakTarget does not handle a live Result well.
...@@ -808,7 +808,7 @@ void VirtualFrame::UntaggedPushFrameSlotAt(int index) { ...@@ -808,7 +808,7 @@ void VirtualFrame::UntaggedPushFrameSlotAt(int index) {
__ mov(fresh_reg, Operand(ebp, fp_relative(index))); __ mov(fresh_reg, Operand(ebp, fp_relative(index)));
} }
// Now convert the value to int32, or bail out. // Now convert the value to int32, or bail out.
if (original.number_info().IsSmi()) { if (original.type_info().IsSmi()) {
__ SmiUntag(fresh_reg); __ SmiUntag(fresh_reg);
// Pushing the element is completely done. // Pushing the element is completely done.
} else { } else {
...@@ -819,7 +819,7 @@ void VirtualFrame::UntaggedPushFrameSlotAt(int index) { ...@@ -819,7 +819,7 @@ void VirtualFrame::UntaggedPushFrameSlotAt(int index) {
__ jmp(&done); __ jmp(&done);
__ bind(&not_smi); __ bind(&not_smi);
if (!original.number_info().IsNumber()) { if (!original.type_info().IsNumber()) {
__ cmp(FieldOperand(fresh_reg, HeapObject::kMapOffset), __ cmp(FieldOperand(fresh_reg, HeapObject::kMapOffset),
Factory::heap_number_map()); Factory::heap_number_map());
cgen()->unsafe_bailout_->Branch(not_equal); cgen()->unsafe_bailout_->Branch(not_equal);
...@@ -1151,11 +1151,11 @@ Result VirtualFrame::Pop() { ...@@ -1151,11 +1151,11 @@ Result VirtualFrame::Pop() {
ASSERT(element.is_untagged_int32() == cgen()->in_safe_int32_mode()); ASSERT(element.is_untagged_int32() == cgen()->in_safe_int32_mode());
// Get number type information of the result. // Get number type information of the result.
NumberInfo info; TypeInfo info;
if (!element.is_copy()) { if (!element.is_copy()) {
info = element.number_info(); info = element.type_info();
} else { } else {
info = elements_[element.index()].number_info(); info = elements_[element.index()].type_info();
} }
bool pop_needed = (stack_pointer_ == index); bool pop_needed = (stack_pointer_ == index);
...@@ -1165,7 +1165,7 @@ Result VirtualFrame::Pop() { ...@@ -1165,7 +1165,7 @@ Result VirtualFrame::Pop() {
Result temp = cgen()->allocator()->Allocate(); Result temp = cgen()->allocator()->Allocate();
ASSERT(temp.is_valid()); ASSERT(temp.is_valid());
__ pop(temp.reg()); __ pop(temp.reg());
temp.set_number_info(info); temp.set_type_info(info);
temp.set_untagged_int32(element.is_untagged_int32()); temp.set_untagged_int32(element.is_untagged_int32());
return temp; return temp;
} }
...@@ -1198,7 +1198,7 @@ Result VirtualFrame::Pop() { ...@@ -1198,7 +1198,7 @@ Result VirtualFrame::Pop() {
FrameElement new_element = FrameElement new_element =
FrameElement::RegisterElement(temp.reg(), FrameElement::RegisterElement(temp.reg(),
FrameElement::SYNCED, FrameElement::SYNCED,
element.number_info()); element.type_info());
// Preserve the copy flag on the element. // Preserve the copy flag on the element.
if (element.is_copied()) new_element.set_copied(); if (element.is_copied()) new_element.set_copied();
elements_[index] = new_element; elements_[index] = new_element;
...@@ -1233,7 +1233,7 @@ void VirtualFrame::EmitPop(Operand operand) { ...@@ -1233,7 +1233,7 @@ void VirtualFrame::EmitPop(Operand operand) {
} }
void VirtualFrame::EmitPush(Register reg, NumberInfo info) { void VirtualFrame::EmitPush(Register reg, TypeInfo info) {
ASSERT(stack_pointer_ == element_count() - 1); ASSERT(stack_pointer_ == element_count() - 1);
elements_.Add(FrameElement::MemoryElement(info)); elements_.Add(FrameElement::MemoryElement(info));
stack_pointer_++; stack_pointer_++;
...@@ -1241,7 +1241,7 @@ void VirtualFrame::EmitPush(Register reg, NumberInfo info) { ...@@ -1241,7 +1241,7 @@ void VirtualFrame::EmitPush(Register reg, NumberInfo info) {
} }
void VirtualFrame::EmitPush(Operand operand, NumberInfo info) { void VirtualFrame::EmitPush(Operand operand, TypeInfo info) {
ASSERT(stack_pointer_ == element_count() - 1); ASSERT(stack_pointer_ == element_count() - 1);
elements_.Add(FrameElement::MemoryElement(info)); elements_.Add(FrameElement::MemoryElement(info));
stack_pointer_++; stack_pointer_++;
...@@ -1249,7 +1249,7 @@ void VirtualFrame::EmitPush(Operand operand, NumberInfo info) { ...@@ -1249,7 +1249,7 @@ void VirtualFrame::EmitPush(Operand operand, NumberInfo info) {
} }
void VirtualFrame::EmitPush(Immediate immediate, NumberInfo info) { void VirtualFrame::EmitPush(Immediate immediate, TypeInfo info) {
ASSERT(stack_pointer_ == element_count() - 1); ASSERT(stack_pointer_ == element_count() - 1);
elements_.Add(FrameElement::MemoryElement(info)); elements_.Add(FrameElement::MemoryElement(info));
stack_pointer_++; stack_pointer_++;
......
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
#ifndef V8_IA32_VIRTUAL_FRAME_IA32_H_ #ifndef V8_IA32_VIRTUAL_FRAME_IA32_H_
#define V8_IA32_VIRTUAL_FRAME_IA32_H_ #define V8_IA32_VIRTUAL_FRAME_IA32_H_
#include "number-info.h" #include "type-info.h"
#include "register-allocator.h" #include "register-allocator.h"
#include "scopes.h" #include "scopes.h"
...@@ -84,7 +84,7 @@ class VirtualFrame: public ZoneObject { ...@@ -84,7 +84,7 @@ class VirtualFrame: public ZoneObject {
// Create a duplicate of an existing valid frame element. // Create a duplicate of an existing valid frame element.
FrameElement CopyElementAt(int index, FrameElement CopyElementAt(int index,
NumberInfo info = NumberInfo::Uninitialized()); TypeInfo info = TypeInfo::Uninitialized());
// The number of elements on the virtual frame. // The number of elements on the virtual frame.
int element_count() { return elements_.length(); } int element_count() { return elements_.length(); }
...@@ -398,14 +398,14 @@ class VirtualFrame: public ZoneObject { ...@@ -398,14 +398,14 @@ class VirtualFrame: public ZoneObject {
// Push an element on top of the expression stack and emit a // Push an element on top of the expression stack and emit a
// corresponding push instruction. // corresponding push instruction.
void EmitPush(Register reg, void EmitPush(Register reg,
NumberInfo info = NumberInfo::Unknown()); TypeInfo info = TypeInfo::Unknown());
void EmitPush(Operand operand, void EmitPush(Operand operand,
NumberInfo info = NumberInfo::Unknown()); TypeInfo info = TypeInfo::Unknown());
void EmitPush(Immediate immediate, void EmitPush(Immediate immediate,
NumberInfo info = NumberInfo::Unknown()); TypeInfo info = TypeInfo::Unknown());
// Push an element on the virtual frame. // Push an element on the virtual frame.
inline void Push(Register reg, NumberInfo info = NumberInfo::Unknown()); inline void Push(Register reg, TypeInfo info = TypeInfo::Unknown());
inline void Push(Handle<Object> value); inline void Push(Handle<Object> value);
inline void Push(Smi* value); inline void Push(Smi* value);
...@@ -417,7 +417,7 @@ class VirtualFrame: public ZoneObject { ...@@ -417,7 +417,7 @@ class VirtualFrame: public ZoneObject {
// This assert will trigger if you try to push the same value twice. // This assert will trigger if you try to push the same value twice.
ASSERT(result->is_valid()); ASSERT(result->is_valid());
if (result->is_register()) { if (result->is_register()) {
Push(result->reg(), result->number_info()); Push(result->reg(), result->type_info());
} else { } else {
ASSERT(result->is_constant()); ASSERT(result->is_constant());
Push(result->handle()); Push(result->handle());
...@@ -447,8 +447,8 @@ class VirtualFrame: public ZoneObject { ...@@ -447,8 +447,8 @@ class VirtualFrame: public ZoneObject {
} }
// Update the type information of a variable frame element directly. // Update the type information of a variable frame element directly.
inline void SetTypeForLocalAt(int index, NumberInfo info); inline void SetTypeForLocalAt(int index, TypeInfo info);
inline void SetTypeForParamAt(int index, NumberInfo info); inline void SetTypeForParamAt(int index, TypeInfo info);
private: private:
static const int kLocal0Offset = JavaScriptFrameConstants::kLocal0Offset; static const int kLocal0Offset = JavaScriptFrameConstants::kLocal0Offset;
......
...@@ -46,7 +46,7 @@ void JumpTarget::InitializeEntryElement(int index, FrameElement* target) { ...@@ -46,7 +46,7 @@ void JumpTarget::InitializeEntryElement(int index, FrameElement* target) {
entry_frame_->elements_[target->index()].set_copied(); entry_frame_->elements_[target->index()].set_copied();
} }
if (direction_ == BIDIRECTIONAL && !target->is_copy()) { if (direction_ == BIDIRECTIONAL && !target->is_copy()) {
element->set_number_info(NumberInfo::Unknown()); element->set_type_info(TypeInfo::Unknown());
} }
} }
......
...@@ -107,8 +107,8 @@ void JumpTarget::ComputeEntryFrame() { ...@@ -107,8 +107,8 @@ void JumpTarget::ComputeEntryFrame() {
// We overwrite the number information of one of the incoming frames. // We overwrite the number information of one of the incoming frames.
// This is safe because we only use the frame for emitting merge code. // This is safe because we only use the frame for emitting merge code.
// The number information of incoming frames is not used anymore. // The number information of incoming frames is not used anymore.
element->set_number_info(NumberInfo::Combine(element->number_info(), element->set_type_info(TypeInfo::Combine(element->type_info(),
other->number_info())); other->type_info()));
} }
} }
elements[i] = element; elements[i] = element;
...@@ -135,7 +135,7 @@ void JumpTarget::ComputeEntryFrame() { ...@@ -135,7 +135,7 @@ void JumpTarget::ComputeEntryFrame() {
FrameElement* target = elements[index]; FrameElement* target = elements[index];
if (target == NULL) { if (target == NULL) {
entry_frame_->elements_.Add( entry_frame_->elements_.Add(
FrameElement::MemoryElement(NumberInfo::Uninitialized())); FrameElement::MemoryElement(TypeInfo::Uninitialized()));
} else { } else {
entry_frame_->elements_.Add(*target); entry_frame_->elements_.Add(*target);
InitializeEntryElement(index, target); InitializeEntryElement(index, target);
...@@ -152,19 +152,19 @@ void JumpTarget::ComputeEntryFrame() { ...@@ -152,19 +152,19 @@ void JumpTarget::ComputeEntryFrame() {
RegisterFile candidate_registers; RegisterFile candidate_registers;
int best_count = kMinInt; int best_count = kMinInt;
int best_reg_num = RegisterAllocator::kInvalidRegister; int best_reg_num = RegisterAllocator::kInvalidRegister;
NumberInfo info = NumberInfo::Uninitialized(); TypeInfo info = TypeInfo::Uninitialized();
for (int j = 0; j < reaching_frames_.length(); j++) { for (int j = 0; j < reaching_frames_.length(); j++) {
FrameElement element = reaching_frames_[j]->elements_[i]; FrameElement element = reaching_frames_[j]->elements_[i];
if (direction_ == BIDIRECTIONAL) { if (direction_ == BIDIRECTIONAL) {
info = NumberInfo::Unknown(); info = TypeInfo::Unknown();
} else if (!element.is_copy()) { } else if (!element.is_copy()) {
info = NumberInfo::Combine(info, element.number_info()); info = TypeInfo::Combine(info, element.type_info());
} else { } else {
// New elements will not be copies, so get number information from // New elements will not be copies, so get number information from
// backing element in the reaching frame. // backing element in the reaching frame.
info = NumberInfo::Combine(info, info = TypeInfo::Combine(info,
reaching_frames_[j]->elements_[element.index()].number_info()); reaching_frames_[j]->elements_[element.index()].type_info());
} }
is_synced = is_synced && element.is_synced(); is_synced = is_synced && element.is_synced();
if (element.is_register() && !entry_frame_->is_used(element.reg())) { if (element.is_register() && !entry_frame_->is_used(element.reg())) {
...@@ -189,7 +189,7 @@ void JumpTarget::ComputeEntryFrame() { ...@@ -189,7 +189,7 @@ void JumpTarget::ComputeEntryFrame() {
if (is_synced) { if (is_synced) {
// Already recorded as a memory element. // Already recorded as a memory element.
// Set combined number info. // Set combined number info.
entry_frame_->elements_[i].set_number_info(info); entry_frame_->elements_[i].set_type_info(info);
continue; continue;
} }
...@@ -211,12 +211,12 @@ void JumpTarget::ComputeEntryFrame() { ...@@ -211,12 +211,12 @@ void JumpTarget::ComputeEntryFrame() {
Register reg = RegisterAllocator::ToRegister(best_reg_num); Register reg = RegisterAllocator::ToRegister(best_reg_num);
entry_frame_->elements_[i] = entry_frame_->elements_[i] =
FrameElement::RegisterElement(reg, FrameElement::NOT_SYNCED, FrameElement::RegisterElement(reg, FrameElement::NOT_SYNCED,
NumberInfo::Uninitialized()); TypeInfo::Uninitialized());
if (is_copied) entry_frame_->elements_[i].set_copied(); if (is_copied) entry_frame_->elements_[i].set_copied();
entry_frame_->set_register_location(reg, i); entry_frame_->set_register_location(reg, i);
} }
// Set combined number info. // Set combined number info.
entry_frame_->elements_[i].set_number_info(info); entry_frame_->elements_[i].set_type_info(info);
} }
} }
...@@ -225,7 +225,7 @@ void JumpTarget::ComputeEntryFrame() { ...@@ -225,7 +225,7 @@ void JumpTarget::ComputeEntryFrame() {
if (direction_ == BIDIRECTIONAL) { if (direction_ == BIDIRECTIONAL) {
for (int i = 0; i < length; ++i) { for (int i = 0; i < length; ++i) {
if (!entry_frame_->elements_[i].is_copy()) { if (!entry_frame_->elements_[i].is_copy()) {
ASSERT(entry_frame_->elements_[i].number_info().IsUnknown()); ASSERT(entry_frame_->elements_[i].type_info().IsUnknown());
} }
} }
} }
......
...@@ -104,36 +104,36 @@ void RegisterAllocator::Unuse(Register reg) { ...@@ -104,36 +104,36 @@ void RegisterAllocator::Unuse(Register reg) {
} }
NumberInfo Result::number_info() const { TypeInfo Result::type_info() const {
ASSERT(is_valid()); ASSERT(is_valid());
return NumberInfo::FromInt(NumberInfoField::decode(value_)); return TypeInfo::FromInt(TypeInfoField::decode(value_));
} }
void Result::set_number_info(NumberInfo info) { void Result::set_type_info(TypeInfo info) {
ASSERT(is_valid()); ASSERT(is_valid());
value_ &= ~NumberInfoField::mask(); value_ &= ~TypeInfoField::mask();
value_ |= NumberInfoField::encode(info.ToInt()); value_ |= TypeInfoField::encode(info.ToInt());
} }
bool Result::is_number() const { bool Result::is_number() const {
return number_info().IsNumber(); return type_info().IsNumber();
} }
bool Result::is_smi() const { bool Result::is_smi() const {
return number_info().IsSmi(); return type_info().IsSmi();
} }
bool Result::is_integer32() const { bool Result::is_integer32() const {
return number_info().IsInteger32(); return type_info().IsInteger32();
} }
bool Result::is_double() const { bool Result::is_double() const {
return number_info().IsDouble(); return type_info().IsDouble();
} }
} } // namespace v8::internal } } // namespace v8::internal
......
...@@ -38,11 +38,11 @@ namespace internal { ...@@ -38,11 +38,11 @@ namespace internal {
// Result implementation. // Result implementation.
Result::Result(Register reg, NumberInfo info) { Result::Result(Register reg, TypeInfo info) {
ASSERT(reg.is_valid() && !RegisterAllocator::IsReserved(reg)); ASSERT(reg.is_valid() && !RegisterAllocator::IsReserved(reg));
CodeGeneratorScope::Current()->allocator()->Use(reg); CodeGeneratorScope::Current()->allocator()->Use(reg);
value_ = TypeField::encode(REGISTER) value_ = TypeField::encode(REGISTER)
| NumberInfoField::encode(info.ToInt()) | TypeInfoField::encode(info.ToInt())
| DataField::encode(reg.code_); | DataField::encode(reg.code_);
} }
......
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
#define V8_REGISTER_ALLOCATOR_H_ #define V8_REGISTER_ALLOCATOR_H_
#include "macro-assembler.h" #include "macro-assembler.h"
#include "number-info-inl.h" #include "type-info-inl.h"
#if V8_TARGET_ARCH_IA32 #if V8_TARGET_ARCH_IA32
#include "ia32/register-allocator-ia32.h" #include "ia32/register-allocator-ia32.h"
...@@ -65,13 +65,13 @@ class Result BASE_EMBEDDED { ...@@ -65,13 +65,13 @@ class Result BASE_EMBEDDED {
Result() { invalidate(); } Result() { invalidate(); }
// Construct a register Result. // Construct a register Result.
explicit Result(Register reg, NumberInfo info = NumberInfo::Unknown()); explicit Result(Register reg, TypeInfo info = TypeInfo::Unknown());
// Construct a Result whose value is a compile-time constant. // Construct a Result whose value is a compile-time constant.
explicit Result(Handle<Object> value) { explicit Result(Handle<Object> value) {
NumberInfo info = NumberInfo::TypeFromValue(value); TypeInfo info = TypeInfo::TypeFromValue(value);
value_ = TypeField::encode(CONSTANT) value_ = TypeField::encode(CONSTANT)
| NumberInfoField::encode(info.ToInt()) | TypeInfoField::encode(info.ToInt())
| IsUntaggedInt32Field::encode(false) | IsUntaggedInt32Field::encode(false)
| DataField::encode(ConstantList()->length()); | DataField::encode(ConstantList()->length());
ConstantList()->Add(value); ConstantList()->Add(value);
...@@ -103,8 +103,8 @@ class Result BASE_EMBEDDED { ...@@ -103,8 +103,8 @@ class Result BASE_EMBEDDED {
void invalidate() { value_ = TypeField::encode(INVALID); } void invalidate() { value_ = TypeField::encode(INVALID); }
inline NumberInfo number_info() const; inline TypeInfo type_info() const;
inline void set_number_info(NumberInfo info); inline void set_type_info(TypeInfo info);
inline bool is_number() const; inline bool is_number() const;
inline bool is_smi() const; inline bool is_smi() const;
inline bool is_integer32() const; inline bool is_integer32() const;
...@@ -155,7 +155,7 @@ class Result BASE_EMBEDDED { ...@@ -155,7 +155,7 @@ class Result BASE_EMBEDDED {
// Declare BitFields with template parameters <type, start, size>. // Declare BitFields with template parameters <type, start, size>.
class TypeField: public BitField<Type, 0, 2> {}; class TypeField: public BitField<Type, 0, 2> {};
class NumberInfoField : public BitField<int, 2, 6> {}; class TypeInfoField : public BitField<int, 2, 6> {};
class IsUntaggedInt32Field : public BitField<bool, 8, 1> {}; class IsUntaggedInt32Field : public BitField<bool, 8, 1> {};
class DataField: public BitField<uint32_t, 9, 32 - 9> {}; class DataField: public BitField<uint32_t, 9, 32 - 9> {};
......
...@@ -25,26 +25,26 @@ ...@@ -25,26 +25,26 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifndef V8_NUMBER_INFO_INL_H_ #ifndef V8_TYPE_INFO_INL_H_
#define V8_NUMBER_INFO_INL_H_ #define V8_TYPE_INFO_INL_H_
#include "number-info.h" #include "type-info.h"
#include "objects-inl.h" #include "objects-inl.h"
namespace v8 { namespace v8 {
namespace internal { namespace internal {
NumberInfo NumberInfo::TypeFromValue(Handle<Object> value) { TypeInfo TypeInfo::TypeFromValue(Handle<Object> value) {
NumberInfo info; TypeInfo info;
if (value->IsSmi()) { if (value->IsSmi()) {
info = NumberInfo::Smi(); info = TypeInfo::Smi();
} else if (value->IsHeapNumber()) { } else if (value->IsHeapNumber()) {
info = NumberInfo::IsInt32Double(HeapNumber::cast(*value)->value()) info = TypeInfo::IsInt32Double(HeapNumber::cast(*value)->value())
? NumberInfo::Integer32() ? TypeInfo::Integer32()
: NumberInfo::Double(); : TypeInfo::Double();
} else { } else {
info = NumberInfo::Unknown(); info = TypeInfo::Unknown();
} }
return info; return info;
} }
...@@ -52,4 +52,4 @@ NumberInfo NumberInfo::TypeFromValue(Handle<Object> value) { ...@@ -52,4 +52,4 @@ NumberInfo NumberInfo::TypeFromValue(Handle<Object> value) {
} } // namespace v8::internal } } // namespace v8::internal
#endif // V8_NUMBER_INFO_INL_H_ #endif // V8_TYPE_INFO_INL_H_
...@@ -25,8 +25,8 @@ ...@@ -25,8 +25,8 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifndef V8_NUMBER_INFO_H_ #ifndef V8_TYPE_INFO_H_
#define V8_NUMBER_INFO_H_ #define V8_TYPE_INFO_H_
#include "globals.h" #include "globals.h"
...@@ -45,25 +45,25 @@ namespace internal { ...@@ -45,25 +45,25 @@ namespace internal {
// | / / // | / /
// Uninitialized. // Uninitialized.
class NumberInfo { class TypeInfo {
public: public:
NumberInfo() { } TypeInfo() { }
static inline NumberInfo Unknown(); static inline TypeInfo Unknown();
// We know it's a primitive type. // We know it's a primitive type.
static inline NumberInfo Primitive(); static inline TypeInfo Primitive();
// We know it's a number of some sort. // We know it's a number of some sort.
static inline NumberInfo Number(); static inline TypeInfo Number();
// We know it's signed or unsigned 32 bit integer. // We know it's signed or unsigned 32 bit integer.
static inline NumberInfo Integer32(); static inline TypeInfo Integer32();
// We know it's a Smi. // We know it's a Smi.
static inline NumberInfo Smi(); static inline TypeInfo Smi();
// We know it's a heap number. // We know it's a heap number.
static inline NumberInfo Double(); static inline TypeInfo Double();
// We know it's a string. // We know it's a string.
static inline NumberInfo String(); static inline TypeInfo String();
// We haven't started collecting info yet. // We haven't started collecting info yet.
static inline NumberInfo Uninitialized(); static inline TypeInfo Uninitialized();
// Return compact representation. Very sensitive to enum values below! // Return compact representation. Very sensitive to enum values below!
// Compacting drops information about primtive types and strings types. // Compacting drops information about primtive types and strings types.
...@@ -78,7 +78,7 @@ class NumberInfo { ...@@ -78,7 +78,7 @@ class NumberInfo {
} }
// Decode compact representation. Very sensitive to enum values below! // Decode compact representation. Very sensitive to enum values below!
static NumberInfo ExpandedRepresentation(int three_bit_representation) { static TypeInfo ExpandedRepresentation(int three_bit_representation) {
Type t = static_cast<Type>(three_bit_representation >= 6 ? Type t = static_cast<Type>(three_bit_representation >= 6 ?
three_bit_representation + 2 : three_bit_representation + 2 :
three_bit_representation); three_bit_representation);
...@@ -88,14 +88,14 @@ class NumberInfo { ...@@ -88,14 +88,14 @@ class NumberInfo {
t == kInteger32Type || t == kInteger32Type ||
t == kSmiType || t == kSmiType ||
t == kDoubleType); t == kDoubleType);
return NumberInfo(t); return TypeInfo(t);
} }
int ToInt() { int ToInt() {
return type_; return type_;
} }
static NumberInfo FromInt(int bit_representation) { static TypeInfo FromInt(int bit_representation) {
Type t = static_cast<Type>(bit_representation); Type t = static_cast<Type>(bit_representation);
ASSERT(t == kUnknownType || ASSERT(t == kUnknownType ||
t == kPrimitiveType || t == kPrimitiveType ||
...@@ -104,12 +104,12 @@ class NumberInfo { ...@@ -104,12 +104,12 @@ class NumberInfo {
t == kSmiType || t == kSmiType ||
t == kDoubleType || t == kDoubleType ||
t == kStringType); t == kStringType);
return NumberInfo(t); return TypeInfo(t);
} }
// Return the weakest (least precise) common type. // Return the weakest (least precise) common type.
static NumberInfo Combine(NumberInfo a, NumberInfo b) { static TypeInfo Combine(TypeInfo a, TypeInfo b) {
return NumberInfo(static_cast<Type>(a.type_ & b.type_)); return TypeInfo(static_cast<Type>(a.type_ & b.type_));
} }
...@@ -130,7 +130,7 @@ class NumberInfo { ...@@ -130,7 +130,7 @@ class NumberInfo {
return false; return false;
} }
static inline NumberInfo TypeFromValue(Handle<Object> value); static inline TypeInfo TypeFromValue(Handle<Object> value);
inline bool IsUnknown() { inline bool IsUnknown() {
return type_ == kUnknownType; return type_ == kUnknownType;
...@@ -189,51 +189,51 @@ class NumberInfo { ...@@ -189,51 +189,51 @@ class NumberInfo {
kStringType = 0x30, // 110000 kStringType = 0x30, // 110000
kUninitializedType = 0x3f // 111111 kUninitializedType = 0x3f // 111111
}; };
explicit inline NumberInfo(Type t) : type_(t) { } explicit inline TypeInfo(Type t) : type_(t) { }
Type type_; Type type_;
}; };
NumberInfo NumberInfo::Unknown() { TypeInfo TypeInfo::Unknown() {
return NumberInfo(kUnknownType); return TypeInfo(kUnknownType);
} }
NumberInfo NumberInfo::Primitive() { TypeInfo TypeInfo::Primitive() {
return NumberInfo(kPrimitiveType); return TypeInfo(kPrimitiveType);
} }
NumberInfo NumberInfo::Number() { TypeInfo TypeInfo::Number() {
return NumberInfo(kNumberType); return TypeInfo(kNumberType);
} }
NumberInfo NumberInfo::Integer32() { TypeInfo TypeInfo::Integer32() {
return NumberInfo(kInteger32Type); return TypeInfo(kInteger32Type);
} }
NumberInfo NumberInfo::Smi() { TypeInfo TypeInfo::Smi() {
return NumberInfo(kSmiType); return TypeInfo(kSmiType);
} }
NumberInfo NumberInfo::Double() { TypeInfo TypeInfo::Double() {
return NumberInfo(kDoubleType); return TypeInfo(kDoubleType);
} }
NumberInfo NumberInfo::String() { TypeInfo TypeInfo::String() {
return NumberInfo(kStringType); return TypeInfo(kStringType);
} }
NumberInfo NumberInfo::Uninitialized() { TypeInfo TypeInfo::Uninitialized() {
return NumberInfo(kUninitializedType); return TypeInfo(kUninitializedType);
} }
} } // namespace v8::internal } } // namespace v8::internal
#endif // V8_NUMBER_INFO_H_ #endif // V8_TYPE_INFO_H_
...@@ -40,7 +40,7 @@ VirtualFrame::VirtualFrame() ...@@ -40,7 +40,7 @@ VirtualFrame::VirtualFrame()
: elements_(parameter_count() + local_count() + kPreallocatedElements), : elements_(parameter_count() + local_count() + kPreallocatedElements),
stack_pointer_(parameter_count() + 1) { // 0-based index of TOS. stack_pointer_(parameter_count() + 1) { // 0-based index of TOS.
for (int i = 0; i <= stack_pointer_; i++) { for (int i = 0; i <= stack_pointer_; i++) {
elements_.Add(FrameElement::MemoryElement(NumberInfo::Unknown())); elements_.Add(FrameElement::MemoryElement(TypeInfo::Unknown()));
} }
for (int i = 0; i < RegisterAllocator::kNumRegisters; i++) { for (int i = 0; i < RegisterAllocator::kNumRegisters; i++) {
register_locations_[i] = kIllegalIndex; register_locations_[i] = kIllegalIndex;
...@@ -65,7 +65,7 @@ void VirtualFrame::PushFrameSlotAt(int index) { ...@@ -65,7 +65,7 @@ void VirtualFrame::PushFrameSlotAt(int index) {
} }
void VirtualFrame::Push(Register reg, NumberInfo info) { void VirtualFrame::Push(Register reg, TypeInfo info) {
if (is_used(reg)) { if (is_used(reg)) {
int index = register_location(reg); int index = register_location(reg);
FrameElement element = CopyElementAt(index, info); FrameElement element = CopyElementAt(index, info);
...@@ -120,13 +120,13 @@ bool VirtualFrame::Equals(VirtualFrame* other) { ...@@ -120,13 +120,13 @@ bool VirtualFrame::Equals(VirtualFrame* other) {
} }
void VirtualFrame::SetTypeForLocalAt(int index, NumberInfo info) { void VirtualFrame::SetTypeForLocalAt(int index, TypeInfo info) {
elements_[local0_index() + index].set_number_info(info); elements_[local0_index() + index].set_type_info(info);
} }
void VirtualFrame::SetTypeForParamAt(int index, NumberInfo info) { void VirtualFrame::SetTypeForParamAt(int index, TypeInfo info) {
elements_[param0_index() + index].set_number_info(info); elements_[param0_index() + index].set_type_info(info);
} }
......
...@@ -43,7 +43,7 @@ namespace internal { ...@@ -43,7 +43,7 @@ namespace internal {
// not conflict with the existing type information and must be equally or // not conflict with the existing type information and must be equally or
// more precise. The default parameter value kUninitialized means that there // more precise. The default parameter value kUninitialized means that there
// is no additional information. // is no additional information.
FrameElement VirtualFrame::CopyElementAt(int index, NumberInfo info) { FrameElement VirtualFrame::CopyElementAt(int index, TypeInfo info) {
ASSERT(index >= 0); ASSERT(index >= 0);
ASSERT(index < element_count()); ASSERT(index < element_count());
...@@ -74,14 +74,14 @@ FrameElement VirtualFrame::CopyElementAt(int index, NumberInfo info) { ...@@ -74,14 +74,14 @@ FrameElement VirtualFrame::CopyElementAt(int index, NumberInfo info) {
result.set_index(index); result.set_index(index);
elements_[index].set_copied(); elements_[index].set_copied();
// Update backing element's number information. // Update backing element's number information.
NumberInfo existing = elements_[index].number_info(); TypeInfo existing = elements_[index].type_info();
ASSERT(!existing.IsUninitialized()); ASSERT(!existing.IsUninitialized());
// Assert that the new type information (a) does not conflict with the // Assert that the new type information (a) does not conflict with the
// existing one and (b) is equally or more precise. // existing one and (b) is equally or more precise.
ASSERT((info.ToInt() & existing.ToInt()) == existing.ToInt()); ASSERT((info.ToInt() & existing.ToInt()) == existing.ToInt());
ASSERT((info.ToInt() | existing.ToInt()) == info.ToInt()); ASSERT((info.ToInt() | existing.ToInt()) == info.ToInt());
elements_[index].set_number_info(!info.IsUninitialized() elements_[index].set_type_info(!info.IsUninitialized()
? info ? info
: existing); : existing);
break; break;
...@@ -104,7 +104,7 @@ void VirtualFrame::Adjust(int count) { ...@@ -104,7 +104,7 @@ void VirtualFrame::Adjust(int count) {
ASSERT(stack_pointer_ == element_count() - 1); ASSERT(stack_pointer_ == element_count() - 1);
for (int i = 0; i < count; i++) { for (int i = 0; i < count; i++) {
elements_.Add(FrameElement::MemoryElement(NumberInfo::Unknown())); elements_.Add(FrameElement::MemoryElement(TypeInfo::Unknown()));
} }
stack_pointer_ += count; stack_pointer_ += count;
} }
...@@ -152,11 +152,11 @@ void VirtualFrame::SpillElementAt(int index) { ...@@ -152,11 +152,11 @@ void VirtualFrame::SpillElementAt(int index) {
SyncElementAt(index); SyncElementAt(index);
// Number type information is preserved. // Number type information is preserved.
// Copies get their number information from their backing element. // Copies get their number information from their backing element.
NumberInfo info; TypeInfo info;
if (!elements_[index].is_copy()) { if (!elements_[index].is_copy()) {
info = elements_[index].number_info(); info = elements_[index].type_info();
} else { } else {
info = elements_[elements_[index].index()].number_info(); info = elements_[elements_[index].index()].type_info();
} }
// The element is now in memory. Its copied flag is preserved. // The element is now in memory. Its copied flag is preserved.
FrameElement new_element = FrameElement::MemoryElement(info); FrameElement new_element = FrameElement::MemoryElement(info);
...@@ -318,7 +318,7 @@ void VirtualFrame::SetElementAt(int index, Result* value) { ...@@ -318,7 +318,7 @@ void VirtualFrame::SetElementAt(int index, Result* value) {
elements_[frame_index] = elements_[frame_index] =
FrameElement::RegisterElement(value->reg(), FrameElement::RegisterElement(value->reg(),
FrameElement::NOT_SYNCED, FrameElement::NOT_SYNCED,
value->number_info()); value->type_info());
} }
} else { } else {
ASSERT(value->is_constant()); ASSERT(value->is_constant());
......
...@@ -4368,7 +4368,7 @@ void CodeGenerator::ToBoolean(ControlDestination* dest) { ...@@ -4368,7 +4368,7 @@ void CodeGenerator::ToBoolean(ControlDestination* dest) {
if (value.is_number()) { if (value.is_number()) {
Comment cmnt(masm_, "ONLY_NUMBER"); Comment cmnt(masm_, "ONLY_NUMBER");
// Fast case if NumberInfo indicates only numbers. // Fast case if TypeInfo indicates only numbers.
if (FLAG_debug_code) { if (FLAG_debug_code) {
__ AbortIfNotNumber(value.reg(), "ToBoolean operand is not a number."); __ AbortIfNotNumber(value.reg(), "ToBoolean operand is not a number.");
} }
...@@ -5291,8 +5291,8 @@ void CodeGenerator::GenericBinaryOperation(Token::Value op, ...@@ -5291,8 +5291,8 @@ void CodeGenerator::GenericBinaryOperation(Token::Value op,
} }
// Get number type of left and right sub-expressions. // Get number type of left and right sub-expressions.
NumberInfo operands_type = TypeInfo operands_type =
NumberInfo::Combine(left.number_info(), right.number_info()); TypeInfo::Combine(left.type_info(), right.type_info());
Result answer; Result answer;
if (left_is_non_smi_constant || right_is_non_smi_constant) { if (left_is_non_smi_constant || right_is_non_smi_constant) {
...@@ -5324,13 +5324,13 @@ void CodeGenerator::GenericBinaryOperation(Token::Value op, ...@@ -5324,13 +5324,13 @@ void CodeGenerator::GenericBinaryOperation(Token::Value op,
} }
} }
// Set NumberInfo of result according to the operation performed. // Set TypeInfo of result according to the operation performed.
// We rely on the fact that smis have a 32 bit payload on x64. // We rely on the fact that smis have a 32 bit payload on x64.
ASSERT(kSmiValueSize == 32); ASSERT(kSmiValueSize == 32);
NumberInfo result_type = NumberInfo::Unknown(); TypeInfo result_type = TypeInfo::Unknown();
switch (op) { switch (op) {
case Token::COMMA: case Token::COMMA:
result_type = right.number_info(); result_type = right.type_info();
break; break;
case Token::OR: case Token::OR:
case Token::AND: case Token::AND:
...@@ -5341,37 +5341,37 @@ void CodeGenerator::GenericBinaryOperation(Token::Value op, ...@@ -5341,37 +5341,37 @@ void CodeGenerator::GenericBinaryOperation(Token::Value op,
case Token::BIT_XOR: case Token::BIT_XOR:
case Token::BIT_AND: case Token::BIT_AND:
// Result is always a smi. // Result is always a smi.
result_type = NumberInfo::Smi(); result_type = TypeInfo::Smi();
break; break;
case Token::SAR: case Token::SAR:
case Token::SHL: case Token::SHL:
// Result is always a smi. // Result is always a smi.
result_type = NumberInfo::Smi(); result_type = TypeInfo::Smi();
break; break;
case Token::SHR: case Token::SHR:
// Result of x >>> y is always a smi if y >= 1, otherwise a number. // Result of x >>> y is always a smi if y >= 1, otherwise a number.
result_type = (right.is_constant() && right.handle()->IsSmi() result_type = (right.is_constant() && right.handle()->IsSmi()
&& Smi::cast(*right.handle())->value() >= 1) && Smi::cast(*right.handle())->value() >= 1)
? NumberInfo::Smi() ? TypeInfo::Smi()
: NumberInfo::Number(); : TypeInfo::Number();
break; break;
case Token::ADD: case Token::ADD:
// Result could be a string or a number. Check types of inputs. // Result could be a string or a number. Check types of inputs.
result_type = operands_type.IsNumber() result_type = operands_type.IsNumber()
? NumberInfo::Number() ? TypeInfo::Number()
: NumberInfo::Unknown(); : TypeInfo::Unknown();
break; break;
case Token::SUB: case Token::SUB:
case Token::MUL: case Token::MUL:
case Token::DIV: case Token::DIV:
case Token::MOD: case Token::MOD:
// Result is always a number. // Result is always a number.
result_type = NumberInfo::Number(); result_type = TypeInfo::Number();
break; break;
default: default:
UNREACHABLE(); UNREACHABLE();
} }
answer.set_number_info(result_type); answer.set_type_info(result_type);
frame_->Push(&answer); frame_->Push(&answer);
} }
......
...@@ -667,7 +667,7 @@ class GenericBinaryOpStub: public CodeStub { ...@@ -667,7 +667,7 @@ class GenericBinaryOpStub: public CodeStub {
GenericBinaryOpStub(Token::Value op, GenericBinaryOpStub(Token::Value op,
OverwriteMode mode, OverwriteMode mode,
GenericBinaryFlags flags, GenericBinaryFlags flags,
NumberInfo operands_type = NumberInfo::Unknown()) TypeInfo operands_type = TypeInfo::Unknown())
: op_(op), : op_(op),
mode_(mode), mode_(mode),
flags_(flags), flags_(flags),
...@@ -687,7 +687,7 @@ class GenericBinaryOpStub: public CodeStub { ...@@ -687,7 +687,7 @@ class GenericBinaryOpStub: public CodeStub {
args_in_registers_(ArgsInRegistersBits::decode(key)), args_in_registers_(ArgsInRegistersBits::decode(key)),
args_reversed_(ArgsReversedBits::decode(key)), args_reversed_(ArgsReversedBits::decode(key)),
use_sse3_(SSE3Bits::decode(key)), use_sse3_(SSE3Bits::decode(key)),
static_operands_type_(NumberInfo::ExpandedRepresentation( static_operands_type_(TypeInfo::ExpandedRepresentation(
StaticTypeInfoBits::decode(key))), StaticTypeInfoBits::decode(key))),
runtime_operands_type_(type_info), runtime_operands_type_(type_info),
name_(NULL) { name_(NULL) {
...@@ -714,7 +714,7 @@ class GenericBinaryOpStub: public CodeStub { ...@@ -714,7 +714,7 @@ class GenericBinaryOpStub: public CodeStub {
bool use_sse3_; bool use_sse3_;
// Number type information of operands, determined by code generator. // Number type information of operands, determined by code generator.
NumberInfo static_operands_type_; TypeInfo static_operands_type_;
// Operand type information determined at runtime. // Operand type information determined at runtime.
BinaryOpIC::TypeInfo runtime_operands_type_; BinaryOpIC::TypeInfo runtime_operands_type_;
......
...@@ -44,7 +44,7 @@ void Result::ToRegister() { ...@@ -44,7 +44,7 @@ void Result::ToRegister() {
ASSERT(fresh.is_valid()); ASSERT(fresh.is_valid());
CodeGeneratorScope::Current()->masm()->Move(fresh.reg(), handle()); CodeGeneratorScope::Current()->masm()->Move(fresh.reg(), handle());
// This result becomes a copy of the fresh one. // This result becomes a copy of the fresh one.
fresh.set_number_info(number_info()); fresh.set_type_info(type_info());
*this = fresh; *this = fresh;
} }
ASSERT(is_register()); ASSERT(is_register());
...@@ -62,7 +62,7 @@ void Result::ToRegister(Register target) { ...@@ -62,7 +62,7 @@ void Result::ToRegister(Register target) {
ASSERT(is_constant()); ASSERT(is_constant());
CodeGeneratorScope::Current()->masm()->Move(fresh.reg(), handle()); CodeGeneratorScope::Current()->masm()->Move(fresh.reg(), handle());
} }
fresh.set_number_info(number_info()); fresh.set_type_info(type_info());
*this = fresh; *this = fresh;
} else if (is_register() && reg().is(target)) { } else if (is_register() && reg().is(target)) {
ASSERT(CodeGeneratorScope::Current()->has_valid_frame()); ASSERT(CodeGeneratorScope::Current()->has_valid_frame());
......
...@@ -177,7 +177,7 @@ void VirtualFrame::EmitPop(const Operand& operand) { ...@@ -177,7 +177,7 @@ void VirtualFrame::EmitPop(const Operand& operand) {
} }
void VirtualFrame::EmitPush(Register reg, NumberInfo info) { void VirtualFrame::EmitPush(Register reg, TypeInfo info) {
ASSERT(stack_pointer_ == element_count() - 1); ASSERT(stack_pointer_ == element_count() - 1);
elements_.Add(FrameElement::MemoryElement(info)); elements_.Add(FrameElement::MemoryElement(info));
stack_pointer_++; stack_pointer_++;
...@@ -185,7 +185,7 @@ void VirtualFrame::EmitPush(Register reg, NumberInfo info) { ...@@ -185,7 +185,7 @@ void VirtualFrame::EmitPush(Register reg, NumberInfo info) {
} }
void VirtualFrame::EmitPush(const Operand& operand, NumberInfo info) { void VirtualFrame::EmitPush(const Operand& operand, TypeInfo info) {
ASSERT(stack_pointer_ == element_count() - 1); ASSERT(stack_pointer_ == element_count() - 1);
elements_.Add(FrameElement::MemoryElement(info)); elements_.Add(FrameElement::MemoryElement(info));
stack_pointer_++; stack_pointer_++;
...@@ -193,7 +193,7 @@ void VirtualFrame::EmitPush(const Operand& operand, NumberInfo info) { ...@@ -193,7 +193,7 @@ void VirtualFrame::EmitPush(const Operand& operand, NumberInfo info) {
} }
void VirtualFrame::EmitPush(Immediate immediate, NumberInfo info) { void VirtualFrame::EmitPush(Immediate immediate, TypeInfo info) {
ASSERT(stack_pointer_ == element_count() - 1); ASSERT(stack_pointer_ == element_count() - 1);
elements_.Add(FrameElement::MemoryElement(info)); elements_.Add(FrameElement::MemoryElement(info));
stack_pointer_++; stack_pointer_++;
...@@ -203,7 +203,7 @@ void VirtualFrame::EmitPush(Immediate immediate, NumberInfo info) { ...@@ -203,7 +203,7 @@ void VirtualFrame::EmitPush(Immediate immediate, NumberInfo info) {
void VirtualFrame::EmitPush(Smi* smi_value) { void VirtualFrame::EmitPush(Smi* smi_value) {
ASSERT(stack_pointer_ == element_count() - 1); ASSERT(stack_pointer_ == element_count() - 1);
elements_.Add(FrameElement::MemoryElement(NumberInfo::Smi())); elements_.Add(FrameElement::MemoryElement(TypeInfo::Smi()));
stack_pointer_++; stack_pointer_++;
__ Push(smi_value); __ Push(smi_value);
} }
...@@ -211,14 +211,14 @@ void VirtualFrame::EmitPush(Smi* smi_value) { ...@@ -211,14 +211,14 @@ void VirtualFrame::EmitPush(Smi* smi_value) {
void VirtualFrame::EmitPush(Handle<Object> value) { void VirtualFrame::EmitPush(Handle<Object> value) {
ASSERT(stack_pointer_ == element_count() - 1); ASSERT(stack_pointer_ == element_count() - 1);
NumberInfo info = NumberInfo::TypeFromValue(value); TypeInfo info = TypeInfo::TypeFromValue(value);
elements_.Add(FrameElement::MemoryElement(info)); elements_.Add(FrameElement::MemoryElement(info));
stack_pointer_++; stack_pointer_++;
__ Push(value); __ Push(value);
} }
void VirtualFrame::EmitPush(Heap::RootListIndex index, NumberInfo info) { void VirtualFrame::EmitPush(Heap::RootListIndex index, TypeInfo info) {
ASSERT(stack_pointer_ == element_count() - 1); ASSERT(stack_pointer_ == element_count() - 1);
elements_.Add(FrameElement::MemoryElement(info)); elements_.Add(FrameElement::MemoryElement(info));
stack_pointer_++; stack_pointer_++;
...@@ -292,12 +292,12 @@ int VirtualFrame::InvalidateFrameSlotAt(int index) { ...@@ -292,12 +292,12 @@ int VirtualFrame::InvalidateFrameSlotAt(int index) {
elements_[new_backing_index] = elements_[new_backing_index] =
FrameElement::RegisterElement(backing_reg, FrameElement::RegisterElement(backing_reg,
FrameElement::SYNCED, FrameElement::SYNCED,
original.number_info()); original.type_info());
} else { } else {
elements_[new_backing_index] = elements_[new_backing_index] =
FrameElement::RegisterElement(backing_reg, FrameElement::RegisterElement(backing_reg,
FrameElement::NOT_SYNCED, FrameElement::NOT_SYNCED,
original.number_info()); original.type_info());
} }
// Update the other copies. // Update the other copies.
for (int i = new_backing_index + 1; i < element_count(); i++) { for (int i = new_backing_index + 1; i < element_count(); i++) {
...@@ -329,7 +329,7 @@ void VirtualFrame::TakeFrameSlotAt(int index) { ...@@ -329,7 +329,7 @@ void VirtualFrame::TakeFrameSlotAt(int index) {
FrameElement new_element = FrameElement new_element =
FrameElement::RegisterElement(fresh.reg(), FrameElement::RegisterElement(fresh.reg(),
FrameElement::NOT_SYNCED, FrameElement::NOT_SYNCED,
original.number_info()); original.type_info());
Use(fresh.reg(), element_count()); Use(fresh.reg(), element_count());
elements_.Add(new_element); elements_.Add(new_element);
__ movq(fresh.reg(), Operand(rbp, fp_relative(index))); __ movq(fresh.reg(), Operand(rbp, fp_relative(index)));
...@@ -475,7 +475,7 @@ void VirtualFrame::MakeMergable() { ...@@ -475,7 +475,7 @@ void VirtualFrame::MakeMergable() {
if (element.is_constant() || element.is_copy()) { if (element.is_constant() || element.is_copy()) {
if (element.is_synced()) { if (element.is_synced()) {
// Just spill. // Just spill.
elements_[i] = FrameElement::MemoryElement(NumberInfo::Unknown()); elements_[i] = FrameElement::MemoryElement(TypeInfo::Unknown());
} else { } else {
// Allocate to a register. // Allocate to a register.
FrameElement backing_element; // Invalid if not a copy. FrameElement backing_element; // Invalid if not a copy.
...@@ -487,7 +487,7 @@ void VirtualFrame::MakeMergable() { ...@@ -487,7 +487,7 @@ void VirtualFrame::MakeMergable() {
elements_[i] = elements_[i] =
FrameElement::RegisterElement(fresh.reg(), FrameElement::RegisterElement(fresh.reg(),
FrameElement::NOT_SYNCED, FrameElement::NOT_SYNCED,
NumberInfo::Unknown()); TypeInfo::Unknown());
Use(fresh.reg(), i); Use(fresh.reg(), i);
// Emit a move. // Emit a move.
...@@ -516,7 +516,7 @@ void VirtualFrame::MakeMergable() { ...@@ -516,7 +516,7 @@ void VirtualFrame::MakeMergable() {
// The copy flag is not relied on before the end of this loop, // The copy flag is not relied on before the end of this loop,
// including when registers are spilled. // including when registers are spilled.
elements_[i].clear_copied(); elements_[i].clear_copied();
elements_[i].set_number_info(NumberInfo::Unknown()); elements_[i].set_type_info(TypeInfo::Unknown());
} }
} }
} }
...@@ -723,11 +723,11 @@ Result VirtualFrame::Pop() { ...@@ -723,11 +723,11 @@ Result VirtualFrame::Pop() {
ASSERT(element.is_valid()); ASSERT(element.is_valid());
// Get number type information of the result. // Get number type information of the result.
NumberInfo info; TypeInfo info;
if (!element.is_copy()) { if (!element.is_copy()) {
info = element.number_info(); info = element.type_info();
} else { } else {
info = elements_[element.index()].number_info(); info = elements_[element.index()].type_info();
} }
bool pop_needed = (stack_pointer_ == index); bool pop_needed = (stack_pointer_ == index);
...@@ -737,7 +737,7 @@ Result VirtualFrame::Pop() { ...@@ -737,7 +737,7 @@ Result VirtualFrame::Pop() {
Result temp = cgen()->allocator()->Allocate(); Result temp = cgen()->allocator()->Allocate();
ASSERT(temp.is_valid()); ASSERT(temp.is_valid());
__ pop(temp.reg()); __ pop(temp.reg());
temp.set_number_info(info); temp.set_type_info(info);
return temp; return temp;
} }
...@@ -767,7 +767,7 @@ Result VirtualFrame::Pop() { ...@@ -767,7 +767,7 @@ Result VirtualFrame::Pop() {
FrameElement new_element = FrameElement new_element =
FrameElement::RegisterElement(temp.reg(), FrameElement::RegisterElement(temp.reg(),
FrameElement::SYNCED, FrameElement::SYNCED,
element.number_info()); element.type_info());
// Preserve the copy flag on the element. // Preserve the copy flag on the element.
if (element.is_copied()) new_element.set_copied(); if (element.is_copied()) new_element.set_copied();
elements_[index] = new_element; elements_[index] = new_element;
......
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
#ifndef V8_X64_VIRTUAL_FRAME_X64_H_ #ifndef V8_X64_VIRTUAL_FRAME_X64_H_
#define V8_X64_VIRTUAL_FRAME_X64_H_ #define V8_X64_VIRTUAL_FRAME_X64_H_
#include "number-info.h" #include "type-info.h"
#include "register-allocator.h" #include "register-allocator.h"
#include "scopes.h" #include "scopes.h"
...@@ -83,7 +83,7 @@ class VirtualFrame : public ZoneObject { ...@@ -83,7 +83,7 @@ class VirtualFrame : public ZoneObject {
// Create a duplicate of an existing valid frame element. // Create a duplicate of an existing valid frame element.
FrameElement CopyElementAt(int index, FrameElement CopyElementAt(int index,
NumberInfo info = NumberInfo::Uninitialized()); TypeInfo info = TypeInfo::Uninitialized());
// The number of elements on the virtual frame. // The number of elements on the virtual frame.
int element_count() { return elements_.length(); } int element_count() { return elements_.length(); }
...@@ -383,19 +383,19 @@ class VirtualFrame : public ZoneObject { ...@@ -383,19 +383,19 @@ class VirtualFrame : public ZoneObject {
// Push an element on top of the expression stack and emit a // Push an element on top of the expression stack and emit a
// corresponding push instruction. // corresponding push instruction.
void EmitPush(Register reg, void EmitPush(Register reg,
NumberInfo info = NumberInfo::Unknown()); TypeInfo info = TypeInfo::Unknown());
void EmitPush(const Operand& operand, void EmitPush(const Operand& operand,
NumberInfo info = NumberInfo::Unknown()); TypeInfo info = TypeInfo::Unknown());
void EmitPush(Heap::RootListIndex index, void EmitPush(Heap::RootListIndex index,
NumberInfo info = NumberInfo::Unknown()); TypeInfo info = TypeInfo::Unknown());
void EmitPush(Immediate immediate, void EmitPush(Immediate immediate,
NumberInfo info = NumberInfo::Unknown()); TypeInfo info = TypeInfo::Unknown());
void EmitPush(Smi* value); void EmitPush(Smi* value);
// Uses kScratchRegister, emits appropriate relocation info. // Uses kScratchRegister, emits appropriate relocation info.
void EmitPush(Handle<Object> value); void EmitPush(Handle<Object> value);
// Push an element on the virtual frame. // Push an element on the virtual frame.
inline void Push(Register reg, NumberInfo info = NumberInfo::Unknown()); inline void Push(Register reg, TypeInfo info = TypeInfo::Unknown());
inline void Push(Handle<Object> value); inline void Push(Handle<Object> value);
inline void Push(Smi* value); inline void Push(Smi* value);
...@@ -403,7 +403,7 @@ class VirtualFrame : public ZoneObject { ...@@ -403,7 +403,7 @@ class VirtualFrame : public ZoneObject {
// frame). // frame).
void Push(Result* result) { void Push(Result* result) {
if (result->is_register()) { if (result->is_register()) {
Push(result->reg(), result->number_info()); Push(result->reg(), result->type_info());
} else { } else {
ASSERT(result->is_constant()); ASSERT(result->is_constant());
Push(result->handle()); Push(result->handle());
...@@ -416,8 +416,8 @@ class VirtualFrame : public ZoneObject { ...@@ -416,8 +416,8 @@ class VirtualFrame : public ZoneObject {
// the frame. Nip(k) is equivalent to x = Pop(), Drop(k), Push(x). // the frame. Nip(k) is equivalent to x = Pop(), Drop(k), Push(x).
inline void Nip(int num_dropped); inline void Nip(int num_dropped);
inline void SetTypeForLocalAt(int index, NumberInfo info); inline void SetTypeForLocalAt(int index, TypeInfo info);
inline void SetTypeForParamAt(int index, NumberInfo info); inline void SetTypeForParamAt(int index, TypeInfo info);
private: private:
static const int kLocal0Offset = JavaScriptFrameConstants::kLocal0Offset; static const int kLocal0Offset = JavaScriptFrameConstants::kLocal0Offset;
......
...@@ -330,8 +330,6 @@ ...@@ -330,8 +330,6 @@
'../../src/messages.cc', '../../src/messages.cc',
'../../src/messages.h', '../../src/messages.h',
'../../src/natives.h', '../../src/natives.h',
'../../src/number-info-inl.h',
'../../src/number-info.h',
'../../src/objects-debug.cc', '../../src/objects-debug.cc',
'../../src/objects-inl.h', '../../src/objects-inl.h',
'../../src/objects.cc', '../../src/objects.cc',
...@@ -388,6 +386,8 @@ ...@@ -388,6 +386,8 @@
'../../src/token.h', '../../src/token.h',
'../../src/top.cc', '../../src/top.cc',
'../../src/top.h', '../../src/top.h',
'../../src/type-info-inl.h',
'../../src/type-info.h',
'../../src/unicode-inl.h', '../../src/unicode-inl.h',
'../../src/unicode.cc', '../../src/unicode.cc',
'../../src/unicode.h', '../../src/unicode.h',
......
...@@ -688,14 +688,6 @@ ...@@ -688,14 +688,6 @@
RelativePath="..\..\src\natives.h" RelativePath="..\..\src\natives.h"
> >
</File> </File>
<File
RelativePath="..\..\src\number-info-inl.h"
>
</File>
<File
RelativePath="..\..\src\number-info.h"
>
</File>
<File <File
RelativePath="..\..\src\objects-debug.cc" RelativePath="..\..\src\objects-debug.cc"
> >
...@@ -936,6 +928,14 @@ ...@@ -936,6 +928,14 @@
RelativePath="..\..\src\top.h" RelativePath="..\..\src\top.h"
> >
</File> </File>
<File
RelativePath="..\..\src\type-info-inl.h"
>
</File>
<File
RelativePath="..\..\src\type-info.h"
>
</File>
<File <File
RelativePath="..\..\src\unicode-inl.h" RelativePath="..\..\src\unicode-inl.h"
> >
......
...@@ -668,14 +668,6 @@ ...@@ -668,14 +668,6 @@
RelativePath="..\..\src\natives.h" RelativePath="..\..\src\natives.h"
> >
</File> </File>
<File
RelativePath="..\..\src\number-info-inl.h"
>
</File>
<File
RelativePath="..\..\src\number-info.h"
>
</File>
<File <File
RelativePath="..\..\src\objects-debug.cc" RelativePath="..\..\src\objects-debug.cc"
> >
...@@ -924,6 +916,14 @@ ...@@ -924,6 +916,14 @@
RelativePath="..\..\src\top.h" RelativePath="..\..\src\top.h"
> >
</File> </File>
<File
RelativePath="..\..\src\type-info-inl.h"
>
</File>
<File
RelativePath="..\..\src\type-info.h"
>
</File>
<File <File
RelativePath="..\..\src\unicode-inl.h" RelativePath="..\..\src\unicode-inl.h"
> >
......
...@@ -665,14 +665,6 @@ ...@@ -665,14 +665,6 @@
RelativePath="..\..\src\natives.h" RelativePath="..\..\src\natives.h"
> >
</File> </File>
<File
RelativePath="..\..\src\number-info-inl.h"
>
</File>
<File
RelativePath="..\..\src\number-info.h"
>
</File>
<File <File
RelativePath="..\..\src\objects-debug.cc" RelativePath="..\..\src\objects-debug.cc"
> >
...@@ -913,6 +905,14 @@ ...@@ -913,6 +905,14 @@
RelativePath="..\..\src\top.h" RelativePath="..\..\src\top.h"
> >
</File> </File>
<File
RelativePath="..\..\src\type-info-inl.h"
>
</File>
<File
RelativePath="..\..\src\type-info.h"
>
</File>
<File <File
RelativePath="..\..\src\unicode-inl.h" RelativePath="..\..\src\unicode-inl.h"
> >
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment