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

Unified Diff: src/hydrogen.cc

Issue 18154004: Replace custom builtin invocation instructions by a generic version (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 5 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/hydrogen.h ('k') | src/hydrogen-instructions.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/hydrogen.cc
diff --git a/src/hydrogen.cc b/src/hydrogen.cc
index b7f374b8c0416d2700d4868d0ed016e990e8682b..e4c98aa1dc082921054de365596fd6438a6926ba 100644
--- a/src/hydrogen.cc
+++ b/src/hydrogen.cc
@@ -1954,7 +1954,7 @@ HStoreNamedField* HGraphBuilder::AddStoreMapConstant(HValue *object,
HValue* HGraphBuilder::AddLoadJSBuiltin(Builtins::JavaScript builtin,
- HContext* context) {
+ HValue* context) {
HGlobalObject* global_object = Add<HGlobalObject>(context);
HObjectAccess access = HObjectAccess::ForJSObjectOffset(
GlobalObject::kBuiltinsOffset);
@@ -8293,7 +8293,11 @@ void HOptimizedGraphBuilder::VisitDelete(UnaryOperation* expr) {
HValue* key = Pop();
HValue* obj = Pop();
HValue* context = environment()->LookupContext();
- HDeleteProperty* instr = new(zone()) HDeleteProperty(context, obj, key);
+ HValue* function = AddLoadJSBuiltin(Builtins::DELETE, context);
+ Add<HPushArgument>(obj);
+ Add<HPushArgument>(key);
+ Add<HPushArgument>(Add<HConstant>(function_strict_mode_flag()));
+ HInstruction* instr = new(zone()) HInvokeFunction(context, function, 3);
Michael Starzinger 2013/07/05 13:47:49 This will introduce an additional check that compa
return ast_context()->ReturnInstruction(instr, expr->id());
} else if (proxy != NULL) {
Variable* var = proxy->var();
@@ -9105,7 +9109,10 @@ void HOptimizedGraphBuilder::VisitCompareOperation(CompareOperation* expr) {
// Code below assumes that we don't fall through.
UNREACHABLE();
} else if (op == Token::IN) {
- HIn* result = new(zone()) HIn(context, left, right);
+ HValue* function = AddLoadJSBuiltin(Builtins::IN, context);
+ Add<HPushArgument>(left);
+ Add<HPushArgument>(right);
+ HInstruction* result = new(zone()) HInvokeFunction(context, function, 2);
Michael Starzinger 2013/07/05 13:47:49 Likewise.
result->set_position(expr->position());
return ast_context()->ReturnInstruction(result, expr->id());
}
« no previous file with comments | « src/hydrogen.h ('k') | src/hydrogen-instructions.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698