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

Side by Side Diff: src/objects.cc

Issue 8138003: Make 'Become' safe for retries. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 9 years, 2 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/heap.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 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 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 2589 matching lines...) Expand 10 before | Expand all | Expand 10 after
2600 Handle<String> name = isolate->factory()->Uint32ToString(index); 2600 Handle<String> name = isolate->factory()->Uint32ToString(index);
2601 return GetPropertyAttributeWithHandler(receiver, *name); 2601 return GetPropertyAttributeWithHandler(receiver, *name);
2602 } 2602 }
2603 2603
2604 2604
2605 void JSProxy::Fix() { 2605 void JSProxy::Fix() {
2606 Isolate* isolate = GetIsolate(); 2606 Isolate* isolate = GetIsolate();
2607 HandleScope scope(isolate); 2607 HandleScope scope(isolate);
2608 Handle<JSProxy> self(this); 2608 Handle<JSProxy> self(this);
2609 2609
2610 // Save identity hash.
2611 MaybeObject* maybe_hash = GetIdentityHash(OMIT_CREATION);
2612
2610 if (IsJSFunctionProxy()) { 2613 if (IsJSFunctionProxy()) {
2611 isolate->factory()->BecomeJSFunction(self); 2614 isolate->factory()->BecomeJSFunction(self);
2612 // Code will be set on the JavaScript side. 2615 // Code will be set on the JavaScript side.
2613 } else { 2616 } else {
2614 isolate->factory()->BecomeJSObject(self); 2617 isolate->factory()->BecomeJSObject(self);
2615 } 2618 }
2616 ASSERT(self->IsJSObject()); 2619 ASSERT(self->IsJSObject());
2620
2621 // Inherit identity, if it was present.
2622 Object* hash;
2623 if (maybe_hash->To<Object>(&hash) && hash->IsSmi()) {
2624 Handle<JSObject> new_self(JSObject::cast(*self));
2625 isolate->factory()->SetIdentityHash(new_self, hash);
2626 }
2617 } 2627 }
2618 2628
2619 2629
2620 MUST_USE_RESULT Handle<Object> JSProxy::CallTrap( 2630 MUST_USE_RESULT Handle<Object> JSProxy::CallTrap(
2621 const char* name, 2631 const char* name,
2622 Handle<Object> derived, 2632 Handle<Object> derived,
2623 int argc, 2633 int argc,
2624 Handle<Object> args[]) { 2634 Handle<Object> args[]) {
2625 Isolate* isolate = GetIsolate(); 2635 Isolate* isolate = GetIsolate();
2626 Handle<Object> handler(this->handler()); 2636 Handle<Object> handler(this->handler());
(...skipping 9537 matching lines...) Expand 10 before | Expand all | Expand 10 after
12164 if (break_point_objects()->IsUndefined()) return 0; 12174 if (break_point_objects()->IsUndefined()) return 0;
12165 // Single break point. 12175 // Single break point.
12166 if (!break_point_objects()->IsFixedArray()) return 1; 12176 if (!break_point_objects()->IsFixedArray()) return 1;
12167 // Multiple break points. 12177 // Multiple break points.
12168 return FixedArray::cast(break_point_objects())->length(); 12178 return FixedArray::cast(break_point_objects())->length();
12169 } 12179 }
12170 #endif 12180 #endif
12171 12181
12172 12182
12173 } } // namespace v8::internal 12183 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/heap.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698