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

Unified Diff: src/bootstrapper.cc

Issue 8098: - Added conditional write barrier to object accessors.... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 12 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/builtins.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/bootstrapper.cc
===================================================================
--- src/bootstrapper.cc (revision 564)
+++ src/bootstrapper.cc (working copy)
@@ -739,25 +739,46 @@
Handle<JSObject> prototype =
Handle<JSObject>(
JSObject::cast(global_context()->object_function()->prototype()));
+
Handle<JSFunction> function =
- Factory::NewFunctionWithPrototype(symbol, JS_OBJECT_TYPE,
- JSObject::kHeaderSize, prototype,
- code, true);
+ Factory::NewFunctionWithPrototype(symbol,
+ JS_OBJECT_TYPE,
+ JSObject::kHeaderSize,
+ prototype,
+ code,
+ false);
+ ASSERT(!function->has_initial_map());
function->shared()->set_instance_class_name(*symbol);
-
+ function->shared()->set_expected_nof_properties(2);
Handle<JSObject> result = Factory::NewJSObject(function);
global_context()->set_arguments_boilerplate(*result);
// Note: callee must be added as the first property and
// length must be added as the second property.
- SetProperty(result, Factory::callee_symbol(), Factory::undefined_value(),
+ SetProperty(result, Factory::callee_symbol(),
+ Factory::undefined_value(),
DONT_ENUM);
- SetProperty(result, Factory::length_symbol(), Factory::undefined_value(),
+ SetProperty(result, Factory::length_symbol(),
+ Factory::undefined_value(),
DONT_ENUM);
+#ifdef DEBUG
+ LookupResult lookup;
+ result->LocalLookup(Heap::callee_symbol(), &lookup);
+ ASSERT(lookup.IsValid() && (lookup.type() == FIELD));
+ ASSERT(lookup.GetFieldIndex() == Heap::arguments_callee_index);
+
+ result->LocalLookup(Heap::length_symbol(), &lookup);
+ ASSERT(lookup.IsValid() && (lookup.type() == FIELD));
+ ASSERT(lookup.GetFieldIndex() == Heap::arguments_length_index);
+
+ ASSERT(result->map()->inobject_properties() > Heap::arguments_callee_index);
+ ASSERT(result->map()->inobject_properties() > Heap::arguments_length_index);
+
// Check the state of the object.
ASSERT(result->HasFastProperties());
ASSERT(result->HasFastElements());
+#endif
}
{ // --- context extension
« no previous file with comments | « no previous file | src/builtins.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698