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

Side by Side Diff: src/runtime.cc

Issue 20404: Fix debugger function that treated retry-after-gc failure as an... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 11 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 | « src/codegen-ia32.cc ('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 2006-2008 the V8 project authors. All rights reserved. 1 // Copyright 2006-2008 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 4607 matching lines...) Expand 10 before | Expand all | Expand 10 after
4618 return value; 4618 return value;
4619 case CONSTANT_FUNCTION: 4619 case CONSTANT_FUNCTION:
4620 return result->GetConstantFunction(); 4620 return result->GetConstantFunction();
4621 case CALLBACKS: { 4621 case CALLBACKS: {
4622 Object* structure = result->GetCallbackObject(); 4622 Object* structure = result->GetCallbackObject();
4623 if (structure->IsProxy()) { 4623 if (structure->IsProxy()) {
4624 AccessorDescriptor* callback = 4624 AccessorDescriptor* callback =
4625 reinterpret_cast<AccessorDescriptor*>( 4625 reinterpret_cast<AccessorDescriptor*>(
4626 Proxy::cast(structure)->proxy()); 4626 Proxy::cast(structure)->proxy());
4627 value = (callback->getter)(receiver, callback->data); 4627 value = (callback->getter)(receiver, callback->data);
4628 if (value->IsFailure()) { 4628 if (value->IsException()) {
4629 value = Top::pending_exception(); 4629 value = Top::pending_exception();
4630 Top::clear_pending_exception(); 4630 Top::clear_pending_exception();
4631 if (caught_exception != NULL) { 4631 if (caught_exception != NULL) {
4632 *caught_exception = true; 4632 *caught_exception = true;
4633 } 4633 }
4634 } 4634 }
4635 return value; 4635 return value;
4636 } else { 4636 } else {
4637 return Heap::undefined_value(); 4637 return Heap::undefined_value();
4638 } 4638 }
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
4698 if (result.IsProperty()) { 4698 if (result.IsProperty()) {
4699 break; 4699 break;
4700 } 4700 }
4701 if (i < length - 1) { 4701 if (i < length - 1) {
4702 jsproto = Handle<JSObject>(JSObject::cast(jsproto->GetPrototype())); 4702 jsproto = Handle<JSObject>(JSObject::cast(jsproto->GetPrototype()));
4703 } 4703 }
4704 } 4704 }
4705 4705
4706 if (result.IsProperty()) { 4706 if (result.IsProperty()) {
4707 bool caught_exception = false; 4707 bool caught_exception = false;
4708 Handle<Object> value(DebugLookupResultValue(*obj, &result, 4708 Object* value = DebugLookupResultValue(*obj, &result,
4709 &caught_exception)); 4709 &caught_exception);
4710 if (value->IsFailure()) return value;
4711 Handle<Object> value_handle(value);
4710 // If the callback object is a fixed array then it contains JavaScript 4712 // If the callback object is a fixed array then it contains JavaScript
4711 // getter and/or setter. 4713 // getter and/or setter.
4712 bool hasJavaScriptAccessors = result.type() == CALLBACKS && 4714 bool hasJavaScriptAccessors = result.type() == CALLBACKS &&
4713 result.GetCallbackObject()->IsFixedArray(); 4715 result.GetCallbackObject()->IsFixedArray();
4714 Handle<FixedArray> details = 4716 Handle<FixedArray> details =
4715 Factory::NewFixedArray(hasJavaScriptAccessors ? 5 : 2); 4717 Factory::NewFixedArray(hasJavaScriptAccessors ? 5 : 2);
4716 details->set(0, *value); 4718 details->set(0, *value_handle);
4717 details->set(1, result.GetPropertyDetails().AsSmi()); 4719 details->set(1, result.GetPropertyDetails().AsSmi());
4718 if (hasJavaScriptAccessors) { 4720 if (hasJavaScriptAccessors) {
4719 details->set(2, 4721 details->set(2,
4720 caught_exception ? Heap::true_value() : Heap::false_value()); 4722 caught_exception ? Heap::true_value() : Heap::false_value());
4721 details->set(3, FixedArray::cast(result.GetCallbackObject())->get(0)); 4723 details->set(3, FixedArray::cast(result.GetCallbackObject())->get(0));
4722 details->set(4, FixedArray::cast(result.GetCallbackObject())->get(1)); 4724 details->set(4, FixedArray::cast(result.GetCallbackObject())->get(1));
4723 } 4725 }
4724 4726
4725 return *Factory::NewJSArrayWithElements(details); 4727 return *Factory::NewJSArrayWithElements(details);
4726 } 4728 }
(...skipping 1362 matching lines...) Expand 10 before | Expand all | Expand 10 after
6089 } else { 6091 } else {
6090 // Handle last resort GC and make sure to allow future allocations 6092 // Handle last resort GC and make sure to allow future allocations
6091 // to grow the heap without causing GCs (if possible). 6093 // to grow the heap without causing GCs (if possible).
6092 Counters::gc_last_resort_from_js.Increment(); 6094 Counters::gc_last_resort_from_js.Increment();
6093 Heap::CollectAllGarbage(); 6095 Heap::CollectAllGarbage();
6094 } 6096 }
6095 } 6097 }
6096 6098
6097 6099
6098 } } // namespace v8::internal 6100 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/codegen-ia32.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698