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

Side by Side Diff: src/runtime.cc

Issue 223193005: Get rid of the TRANSITION PropertyType and consistently use CanHoldValue(). (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Use number_ for LastAdded in transition results. Created 6 years, 8 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 | « src/property-details.h ('k') | no next file » | 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 5198 matching lines...) Expand 10 before | Expand all | Expand 10 after
5209 5209
5210 5210
5211 // Return property without being observable by accessors or interceptors. 5211 // Return property without being observable by accessors or interceptors.
5212 RUNTIME_FUNCTION(MaybeObject*, Runtime_GetDataProperty) { 5212 RUNTIME_FUNCTION(MaybeObject*, Runtime_GetDataProperty) {
5213 SealHandleScope shs(isolate); 5213 SealHandleScope shs(isolate);
5214 ASSERT(args.length() == 2); 5214 ASSERT(args.length() == 2);
5215 CONVERT_ARG_HANDLE_CHECKED(JSObject, object, 0); 5215 CONVERT_ARG_HANDLE_CHECKED(JSObject, object, 0);
5216 CONVERT_ARG_HANDLE_CHECKED(Name, key, 1); 5216 CONVERT_ARG_HANDLE_CHECKED(Name, key, 1);
5217 LookupResult lookup(isolate); 5217 LookupResult lookup(isolate);
5218 object->LookupRealNamedProperty(*key, &lookup); 5218 object->LookupRealNamedProperty(*key, &lookup);
5219 if (!lookup.IsFound()) return isolate->heap()->undefined_value(); 5219 if (lookup.IsFound() && !lookup.IsTransition()) {
5220 switch (lookup.type()) { 5220 switch (lookup.type()) {
5221 case NORMAL: 5221 case NORMAL:
5222 return lookup.holder()->GetNormalizedProperty(&lookup); 5222 return lookup.holder()->GetNormalizedProperty(&lookup);
5223 case FIELD: 5223 case FIELD:
5224 return lookup.holder()->FastPropertyAt( 5224 return lookup.holder()->FastPropertyAt(
5225 lookup.representation(), 5225 lookup.representation(),
5226 lookup.GetFieldIndex().field_index()); 5226 lookup.GetFieldIndex().field_index());
5227 case CONSTANT: 5227 case CONSTANT:
5228 return lookup.GetConstant(); 5228 return lookup.GetConstant();
5229 case CALLBACKS: 5229 case CALLBACKS:
5230 case HANDLER: 5230 case HANDLER:
5231 case INTERCEPTOR: 5231 case INTERCEPTOR:
5232 case TRANSITION: 5232 break;
5233 return isolate->heap()->undefined_value(); 5233 case NONEXISTENT:
5234 case NONEXISTENT: 5234 UNREACHABLE();
5235 UNREACHABLE(); 5235 }
5236 } 5236 }
5237 return isolate->heap()->undefined_value(); 5237 return isolate->heap()->undefined_value();
5238 } 5238 }
5239 5239
5240 5240
5241 Handle<Object> Runtime::SetObjectProperty(Isolate* isolate, 5241 Handle<Object> Runtime::SetObjectProperty(Isolate* isolate,
5242 Handle<Object> object, 5242 Handle<Object> object,
5243 Handle<Object> key, 5243 Handle<Object> key,
5244 Handle<Object> value, 5244 Handle<Object> value,
5245 PropertyAttributes attr, 5245 PropertyAttributes attr,
(...skipping 5527 matching lines...) Expand 10 before | Expand all | Expand 10 after
10773 return isolate->heap()->undefined_value(); 10773 return isolate->heap()->undefined_value();
10774 } 10774 }
10775 10775
10776 10776
10777 static MaybeObject* DebugLookupResultValue(Heap* heap, 10777 static MaybeObject* DebugLookupResultValue(Heap* heap,
10778 Object* receiver, 10778 Object* receiver,
10779 Name* name, 10779 Name* name,
10780 LookupResult* result, 10780 LookupResult* result,
10781 bool* caught_exception) { 10781 bool* caught_exception) {
10782 Object* value; 10782 Object* value;
10783 if (result->IsTransition()) return heap->undefined_value();
10783 switch (result->type()) { 10784 switch (result->type()) {
10784 case NORMAL: 10785 case NORMAL:
10785 value = result->holder()->GetNormalizedProperty(result); 10786 value = result->holder()->GetNormalizedProperty(result);
10786 if (value->IsTheHole()) { 10787 if (value->IsTheHole()) {
10787 return heap->undefined_value(); 10788 return heap->undefined_value();
10788 } 10789 }
10789 return value; 10790 return value;
10790 case FIELD: { 10791 case FIELD: {
10791 Object* value; 10792 Object* value;
10792 MaybeObject* maybe_value = 10793 MaybeObject* maybe_value =
(...skipping 23 matching lines...) Expand all
10816 heap->isolate()->clear_pending_exception(); 10817 heap->isolate()->clear_pending_exception();
10817 if (caught_exception != NULL) *caught_exception = true; 10818 if (caught_exception != NULL) *caught_exception = true;
10818 return exception; 10819 return exception;
10819 } 10820 }
10820 return *value; 10821 return *value;
10821 } else { 10822 } else {
10822 return heap->undefined_value(); 10823 return heap->undefined_value();
10823 } 10824 }
10824 } 10825 }
10825 case INTERCEPTOR: 10826 case INTERCEPTOR:
10826 case TRANSITION:
10827 return heap->undefined_value(); 10827 return heap->undefined_value();
10828 case HANDLER: 10828 case HANDLER:
10829 case NONEXISTENT: 10829 case NONEXISTENT:
10830 UNREACHABLE(); 10830 UNREACHABLE();
10831 return heap->undefined_value(); 10831 return heap->undefined_value();
10832 } 10832 }
10833 UNREACHABLE(); // keep the compiler happy 10833 UNREACHABLE(); // keep the compiler happy
10834 return heap->undefined_value(); 10834 return heap->undefined_value();
10835 } 10835 }
10836 10836
(...skipping 4385 matching lines...) Expand 10 before | Expand all | Expand 10 after
15222 } 15222 }
15223 } 15223 }
15224 15224
15225 15225
15226 void Runtime::OutOfMemory() { 15226 void Runtime::OutOfMemory() {
15227 Heap::FatalProcessOutOfMemory("CALL_AND_RETRY_LAST", true); 15227 Heap::FatalProcessOutOfMemory("CALL_AND_RETRY_LAST", true);
15228 UNREACHABLE(); 15228 UNREACHABLE();
15229 } 15229 }
15230 15230
15231 } } // namespace v8::internal 15231 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/property-details.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698