Index: src/hydrogen.h |
=================================================================== |
--- src/hydrogen.h (revision 9808) |
+++ src/hydrogen.h (working copy) |
@@ -121,7 +121,7 @@ |
void Finish(HControlInstruction* last); |
void FinishExit(HControlInstruction* instruction); |
- void Goto(HBasicBlock* block); |
+ void Goto(HBasicBlock* block, bool drop_extra = false); |
int PredecessorIndexOf(HBasicBlock* predecessor) const; |
void AddSimulate(int ast_id) { AddInstruction(CreateSimulate(ast_id)); } |
@@ -133,7 +133,9 @@ |
// Add the inlined function exit sequence, adding an HLeaveInlined |
// instruction and updating the bailout environment. |
- void AddLeaveInlined(HValue* return_value, HBasicBlock* target); |
+ void AddLeaveInlined(HValue* return_value, |
+ HBasicBlock* target, |
+ bool drop_extra = false); |
// If a target block is tagged as an inline function return, all |
// predecessors should contain the inlined exit sequence: |
@@ -603,16 +605,18 @@ |
}; |
-class FunctionState BASE_EMBEDDED { |
+class FunctionState { |
public: |
FunctionState(HGraphBuilder* owner, |
CompilationInfo* info, |
- TypeFeedbackOracle* oracle); |
+ TypeFeedbackOracle* oracle, |
+ bool drop_extra); |
~FunctionState(); |
CompilationInfo* compilation_info() { return compilation_info_; } |
TypeFeedbackOracle* oracle() { return oracle_; } |
AstContext* call_context() { return call_context_; } |
+ bool drop_extra() { return drop_extra_; } |
HBasicBlock* function_return() { return function_return_; } |
TestContext* test_context() { return test_context_; } |
void ClearInlinedTestContext() { |
@@ -632,6 +636,10 @@ |
// inlined. NULL when not inlining. |
AstContext* call_context_; |
+ // Indicate if we have to drop an extra value from the environment on |
+ // return from inlined functions. |
+ bool drop_extra_; |
+ |
// When inlining in an effect of value context, this is the return block. |
// It is NULL otherwise. When inlining in a test context, there are a |
// pair of return blocks in the context. When not inlining, there is no |
@@ -728,6 +736,8 @@ |
TypeFeedbackOracle* oracle() const { return function_state()->oracle(); } |
+ FunctionState* function_state() const { return function_state_; } |
+ |
private: |
// Type of a member function that generates inline code for a native function. |
typedef void (HGraphBuilder::*InlineFunctionGenerator)(CallRuntime* call); |
@@ -746,7 +756,6 @@ |
static const int kMaxSourceSize = 600; |
// Simple accessors. |
- FunctionState* function_state() const { return function_state_; } |
void set_function_state(FunctionState* state) { function_state_ = state; } |
AstContext* ast_context() const { return ast_context_; } |
@@ -769,8 +778,8 @@ |
void ClearInlinedTestContext() { |
function_state()->ClearInlinedTestContext(); |
} |
- bool function_strict_mode() { |
- return function_state()->compilation_info()->is_strict_mode(); |
+ StrictModeFlag function_strict_mode_flag() { |
+ return function_state()->compilation_info()->strict_mode_flag(); |
} |
// Generators for inline runtime functions. |
@@ -883,7 +892,7 @@ |
// Try to optimize fun.apply(receiver, arguments) pattern. |
bool TryCallApply(Call* expr); |
- bool TryInline(Call* expr); |
+ bool TryInline(Call* expr, bool drop_extra = false); |
bool TryInlineBuiltinFunction(Call* expr, |
HValue* receiver, |
Handle<Map> receiver_map, |
@@ -912,12 +921,11 @@ |
HValue* receiver, |
SmallMapList* types, |
Handle<String> name); |
- bool TryLiteralCompare(CompareOperation* expr); |
void HandleLiteralCompareTypeof(CompareOperation* expr, |
- Expression* sub_expr, |
+ HTypeof* typeof_expr, |
Handle<String> check); |
void HandleLiteralCompareNil(CompareOperation* expr, |
- Expression* sub_expr, |
+ HValue* value, |
NilValue nil); |
HStringCharCodeAt* BuildStringCharCodeAt(HValue* context, |
@@ -951,7 +959,7 @@ |
HInstruction* BuildMonomorphicElementAccess(HValue* object, |
HValue* key, |
HValue* val, |
- Expression* expr, |
+ Handle<Map> map, |
bool is_store); |
HValue* HandlePolymorphicElementAccess(HValue* object, |
HValue* key, |