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

Side by Side Diff: src/hydrogen.cc

Issue 12051058: Allow monomorphic loads when static type is known. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | src/hydrogen-instructions.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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 6778 matching lines...) Expand 10 before | Expand all | Expand 10 after
6789 instr = new(zone()) HStringCharFromCode(context, char_code); 6789 instr = new(zone()) HStringCharFromCode(context, char_code);
6790 6790
6791 } else if (expr->IsFunctionPrototype()) { 6791 } else if (expr->IsFunctionPrototype()) {
6792 HValue* function = Pop(); 6792 HValue* function = Pop();
6793 AddInstruction(new(zone()) HCheckNonSmi(function)); 6793 AddInstruction(new(zone()) HCheckNonSmi(function));
6794 instr = new(zone()) HLoadFunctionPrototype(function); 6794 instr = new(zone()) HLoadFunctionPrototype(function);
6795 6795
6796 } else if (expr->key()->IsPropertyName()) { 6796 } else if (expr->key()->IsPropertyName()) {
6797 Handle<String> name = expr->key()->AsLiteral()->AsPropertyName(); 6797 Handle<String> name = expr->key()->AsLiteral()->AsPropertyName();
6798 SmallMapList* types = expr->GetReceiverTypes(); 6798 SmallMapList* types = expr->GetReceiverTypes();
6799 HValue* object = Top();
6799 6800
6800 bool monomorphic = expr->IsMonomorphic();
6801 Handle<Map> map; 6801 Handle<Map> map;
6802 bool monomorphic = false;
6802 if (expr->IsMonomorphic()) { 6803 if (expr->IsMonomorphic()) {
6803 map = types->first(); 6804 map = types->first();
6804 if (map->is_dictionary_map()) monomorphic = false; 6805 monomorphic = !map->is_dictionary_map();
6806 } else if (object->HasMonomorphicJSObjectType()) {
6807 map = object->GetMonomorphicJSObjectMap();
6808 monomorphic = !map->is_dictionary_map();
6805 } 6809 }
6806 if (monomorphic) { 6810 if (monomorphic) {
6807 Handle<JSFunction> getter; 6811 Handle<JSFunction> getter;
6808 Handle<JSObject> holder; 6812 Handle<JSObject> holder;
6809 if (LookupGetter(map, name, &getter, &holder)) { 6813 if (LookupGetter(map, name, &getter, &holder)) {
6810 AddCheckConstantFunction(holder, Top(), map); 6814 AddCheckConstantFunction(holder, Top(), map);
6811 if (FLAG_inline_accessors && TryInlineGetter(getter, expr)) return; 6815 if (FLAG_inline_accessors && TryInlineGetter(getter, expr)) return;
6812 AddInstruction(new(zone()) HPushArgument(Pop())); 6816 AddInstruction(new(zone()) HPushArgument(Pop()));
6813 instr = new(zone()) HCallConstantFunction(getter, 1); 6817 instr = new(zone()) HCallConstantFunction(getter, 1);
6814 } else { 6818 } else {
(...skipping 3492 matching lines...) Expand 10 before | Expand all | Expand 10 after
10307 } 10311 }
10308 } 10312 }
10309 10313
10310 #ifdef DEBUG 10314 #ifdef DEBUG
10311 if (graph_ != NULL) graph_->Verify(false); // No full verify. 10315 if (graph_ != NULL) graph_->Verify(false); // No full verify.
10312 if (allocator_ != NULL) allocator_->Verify(); 10316 if (allocator_ != NULL) allocator_->Verify();
10313 #endif 10317 #endif
10314 } 10318 }
10315 10319
10316 } } // namespace v8::internal 10320 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | src/hydrogen-instructions.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698