Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(86)

Unified Diff: src/arm/lithium-arm.h

Issue 6577036: [Isolates] Merge from bleeding_edge to isolates, revisions 6100-6300. (Closed) Base URL: http://v8.googlecode.com/svn/branches/experimental/isolates/
Patch Set: '' Created 9 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/arm/ic-arm.cc ('k') | src/arm/lithium-arm.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/arm/lithium-arm.h
===================================================================
--- src/arm/lithium-arm.h (revision 6941)
+++ src/arm/lithium-arm.h (working copy)
@@ -1,4 +1,4 @@
-// Copyright 2010 the V8 project authors. All rights reserved.
+// Copyright 2011 the V8 project authors. All rights reserved.
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
@@ -30,6 +30,7 @@
#include "hydrogen.h"
#include "lithium-allocator.h"
+#include "lithium.h"
#include "safepoint-table.h"
namespace v8 {
@@ -37,8 +38,6 @@
// Forward declarations.
class LCodeGen;
-class LEnvironment;
-class Translation;
// Type hierarchy:
@@ -62,6 +61,7 @@
// LDivI
// LInstanceOf
// LInstanceOfAndBranch
+// LInstanceOfKnownGlobal
// LLoadKeyedFastElement
// LLoadKeyedGeneric
// LModI
@@ -76,6 +76,7 @@
// LCallNamed
// LCallRuntime
// LCallStub
+// LCheckPrototypeMaps
// LConstant
// LConstantD
// LConstantI
@@ -101,14 +102,14 @@
// LStoreNamedField
// LStoreNamedGeneric
// LUnaryOperation
-// LArrayLength
+// LJSArrayLength
+// LFixedArrayLength
// LBitNotI
// LBranch
// LCallNew
// LCheckFunction
// LCheckInstanceType
// LCheckMap
-// LCheckPrototypeMaps
// LCheckSmi
// LClassOfTest
// LClassOfTestAndBranch
@@ -127,6 +128,7 @@
// LIsSmiAndBranch
// LLoadNamedField
// LLoadNamedGeneric
+// LLoadFunctionPrototype
// LNumberTagD
// LNumberTagI
// LPushArgument
@@ -161,7 +163,6 @@
V(ArgumentsLength) \
V(ArithmeticD) \
V(ArithmeticT) \
- V(ArrayLength) \
V(ArrayLiteral) \
V(BitI) \
V(BitNotI) \
@@ -195,6 +196,7 @@
V(Deoptimize) \
V(DivI) \
V(DoubleToI) \
+ V(FixedArrayLength) \
V(FunctionLiteral) \
V(Gap) \
V(GlobalObject) \
@@ -202,6 +204,7 @@
V(Goto) \
V(InstanceOf) \
V(InstanceOfAndBranch) \
+ V(InstanceOfKnownGlobal) \
V(Integer32ToDouble) \
V(IsNull) \
V(IsNullAndBranch) \
@@ -209,6 +212,7 @@
V(IsObjectAndBranch) \
V(IsSmi) \
V(IsSmiAndBranch) \
+ V(JSArrayLength) \
V(HasInstanceType) \
V(HasInstanceTypeAndBranch) \
V(HasCachedArrayIndex) \
@@ -223,6 +227,7 @@
V(LoadKeyedGeneric) \
V(LoadNamedField) \
V(LoadNamedGeneric) \
+ V(LoadFunctionPrototype) \
V(ModI) \
V(MulI) \
V(NumberTagD) \
@@ -325,53 +330,6 @@
};
-class LGapNode;
-
-
-class LGapResolver BASE_EMBEDDED {
- public:
- LGapResolver(const ZoneList<LMoveOperands>* moves, LOperand* marker_operand);
- const ZoneList<LMoveOperands>* ResolveInReverseOrder();
-
- private:
- LGapNode* LookupNode(LOperand* operand);
- bool CanReach(LGapNode* a, LGapNode* b, int visited_id);
- bool CanReach(LGapNode* a, LGapNode* b);
- void RegisterMove(LMoveOperands move);
- void AddResultMove(LOperand* from, LOperand* to);
- void AddResultMove(LGapNode* from, LGapNode* to);
- void ResolveCycle(LGapNode* start);
-
- ZoneList<LGapNode*> nodes_;
- ZoneList<LGapNode*> identified_cycles_;
- ZoneList<LMoveOperands> result_;
- LOperand* marker_operand_;
- int next_visited_id_;
- int bailout_after_ast_id_;
-};
-
-
-class LParallelMove : public ZoneObject {
- public:
- LParallelMove() : move_operands_(4) { }
-
- void AddMove(LOperand* from, LOperand* to) {
- move_operands_.Add(LMoveOperands(from, to));
- }
-
- bool IsRedundant() const;
-
- const ZoneList<LMoveOperands>* move_operands() const {
- return &move_operands_;
- }
-
- void PrintDataTo(StringStream* stream) const;
-
- private:
- ZoneList<LMoveOperands> move_operands_;
-};
-
-
class LGap: public LInstruction {
public:
explicit LGap(HBasicBlock* block)
@@ -485,6 +443,10 @@
public:
DECLARE_CONCRETE_INSTRUCTION(CallStub, "call-stub")
DECLARE_HYDROGEN_ACCESSOR(CallStub)
+
+ TranscendentalCache::Type transcendental_type() {
+ return hydrogen()->transcendental_type();
+ }
};
@@ -621,29 +583,26 @@
class LCmpID: public LBinaryOperation {
public:
- LCmpID(Token::Value op, LOperand* left, LOperand* right, bool is_double)
- : LBinaryOperation(left, right), op_(op), is_double_(is_double) { }
+ LCmpID(LOperand* left, LOperand* right)
+ : LBinaryOperation(left, right) { }
- Token::Value op() const { return op_; }
- bool is_double() const { return is_double_; }
+ Token::Value op() const { return hydrogen()->token(); }
+ bool is_double() const {
+ return hydrogen()->GetInputRepresentation().IsDouble();
+ }
DECLARE_CONCRETE_INSTRUCTION(CmpID, "cmp-id")
-
- private:
- Token::Value op_;
- bool is_double_;
+ DECLARE_HYDROGEN_ACCESSOR(Compare)
};
class LCmpIDAndBranch: public LCmpID {
public:
- LCmpIDAndBranch(Token::Value op,
- LOperand* left,
+ LCmpIDAndBranch(LOperand* left,
LOperand* right,
int true_block_id,
- int false_block_id,
- bool is_double)
- : LCmpID(op, left, right, is_double),
+ int false_block_id)
+ : LCmpID(left, right),
true_block_id_(true_block_id),
false_block_id_(false_block_id) { }
@@ -662,14 +621,18 @@
class LUnaryMathOperation: public LUnaryOperation {
public:
- explicit LUnaryMathOperation(LOperand* value)
- : LUnaryOperation(value) { }
+ explicit LUnaryMathOperation(LOperand* value, LOperand* temp)
+ : LUnaryOperation(value), temp_(temp) { }
DECLARE_CONCRETE_INSTRUCTION(UnaryMathOperation, "unary-math-operation")
DECLARE_HYDROGEN_ACCESSOR(UnaryMathOperation)
virtual void PrintDataTo(StringStream* stream) const;
BuiltinFunctionId op() const { return hydrogen()->op(); }
+ LOperand* temp() const { return temp_; }
+
+ private:
+ LOperand* temp_;
};
@@ -706,27 +669,21 @@
class LIsNull: public LUnaryOperation {
public:
- LIsNull(LOperand* value, bool is_strict)
- : LUnaryOperation(value), is_strict_(is_strict) {}
+ explicit LIsNull(LOperand* value) : LUnaryOperation(value) {}
DECLARE_CONCRETE_INSTRUCTION(IsNull, "is-null")
+ DECLARE_HYDROGEN_ACCESSOR(IsNull);
- bool is_strict() const { return is_strict_; }
-
- private:
- bool is_strict_;
+ bool is_strict() const { return hydrogen()->is_strict(); }
};
class LIsNullAndBranch: public LIsNull {
public:
LIsNullAndBranch(LOperand* value,
- bool is_strict,
- LOperand* temp,
int true_block_id,
int false_block_id)
- : LIsNull(value, is_strict),
- temp_(temp),
+ : LIsNull(value),
true_block_id_(true_block_id),
false_block_id_(false_block_id) { }
@@ -737,10 +694,7 @@
int true_block_id() const { return true_block_id_; }
int false_block_id() const { return false_block_id_; }
- LOperand* temp() const { return temp_; }
-
private:
- LOperand* temp_;
int true_block_id_;
int false_block_id_;
};
@@ -835,11 +789,9 @@
class LHasInstanceTypeAndBranch: public LHasInstanceType {
public:
LHasInstanceTypeAndBranch(LOperand* value,
- LOperand* temporary,
int true_block_id,
int false_block_id)
: LHasInstanceType(value),
- temp_(temporary),
true_block_id_(true_block_id),
false_block_id_(false_block_id) { }
@@ -851,10 +803,7 @@
int true_block_id() const { return true_block_id_; }
int false_block_id() const { return false_block_id_; }
- LOperand* temp() { return temp_; }
-
private:
- LOperand* temp_;
int true_block_id_;
int false_block_id_;
};
@@ -894,18 +843,12 @@
class LClassOfTest: public LUnaryOperation {
public:
- LClassOfTest(LOperand* value, LOperand* temp)
- : LUnaryOperation(value), temporary_(temp) {}
+ explicit LClassOfTest(LOperand* value) : LUnaryOperation(value) {}
DECLARE_CONCRETE_INSTRUCTION(ClassOfTest, "class-of-test")
DECLARE_HYDROGEN_ACCESSOR(ClassOfTest)
virtual void PrintDataTo(StringStream* stream) const;
-
- LOperand* temporary() { return temporary_; }
-
- private:
- LOperand *temporary_;
};
@@ -913,11 +856,10 @@
public:
LClassOfTestAndBranch(LOperand* value,
LOperand* temporary,
- LOperand* temporary2,
int true_block_id,
int false_block_id)
- : LClassOfTest(value, temporary),
- temporary2_(temporary2),
+ : LClassOfTest(value),
+ temporary_(temporary),
true_block_id_(true_block_id),
false_block_id_(false_block_id) { }
@@ -928,10 +870,10 @@
int true_block_id() const { return true_block_id_; }
int false_block_id() const { return false_block_id_; }
- LOperand* temporary2() { return temporary2_; }
+ LOperand* temporary() { return temporary_; }
private:
- LOperand* temporary2_;
+ LOperand* temporary_;
int true_block_id_;
int false_block_id_;
};
@@ -999,6 +941,19 @@
};
+class LInstanceOfKnownGlobal: public LUnaryOperation {
+ public:
+ explicit LInstanceOfKnownGlobal(LOperand* left)
+ : LUnaryOperation(left) { }
+
+ DECLARE_CONCRETE_INSTRUCTION(InstanceOfKnownGlobal,
+ "instance-of-known-global")
+ DECLARE_HYDROGEN_ACCESSOR(InstanceOfKnownGlobal)
+
+ Handle<JSFunction> function() const { return hydrogen()->function(); }
+};
+
+
class LBoundsCheck: public LBinaryOperation {
public:
LBoundsCheck(LOperand* index, LOperand* length)
@@ -1117,42 +1072,43 @@
class LCmpMapAndBranch: public LUnaryOperation {
public:
- LCmpMapAndBranch(LOperand* value,
- Handle<Map> map,
- int true_block_id,
- int false_block_id)
- : LUnaryOperation(value),
- map_(map),
- true_block_id_(true_block_id),
- false_block_id_(false_block_id) { }
+ LCmpMapAndBranch(LOperand* value, LOperand* temp)
+ : LUnaryOperation(value), temp_(temp) { }
DECLARE_CONCRETE_INSTRUCTION(CmpMapAndBranch, "cmp-map-and-branch")
+ DECLARE_HYDROGEN_ACCESSOR(CompareMapAndBranch)
virtual bool IsControl() const { return true; }
- Handle<Map> map() const { return map_; }
- int true_block_id() const { return true_block_id_; }
- int false_block_id() const { return false_block_id_; }
+ LOperand* temp() const { return temp_; }
+ Handle<Map> map() const { return hydrogen()->map(); }
+ int true_block_id() const {
+ return hydrogen()->true_destination()->block_id();
+ }
+ int false_block_id() const {
+ return hydrogen()->false_destination()->block_id();
+ }
private:
- Handle<Map> map_;
- int true_block_id_;
- int false_block_id_;
+ LOperand* temp_;
};
-class LArrayLength: public LUnaryOperation {
+class LJSArrayLength: public LUnaryOperation {
public:
- LArrayLength(LOperand* input, LOperand* temporary)
- : LUnaryOperation(input), temporary_(temporary) { }
+ explicit LJSArrayLength(LOperand* input) : LUnaryOperation(input) { }
- LOperand* temporary() const { return temporary_; }
+ DECLARE_CONCRETE_INSTRUCTION(JSArrayLength, "js-array-length")
+ DECLARE_HYDROGEN_ACCESSOR(JSArrayLength)
+};
- DECLARE_CONCRETE_INSTRUCTION(ArrayLength, "array-length")
- DECLARE_HYDROGEN_ACCESSOR(ArrayLength)
- private:
- LOperand* temporary_;
+class LFixedArrayLength: public LUnaryOperation {
+ public:
+ explicit LFixedArrayLength(LOperand* input) : LUnaryOperation(input) { }
+
+ DECLARE_CONCRETE_INSTRUCTION(FixedArrayLength, "fixed-array-length")
+ DECLARE_HYDROGEN_ACCESSOR(FixedArrayLength)
};
@@ -1256,6 +1212,18 @@
};
+class LLoadFunctionPrototype: public LUnaryOperation {
+ public:
+ explicit LLoadFunctionPrototype(LOperand* function)
+ : LUnaryOperation(function) { }
+
+ DECLARE_CONCRETE_INSTRUCTION(LoadFunctionPrototype, "load-function-prototype")
+ DECLARE_HYDROGEN_ACCESSOR(LoadFunctionPrototype)
+
+ LOperand* function() const { return input(); }
+};
+
+
class LLoadElements: public LUnaryOperation {
public:
explicit LLoadElements(LOperand* obj) : LUnaryOperation(obj) { }
@@ -1266,21 +1234,14 @@
class LLoadKeyedFastElement: public LBinaryOperation {
public:
- LLoadKeyedFastElement(LOperand* elements,
- LOperand* key,
- LOperand* load_result)
- : LBinaryOperation(elements, key),
- load_result_(load_result) { }
+ LLoadKeyedFastElement(LOperand* elements, LOperand* key)
+ : LBinaryOperation(elements, key) { }
DECLARE_CONCRETE_INSTRUCTION(LoadKeyedFastElement, "load-keyed-fast-element")
DECLARE_HYDROGEN_ACCESSOR(LoadKeyedFastElement)
LOperand* elements() const { return left(); }
LOperand* key() const { return right(); }
- LOperand* load_result() const { return load_result_; }
-
- private:
- LOperand* load_result_;
};
@@ -1516,67 +1477,46 @@
class LStoreNamed: public LInstruction {
public:
- LStoreNamed(LOperand* obj, Handle<Object> name, LOperand* val)
- : object_(obj), name_(name), value_(val) { }
+ LStoreNamed(LOperand* obj, LOperand* val)
+ : object_(obj), value_(val) { }
DECLARE_INSTRUCTION(StoreNamed)
+ DECLARE_HYDROGEN_ACCESSOR(StoreNamed)
virtual void PrintDataTo(StringStream* stream) const;
LOperand* object() const { return object_; }
- Handle<Object> name() const { return name_; }
+ Handle<Object> name() const { return hydrogen()->name(); }
LOperand* value() const { return value_; }
private:
LOperand* object_;
- Handle<Object> name_;
LOperand* value_;
};
class LStoreNamedField: public LStoreNamed {
public:
- LStoreNamedField(LOperand* obj,
- Handle<Object> name,
- LOperand* val,
- bool in_object,
- int offset,
- LOperand* temp,
- bool needs_write_barrier,
- Handle<Map> transition)
- : LStoreNamed(obj, name, val),
- is_in_object_(in_object),
- offset_(offset),
- temp_(temp),
- needs_write_barrier_(needs_write_barrier),
- transition_(transition) { }
+ LStoreNamedField(LOperand* obj, LOperand* val)
+ : LStoreNamed(obj, val) { }
DECLARE_CONCRETE_INSTRUCTION(StoreNamedField, "store-named-field")
+ DECLARE_HYDROGEN_ACCESSOR(StoreNamedField)
- bool is_in_object() { return is_in_object_; }
- int offset() { return offset_; }
- LOperand* temp() { return temp_; }
- bool needs_write_barrier() { return needs_write_barrier_; }
- Handle<Map> transition() const { return transition_; }
- void set_transition(Handle<Map> map) { transition_ = map; }
-
- private:
- bool is_in_object_;
- int offset_;
- LOperand* temp_;
- bool needs_write_barrier_;
- Handle<Map> transition_;
+ bool is_in_object() { return hydrogen()->is_in_object(); }
+ int offset() { return hydrogen()->offset(); }
+ bool needs_write_barrier() { return hydrogen()->NeedsWriteBarrier(); }
+ Handle<Map> transition() { return hydrogen()->transition(); }
};
class LStoreNamedGeneric: public LStoreNamed {
public:
- LStoreNamedGeneric(LOperand* obj,
- Handle<Object> name,
- LOperand* val)
- : LStoreNamed(obj, name, val) { }
+ LStoreNamedGeneric(LOperand* obj, LOperand* val)
+ : LStoreNamed(obj, val) { }
DECLARE_CONCRETE_INSTRUCTION(StoreNamedGeneric, "store-named-generic")
+ DECLARE_HYDROGEN_ACCESSOR(StoreNamedGeneric)
};
@@ -1631,8 +1571,7 @@
class LCheckInstanceType: public LUnaryOperation {
public:
- LCheckInstanceType(LOperand* use, LOperand* temp)
- : LUnaryOperation(use), temp_(temp) { }
+ explicit LCheckInstanceType(LOperand* use) : LUnaryOperation(use) { }
DECLARE_CONCRETE_INSTRUCTION(CheckInstanceType, "check-instance-type")
DECLARE_HYDROGEN_ACCESSOR(CheckInstanceType)
@@ -1655,23 +1594,21 @@
class LCheckPrototypeMaps: public LInstruction {
public:
- LCheckPrototypeMaps(LOperand* temp,
- Handle<JSObject> holder,
- Handle<Map> receiver_map)
- : temp_(temp),
- holder_(holder),
- receiver_map_(receiver_map) { }
+ LCheckPrototypeMaps(LOperand* temp1, LOperand* temp2)
+ : temp1_(temp1), temp2_(temp2) { }
DECLARE_CONCRETE_INSTRUCTION(CheckPrototypeMaps, "check-prototype-maps")
+ DECLARE_HYDROGEN_ACCESSOR(CheckPrototypeMaps)
- LOperand* temp() const { return temp_; }
- Handle<JSObject> holder() const { return holder_; }
- Handle<Map> receiver_map() const { return receiver_map_; }
+ Handle<JSObject> prototype() const { return hydrogen()->prototype(); }
+ Handle<JSObject> holder() const { return hydrogen()->holder(); }
+ LOperand* temp1() const { return temp1_; }
+ LOperand* temp2() const { return temp2_; }
+
private:
- LOperand* temp_;
- Handle<JSObject> holder_;
- Handle<Map> receiver_map_;
+ LOperand* temp1_;
+ LOperand* temp2_;
};
@@ -1811,108 +1748,6 @@
};
-class LPointerMap: public ZoneObject {
- public:
- explicit LPointerMap(int position)
- : pointer_operands_(8), position_(position), lithium_position_(-1) { }
-
- const ZoneList<LOperand*>* operands() const { return &pointer_operands_; }
- int position() const { return position_; }
- int lithium_position() const { return lithium_position_; }
-
- void set_lithium_position(int pos) {
- ASSERT(lithium_position_ == -1);
- lithium_position_ = pos;
- }
-
- void RecordPointer(LOperand* op);
- void PrintTo(StringStream* stream) const;
-
- private:
- ZoneList<LOperand*> pointer_operands_;
- int position_;
- int lithium_position_;
-};
-
-
-class LEnvironment: public ZoneObject {
- public:
- LEnvironment(Handle<JSFunction> closure,
- int ast_id,
- int parameter_count,
- int argument_count,
- int value_count,
- LEnvironment* outer)
- : closure_(closure),
- arguments_stack_height_(argument_count),
- deoptimization_index_(Safepoint::kNoDeoptimizationIndex),
- translation_index_(-1),
- ast_id_(ast_id),
- parameter_count_(parameter_count),
- values_(value_count),
- representations_(value_count),
- spilled_registers_(NULL),
- spilled_double_registers_(NULL),
- outer_(outer) {
- }
-
- Handle<JSFunction> closure() const { return closure_; }
- int arguments_stack_height() const { return arguments_stack_height_; }
- int deoptimization_index() const { return deoptimization_index_; }
- int translation_index() const { return translation_index_; }
- int ast_id() const { return ast_id_; }
- int parameter_count() const { return parameter_count_; }
- const ZoneList<LOperand*>* values() const { return &values_; }
- LEnvironment* outer() const { return outer_; }
-
- void AddValue(LOperand* operand, Representation representation) {
- values_.Add(operand);
- representations_.Add(representation);
- }
-
- bool HasTaggedValueAt(int index) const {
- return representations_[index].IsTagged();
- }
-
- void Register(int deoptimization_index, int translation_index) {
- ASSERT(!HasBeenRegistered());
- deoptimization_index_ = deoptimization_index;
- translation_index_ = translation_index;
- }
- bool HasBeenRegistered() const {
- return deoptimization_index_ != Safepoint::kNoDeoptimizationIndex;
- }
-
- void SetSpilledRegisters(LOperand** registers,
- LOperand** double_registers) {
- spilled_registers_ = registers;
- spilled_double_registers_ = double_registers;
- }
-
- // Emit frame translation commands for this environment.
- void WriteTranslation(LCodeGen* cgen, Translation* translation) const;
-
- void PrintTo(StringStream* stream) const;
-
- private:
- Handle<JSFunction> closure_;
- int arguments_stack_height_;
- int deoptimization_index_;
- int translation_index_;
- int ast_id_;
- int parameter_count_;
- ZoneList<LOperand*> values_;
- ZoneList<Representation> representations_;
-
- // Allocation index indexed arrays of spill slot operands for registers
- // that are also in spill slots at an OSR entry. NULL for environments
- // that do not correspond to an OSR entry.
- LOperand** spilled_registers_;
- LOperand** spilled_double_registers_;
-
- LEnvironment* outer_;
-};
-
class LChunkBuilder;
class LChunk: public ZoneObject {
public:
@@ -2051,7 +1886,6 @@
LInstruction* Define(LInstruction* instr);
LInstruction* DefineAsRegister(LInstruction* instr);
LInstruction* DefineAsSpilled(LInstruction* instr, int index);
- LInstruction* DefineSameAsAny(LInstruction* instr);
LInstruction* DefineSameAsFirst(LInstruction* instr);
LInstruction* DefineFixed(LInstruction* instr, Register reg);
LInstruction* DefineFixedDouble(LInstruction* instr, DoubleRegister reg);
@@ -2074,8 +1908,6 @@
LEnvironment* CreateEnvironment(HEnvironment* hydrogen_env);
- // Temporary operand that may be a memory location.
- LOperand* Temp();
// Temporary operand that must be in a register.
LUnallocated* TempRegister();
LOperand* FixedTemp(Register reg);
« no previous file with comments | « src/arm/ic-arm.cc ('k') | src/arm/lithium-arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698