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

Unified Diff: src/objects.cc

Issue 6711027: [Isolates] Merge 7201:7258 from bleeding_edge to isolates. (Closed) Base URL: http://v8.googlecode.com/svn/branches/experimental/isolates/
Patch Set: Created 9 years, 9 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 side-by-side diff with in-line comments
Download patch
Index: src/objects.cc
===================================================================
--- src/objects.cc (revision 7254)
+++ src/objects.cc (working copy)
@@ -5638,14 +5638,22 @@
Object* JSFunction::RemovePrototype() {
- if (map() == context()->global_context()->function_without_prototype_map()) {
+ Context* global_context = context()->global_context();
+ Map* no_prototype_map = shared()->strict_mode()
+ ? global_context->strict_mode_function_without_prototype_map()
+ : global_context->function_without_prototype_map();
+
+ if (map() == no_prototype_map) {
// Be idempotent.
return this;
}
- ASSERT(map() == context()->global_context()->function_map());
- Heap* heap = GetHeap();
- set_map(context()->global_context()->function_without_prototype_map());
- set_prototype_or_initial_map(heap->the_hole_value());
+
+ ASSERT(!shared()->strict_mode() ||
+ map() == global_context->strict_mode_function_map());
+ ASSERT(shared()->strict_mode() || map() == global_context->function_map());
+
+ set_map(no_prototype_map);
+ set_prototype_or_initial_map(GetHeap()->the_hole_value());
return this;
}
« src/global-handles.cc ('K') | « src/messages.js ('k') | src/platform-posix.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698