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

Side by Side Diff: src/hydrogen.cc

Issue 10576013: Fix crash bug in Hydrogen occurring with empty prototype chain. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressed Slava's comment. Created 8 years, 6 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 | test/mjsunit/regress/regress-115100.js » ('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 4933 matching lines...) Expand 10 before | Expand all | Expand 10 after
4944 bool smi_and_map_check) { 4944 bool smi_and_map_check) {
4945 ASSERT(lookup->IsFound()); 4945 ASSERT(lookup->IsFound());
4946 if (smi_and_map_check) { 4946 if (smi_and_map_check) {
4947 AddInstruction(new(zone()) HCheckNonSmi(object)); 4947 AddInstruction(new(zone()) HCheckNonSmi(object));
4948 AddInstruction(HCheckMaps::NewWithTransitions(object, type, zone())); 4948 AddInstruction(HCheckMaps::NewWithTransitions(object, type, zone()));
4949 } 4949 }
4950 4950
4951 // If the property does not exist yet, we have to check that it wasn't made 4951 // If the property does not exist yet, we have to check that it wasn't made
4952 // readonly or turned into a setter by some meanwhile modifications on the 4952 // readonly or turned into a setter by some meanwhile modifications on the
4953 // prototype chain. 4953 // prototype chain.
4954 if (!lookup->IsProperty()) { 4954 if (!lookup->IsProperty() && type->prototype()->IsJSReceiver()) {
4955 Object* proto = type->prototype(); 4955 Object* proto = type->prototype();
4956 // First check that the prototype chain isn't affected already. 4956 // First check that the prototype chain isn't affected already.
4957 LookupResult proto_result(isolate()); 4957 LookupResult proto_result(isolate());
4958 proto->Lookup(*name, &proto_result); 4958 proto->Lookup(*name, &proto_result);
4959 if (proto_result.IsProperty()) { 4959 if (proto_result.IsProperty()) {
4960 // If the inherited property could induce readonly-ness, bail out. 4960 // If the inherited property could induce readonly-ness, bail out.
4961 if (proto_result.IsReadOnly() || !proto_result.IsCacheable()) { 4961 if (proto_result.IsReadOnly() || !proto_result.IsCacheable()) {
4962 Bailout("improper object on prototype chain for store"); 4962 Bailout("improper object on prototype chain for store");
4963 return NULL; 4963 return NULL;
4964 } 4964 }
(...skipping 4477 matching lines...) Expand 10 before | Expand all | Expand 10 after
9442 } 9442 }
9443 } 9443 }
9444 9444
9445 #ifdef DEBUG 9445 #ifdef DEBUG
9446 if (graph_ != NULL) graph_->Verify(false); // No full verify. 9446 if (graph_ != NULL) graph_->Verify(false); // No full verify.
9447 if (allocator_ != NULL) allocator_->Verify(); 9447 if (allocator_ != NULL) allocator_->Verify();
9448 #endif 9448 #endif
9449 } 9449 }
9450 9450
9451 } } // namespace v8::internal 9451 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-115100.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698