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

Side by Side Diff: src/hydrogen.cc

Issue 6009005: Support load function prototype in hydrogen/lithium. (Closed)
Patch Set: Created 10 years 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 unified diff | Download patch
OLDNEW
1 // Copyright 2010 the V8 project authors. All rights reserved. 1 // Copyright 2010 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 3704 matching lines...) Expand 10 before | Expand all | Expand 10 after
3715 CHECK_BAILOUT; 3715 CHECK_BAILOUT;
3716 3716
3717 VISIT_FOR_VALUE(expr->obj()); 3717 VISIT_FOR_VALUE(expr->obj());
3718 3718
3719 HInstruction* instr = NULL; 3719 HInstruction* instr = NULL;
3720 if (expr->IsArrayLength()) { 3720 if (expr->IsArrayLength()) {
3721 HValue* array = Pop(); 3721 HValue* array = Pop();
3722 AddInstruction(new HCheckNonSmi(array)); 3722 AddInstruction(new HCheckNonSmi(array));
3723 instr = new HArrayLength(array); 3723 instr = new HArrayLength(array);
3724 3724
3725 } else if (expr->IsFunctionPrototype()) {
3726 HValue* function = Pop();
3727 AddInstruction(new HCheckNonSmi(function));
3728 instr = new HLoadFunctionPrototype(function);
3729
3725 } else if (expr->key()->IsPropertyName()) { 3730 } else if (expr->key()->IsPropertyName()) {
3726 Handle<String> name = expr->key()->AsLiteral()->AsPropertyName(); 3731 Handle<String> name = expr->key()->AsLiteral()->AsPropertyName();
3727 ZoneMapList* types = expr->GetReceiverTypes(); 3732 ZoneMapList* types = expr->GetReceiverTypes();
3728 3733
3729 HValue* obj = Pop(); 3734 HValue* obj = Pop();
3730 if (expr->IsMonomorphic()) { 3735 if (expr->IsMonomorphic()) {
3731 instr = BuildLoadNamed(obj, expr, types->first(), name); 3736 instr = BuildLoadNamed(obj, expr, types->first(), name);
3732 } else if (types != NULL && types->length() > 1) { 3737 } else if (types != NULL && types->length() > 1) {
3733 HandlePolymorphicLoadNamedField(expr, obj, types, name); 3738 HandlePolymorphicLoadNamedField(expr, obj, types, name);
3734 return; 3739 return;
(...skipping 1942 matching lines...) Expand 10 before | Expand all | Expand 10 after
5677 } 5682 }
5678 5683
5679 #ifdef DEBUG 5684 #ifdef DEBUG
5680 if (graph_ != NULL) graph_->Verify(); 5685 if (graph_ != NULL) graph_->Verify();
5681 if (chunk_ != NULL) chunk_->Verify(); 5686 if (chunk_ != NULL) chunk_->Verify();
5682 if (allocator_ != NULL) allocator_->Verify(); 5687 if (allocator_ != NULL) allocator_->Verify();
5683 #endif 5688 #endif
5684 } 5689 }
5685 5690
5686 } } // namespace v8::internal 5691 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/ast.cc ('k') | src/hydrogen-instructions.h » ('j') | src/hydrogen-instructions.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698