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

Unified Diff: src/codegen-arm.h

Issue 9328: Initial (stub) port of jump targets to the ARM platform.... (Closed) Base URL: http://v8.googlecode.com/svn/branches/experimental/toiger/
Patch Set: '' Created 12 years, 1 month 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/ast.h ('k') | src/codegen-arm.cc » ('j') | src/jump-target.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/codegen-arm.h
===================================================================
--- src/codegen-arm.h (revision 703)
+++ src/codegen-arm.h (working copy)
@@ -43,45 +43,6 @@
// -------------------------------------------------------------------------
-// Virtual frame
-
-class VirtualFrame BASE_EMBEDDED {
- public:
- explicit VirtualFrame(CodeGenerator* cgen);
-
- MemOperand Top() const { return MemOperand(sp, 0); }
-
- MemOperand Element(int index) const {
- return MemOperand(sp, index * kPointerSize);
- }
-
- MemOperand Local(int index) const {
- ASSERT(0 <= index && index < frame_local_count_);
- return MemOperand(fp, kLocal0Offset - index * kPointerSize);
- }
-
- MemOperand Function() const { return MemOperand(fp, kFunctionOffset); }
-
- MemOperand Context() const { return MemOperand(fp, kContextOffset); }
-
- MemOperand Parameter(int index) const {
- // Index -1 corresponds to the receiver.
- ASSERT(-1 <= index && index <= parameter_count_);
- return MemOperand(fp, (1 + parameter_count_ - index) * kPointerSize);
- }
-
- private:
- static const int kLocal0Offset = JavaScriptFrameConstants::kLocal0Offset;
- static const int kFunctionOffset = JavaScriptFrameConstants::kFunctionOffset;
- static const int kContextOffset = StandardFrameConstants::kContextOffset;
-
- MacroAssembler* masm_;
- int frame_local_count_;
- int parameter_count_;
-};
-
-
-// -------------------------------------------------------------------------
// Reference support
// A reference is a C++ stack-allocated object that keeps an ECMA
@@ -152,22 +113,22 @@
// labels.
CodeGenState(CodeGenerator* owner,
TypeofState typeof_state,
- Label* true_target,
- Label* false_target);
+ JumpTarget* true_target,
+ JumpTarget* false_target);
// Destroy a code generator state and restore the owning code generator's
// previous state.
~CodeGenState();
TypeofState typeof_state() const { return typeof_state_; }
- Label* true_target() const { return true_target_; }
- Label* false_target() const { return false_target_; }
+ JumpTarget* true_target() const { return true_target_; }
+ JumpTarget* false_target() const { return false_target_; }
private:
CodeGenerator* owner_;
TypeofState typeof_state_;
- Label* true_target_;
- Label* false_target_;
+ JumpTarget* true_target_;
+ JumpTarget* false_target_;
CodeGenState* previous_;
};
@@ -215,8 +176,8 @@
// State
bool has_cc() const { return cc_reg_ != al; }
TypeofState typeof_state() const { return state_->typeof_state(); }
- Label* true_target() const { return state_->true_target(); }
- Label* false_target() const { return state_->false_target(); }
+ JumpTarget* true_target() const { return state_->true_target(); }
+ JumpTarget* false_target() const { return state_->false_target(); }
// Node visitors.
@@ -245,8 +206,8 @@
void LoadCondition(Expression* x,
TypeofState typeof_state,
- Label* true_target,
- Label* false_target,
+ JumpTarget* true_target,
+ JumpTarget* false_target,
bool force_cc);
void Load(Expression* x, TypeofState typeof_state = NOT_INSIDE_TYPEOF);
void LoadGlobal();
@@ -263,7 +224,7 @@
// through the context chain.
void LoadTypeofExpression(Expression* x);
- void ToBoolean(Label* true_target, Label* false_target);
+ void ToBoolean(JumpTarget* true_target, JumpTarget* false_target);
void GenericBinaryOperation(Token::Value op);
void Comparison(Condition cc, bool strict = false);
@@ -273,7 +234,7 @@
void CallWithArguments(ZoneList<Expression*>* arguments, int position);
// Control flow
- void Branch(bool if_true, Label* L);
+ void Branch(bool if_true, JumpTarget* target);
void CheckStack();
void CleanStack(int num_bytes);
@@ -340,14 +301,15 @@
void GenerateFastCaseSwitchJumpTable(SwitchStatement* node,
int min_index,
int range,
- Label* fail_label,
- Vector<Label*> case_targets,
- Vector<Label> case_labels);
+ JumpTarget* fail_label,
+ Vector<JumpTarget*> case_targets,
+ Vector<JumpTarget> case_labels);
// Generate the code for cases for the fast case switch.
// Called by GenerateFastCaseSwitchJumpTable.
void GenerateFastCaseSwitchCases(SwitchStatement* node,
- Vector<Label> case_labels);
+ Vector<JumpTarget> case_labels,
+ JumpTarget* table_start);
// Fast support for constant-Smi switches.
void GenerateFastCaseSwitchStatement(SwitchStatement* node,
@@ -386,8 +348,8 @@
bool is_inside_try_;
int break_stack_height_;
- // Labels
- Label function_return_;
+ // Jump targets
+ JumpTarget function_return_;
friend class VirtualFrame;
friend class Reference;
« no previous file with comments | « src/ast.h ('k') | src/codegen-arm.cc » ('j') | src/jump-target.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698