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

Side by Side Diff: src/runtime.cc

Issue 6932068: A first skeleton for introducing Harmony proxies (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Addressed Kevin's comments. Created 9 years, 7 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
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 570 matching lines...) Expand 10 before | Expand all | Expand 10 after
581 literals->set(literals_index, *boilerplate); 581 literals->set(literals_index, *boilerplate);
582 } 582 }
583 if (JSObject::cast(*boilerplate)->elements()->map() == 583 if (JSObject::cast(*boilerplate)->elements()->map() ==
584 isolate->heap()->fixed_cow_array_map()) { 584 isolate->heap()->fixed_cow_array_map()) {
585 isolate->counters()->cow_arrays_created_runtime()->Increment(); 585 isolate->counters()->cow_arrays_created_runtime()->Increment();
586 } 586 }
587 return isolate->heap()->CopyJSObject(JSObject::cast(*boilerplate)); 587 return isolate->heap()->CopyJSObject(JSObject::cast(*boilerplate));
588 } 588 }
589 589
590 590
591 RUNTIME_FUNCTION(MaybeObject*, Runtime_CreateJSProxy) {
592 ASSERT(args.length() == 2);
593 Object* handler = args[0];
594 Object* prototype = args[1];
595 Object* used_prototype =
596 (prototype->IsJSObject() || prototype->IsJSProxy()) ? prototype
597 : isolate->heap()->null_value();
598 return isolate->heap()->AllocateJSProxy(handler, used_prototype);
599 }
600
601
591 RUNTIME_FUNCTION(MaybeObject*, Runtime_CreateCatchExtensionObject) { 602 RUNTIME_FUNCTION(MaybeObject*, Runtime_CreateCatchExtensionObject) {
592 ASSERT(args.length() == 2); 603 ASSERT(args.length() == 2);
593 CONVERT_CHECKED(String, key, args[0]); 604 CONVERT_CHECKED(String, key, args[0]);
594 Object* value = args[1]; 605 Object* value = args[1];
595 // Create a catch context extension object. 606 // Create a catch context extension object.
596 JSFunction* constructor = 607 JSFunction* constructor =
597 isolate->context()->global_context()-> 608 isolate->context()->global_context()->
598 context_extension_function(); 609 context_extension_function();
599 Object* object; 610 Object* object;
600 { MaybeObject* maybe_object = isolate->heap()->AllocateJSObject(constructor); 611 { MaybeObject* maybe_object = isolate->heap()->AllocateJSObject(constructor);
(...skipping 11573 matching lines...) Expand 10 before | Expand all | Expand 10 after
12174 } else { 12185 } else {
12175 // Handle last resort GC and make sure to allow future allocations 12186 // Handle last resort GC and make sure to allow future allocations
12176 // to grow the heap without causing GCs (if possible). 12187 // to grow the heap without causing GCs (if possible).
12177 isolate->counters()->gc_last_resort_from_js()->Increment(); 12188 isolate->counters()->gc_last_resort_from_js()->Increment();
12178 isolate->heap()->CollectAllGarbage(false); 12189 isolate->heap()->CollectAllGarbage(false);
12179 } 12190 }
12180 } 12191 }
12181 12192
12182 12193
12183 } } // namespace v8::internal 12194 } } // namespace v8::internal
OLDNEW
« src/objects-visiting.cc ('K') | « src/runtime.h ('k') | src/runtime.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698