| Index: src/hydrogen.cc
|
| diff --git a/src/hydrogen.cc b/src/hydrogen.cc
|
| index 3f9d32de1c5ee3153026bb218fdf48f1e40e5a8a..d058ae0a59ecc473a97a28a47e0a297aa2596c09 100644
|
| --- a/src/hydrogen.cc
|
| +++ b/src/hydrogen.cc
|
| @@ -9,6 +9,7 @@
|
| #include "src/v8.h"
|
|
|
| #include "src/allocation-site-scopes.h"
|
| +#include "src/ast-numbering.h"
|
| #include "src/full-codegen.h"
|
| #include "src/hydrogen-bce.h"
|
| #include "src/hydrogen-bch.h"
|
| @@ -3508,9 +3509,7 @@ int HGraph::TraceInlinedFunction(
|
| os << "--- FUNCTION SOURCE (" << shared->DebugName()->ToCString().get()
|
| << ") id{" << info()->optimization_id() << "," << id << "} ---\n";
|
| {
|
| - ConsStringIteratorOp op;
|
| StringCharacterStream stream(String::cast(script->source()),
|
| - &op,
|
| shared->start_position());
|
| // fun->end_position() points to the last character in the stream. We
|
| // need to compensate by adding one to calculate the length.
|
| @@ -5620,6 +5619,8 @@ void HOptimizedGraphBuilder::VisitObjectLiteral(ObjectLiteral* expr) {
|
| DCHECK(!CompileTimeValue::IsCompileTimeValue(value));
|
| // Fall through.
|
| case ObjectLiteral::Property::COMPUTED:
|
| + // It is safe to use [[Put]] here because the boilerplate already
|
| + // contains computed properties with an uninitialized value.
|
| if (key->value()->IsInternalizedString()) {
|
| if (property->emit_store()) {
|
| CHECK_ALIVE(VisitForValue(value));
|
| @@ -7033,6 +7034,7 @@ HValue* HOptimizedGraphBuilder::HandlePolymorphicElementAccess(
|
| MapHandleList possible_transitioned_maps(maps->length());
|
| for (int i = 0; i < maps->length(); ++i) {
|
| Handle<Map> map = maps->at(i);
|
| + DCHECK(!map->IsStringMap());
|
| ElementsKind elements_kind = map->elements_kind();
|
| if (IsFastElementsKind(elements_kind) &&
|
| elements_kind != GetInitialFastElementsKind()) {
|
| @@ -7196,6 +7198,19 @@ HValue* HOptimizedGraphBuilder::HandleKeyedElementAccess(
|
| break;
|
| }
|
| }
|
| + } else if (access_type == LOAD && !monomorphic &&
|
| + (types != NULL && !types->is_empty())) {
|
| + // Polymorphic loads have to go generic if any of the maps are strings.
|
| + // If some, but not all of the maps are strings, we should go generic
|
| + // because polymorphic access wants to key on ElementsKind and isn't
|
| + // compatible with strings.
|
| + for (int i = 0; i < types->length(); i++) {
|
| + Handle<Map> current_map = types->at(i);
|
| + if (current_map->IsStringMap()) {
|
| + force_generic = true;
|
| + break;
|
| + }
|
| + }
|
| }
|
|
|
| if (monomorphic) {
|
| @@ -7830,7 +7845,7 @@ bool HOptimizedGraphBuilder::TryInline(Handle<JSFunction> target,
|
| // step, but don't transfer ownership to target_info.
|
| target_info.SetAstValueFactory(top_info()->ast_value_factory(), false);
|
| Handle<SharedFunctionInfo> target_shared(target->shared());
|
| - if (!Parser::Parse(&target_info) || !Scope::Analyze(&target_info)) {
|
| + if (!Compiler::ParseAndAnalyze(&target_info)) {
|
| if (target_info.isolate()->has_pending_exception()) {
|
| // Parse or scope error, never optimize this function.
|
| SetStackOverflow();
|
| @@ -12578,15 +12593,14 @@ void HStatistics::Initialize(CompilationInfo* info) {
|
| }
|
|
|
|
|
| -void HStatistics::Print(const char* stats_name) {
|
| +void HStatistics::Print() {
|
| PrintF(
|
| "\n"
|
| "----------------------------------------"
|
| "----------------------------------------\n"
|
| - "--- %s timing results:\n"
|
| + "--- Hydrogen timing results:\n"
|
| "----------------------------------------"
|
| - "----------------------------------------\n",
|
| - stats_name);
|
| + "----------------------------------------\n");
|
| base::TimeDelta sum;
|
| for (int i = 0; i < times_.length(); ++i) {
|
| sum += times_[i];
|
|
|