Thread isolate through Property constructor, avoiding Isolate::Current.

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
parent 59a7bdd6
...@@ -168,12 +168,15 @@ LanguageMode FunctionLiteral::language_mode() const { ...@@ -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; emit_store_ = true;
key_ = key; key_ = key;
value_ = value; value_ = value;
Object* k = *key->handle(); 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; kind_ = PROTOTYPE;
} else if (value_->AsMaterializedLiteral() != NULL) { } else if (value_->AsMaterializedLiteral() != NULL) {
kind_ = MATERIALIZED_LITERAL; kind_ = MATERIALIZED_LITERAL;
......
...@@ -1257,7 +1257,7 @@ class ObjectLiteral: public MaterializedLiteral { ...@@ -1257,7 +1257,7 @@ class ObjectLiteral: public MaterializedLiteral {
PROTOTYPE // Property is __proto__. PROTOTYPE // Property is __proto__.
}; };
Property(Literal* key, Expression* value); Property(Literal* key, Expression* value, Isolate* isolate);
Literal* key() { return key_; } Literal* key() { return key_; }
Expression* value() { return value_; } Expression* value() { return value_; }
......
...@@ -3991,7 +3991,7 @@ Expression* Parser::ParseObjectLiteral(bool* ok) { ...@@ -3991,7 +3991,7 @@ Expression* Parser::ParseObjectLiteral(bool* ok) {
Expression* value = ParseAssignmentExpression(true, CHECK_OK); Expression* value = ParseAssignmentExpression(true, CHECK_OK);
ObjectLiteral::Property* property = 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 // Mark top-level object literals that contain function literals and
// pretenure the literal so it can be added as a constant function // pretenure the literal so it can be added as a constant function
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment