Thread isolate through Property constructor, avoiding Isolate::Current.
authorsvenpanne@chromium.org <svenpanne@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Tue, 28 Feb 2012 15:32:06 +0000 (15:32 +0000)
committersvenpanne@chromium.org <svenpanne@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Tue, 28 Feb 2012 15:32:06 +0000 (15:32 +0000)
This removes roughly 5k invocations of Isolate::Current from the string-tagcloud
benchmark.

Review URL: https://chromiumcodereview.appspot.com/9490009

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@10859 ce2b1a6d-e550-0410-aec6-3dcde31c8c00

src/ast.cc
src/ast.h
src/parser.cc

index 9425d6a248918cfb30c0a04345569c8f370bc8c4..9810c3450429f99bb3bdfb130fa15acd13303674 100644 (file)
@@ -168,12 +168,15 @@ LanguageMode FunctionLiteral::language_mode() const {
 }
 
 
-ObjectLiteral::Property::Property(Literal* key, Expression* value) {
+ObjectLiteral::Property::Property(Literal* key,
+                                  Expression* value,
+                                  Isolate* isolate) {
   emit_store_ = true;
   key_ = key;
   value_ = value;
   Object* k = *key->handle();
-  if (k->IsSymbol() && HEAP->Proto_symbol()->Equals(String::cast(k))) {
+  if (k->IsSymbol() &&
+      isolate->heap()->Proto_symbol()->Equals(String::cast(k))) {
     kind_ = PROTOTYPE;
   } else if (value_->AsMaterializedLiteral() != NULL) {
     kind_ = MATERIALIZED_LITERAL;
index 7a46ac930d4943f6ab4a90abdd428a2bd67dfd4b..d7819c36128738355f0f3c86da38c0a754fb2296 100644 (file)
--- a/src/ast.h
+++ b/src/ast.h
@@ -1257,7 +1257,7 @@ class ObjectLiteral: public MaterializedLiteral {
       PROTOTYPE              // Property is __proto__.
     };
 
-    Property(Literal* key, Expression* value);
+    Property(Literal* key, Expression* value, Isolate* isolate);
 
     Literal* key() { return key_; }
     Expression* value() { return value_; }
index 1bab4a61797acd54807a10cd7baa9d15c4783e18..4c342f87734ba02ad54836f220baa43892540a34 100644 (file)
@@ -3991,7 +3991,7 @@ Expression* Parser::ParseObjectLiteral(bool* ok) {
     Expression* value = ParseAssignmentExpression(true, CHECK_OK);
 
     ObjectLiteral::Property* property =
-        new(zone()) ObjectLiteral::Property(key, value);
+        new(zone()) ObjectLiteral::Property(key, value, isolate());
 
     // Mark top-level object literals that contain function literals and
     // pretenure the literal so it can be added as a constant function