Reviewers: fschneider,
Description:
Thread isolate through Property constructor, avoiding Isolate::Current.
This removes roughly 5k invocations of Isolate::Current from the
string-tagcloud
benchmark.
Please review this at https://chromiumcodereview.appspot.com/9490009/
SVN Base: https://v8.googlecode.com/svn/branches/bleeding_edge
Affected files:
M src/ast.h
M src/ast.cc
M src/parser.cc
Index: src/ast.cc
diff --git a/src/ast.cc b/src/ast.cc
index
9425d6a248918cfb30c0a04345569c8f370bc8c4..9810c3450429f99bb3bdfb130fa15acd13303674
100644
--- a/src/ast.cc
+++ b/src/ast.cc
@@ -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: src/ast.h
diff --git a/src/ast.h b/src/ast.h
index
7a46ac930d4943f6ab4a90abdd428a2bd67dfd4b..d7819c36128738355f0f3c86da38c0a754fb2296
100644
--- 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: src/parser.cc
diff --git a/src/parser.cc b/src/parser.cc
index
1bab4a61797acd54807a10cd7baa9d15c4783e18..4c342f87734ba02ad54836f220baa43892540a34
100644
--- a/src/parser.cc
+++ b/src/parser.cc
@@ -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
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev