| OLD | NEW |
| 1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "src/hydrogen.h" | 5 #include "src/hydrogen.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "src/v8.h" | 9 #include "src/v8.h" |
| 10 #include "src/allocation-site-scopes.h" | 10 #include "src/allocation-site-scopes.h" |
| (...skipping 6540 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6551 HCheckMaps* checked_object = Add<HCheckMaps>(object, map, dependency); | 6551 HCheckMaps* checked_object = Add<HCheckMaps>(object, map, dependency); |
| 6552 if (dependency) { | 6552 if (dependency) { |
| 6553 checked_object->ClearDependsOnFlag(kElementsKind); | 6553 checked_object->ClearDependsOnFlag(kElementsKind); |
| 6554 } | 6554 } |
| 6555 | 6555 |
| 6556 if (access_type == STORE && map->prototype()->IsJSObject()) { | 6556 if (access_type == STORE && map->prototype()->IsJSObject()) { |
| 6557 // monomorphic stores need a prototype chain check because shape | 6557 // monomorphic stores need a prototype chain check because shape |
| 6558 // changes could allow callbacks on elements in the chain that | 6558 // changes could allow callbacks on elements in the chain that |
| 6559 // aren't compatible with monomorphic keyed stores. | 6559 // aren't compatible with monomorphic keyed stores. |
| 6560 Handle<JSObject> prototype(JSObject::cast(map->prototype())); | 6560 Handle<JSObject> prototype(JSObject::cast(map->prototype())); |
| 6561 Object* holder = map->prototype(); | 6561 JSObject* holder = JSObject::cast(map->prototype()); |
| 6562 while (holder->GetPrototype(isolate())->IsJSObject()) { | 6562 while (!holder->GetPrototype()->IsNull()) { |
| 6563 holder = holder->GetPrototype(isolate()); | 6563 holder = JSObject::cast(holder->GetPrototype()); |
| 6564 } | 6564 } |
| 6565 ASSERT(holder->GetPrototype(isolate())->IsNull()); | |
| 6566 | 6565 |
| 6567 BuildCheckPrototypeMaps(prototype, | 6566 BuildCheckPrototypeMaps(prototype, |
| 6568 Handle<JSObject>(JSObject::cast(holder))); | 6567 Handle<JSObject>(JSObject::cast(holder))); |
| 6569 } | 6568 } |
| 6570 | 6569 |
| 6571 LoadKeyedHoleMode load_mode = BuildKeyedHoleMode(map); | 6570 LoadKeyedHoleMode load_mode = BuildKeyedHoleMode(map); |
| 6572 return BuildUncheckedMonomorphicElementAccess( | 6571 return BuildUncheckedMonomorphicElementAccess( |
| 6573 checked_object, key, val, | 6572 checked_object, key, val, |
| 6574 map->instance_type() == JS_ARRAY_TYPE, | 6573 map->instance_type() == JS_ARRAY_TYPE, |
| 6575 map->elements_kind(), access_type, | 6574 map->elements_kind(), access_type, |
| (...skipping 5564 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 12140 if (ShouldProduceTraceOutput()) { | 12139 if (ShouldProduceTraceOutput()) { |
| 12141 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); | 12140 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); |
| 12142 } | 12141 } |
| 12143 | 12142 |
| 12144 #ifdef DEBUG | 12143 #ifdef DEBUG |
| 12145 graph_->Verify(false); // No full verify. | 12144 graph_->Verify(false); // No full verify. |
| 12146 #endif | 12145 #endif |
| 12147 } | 12146 } |
| 12148 | 12147 |
| 12149 } } // namespace v8::internal | 12148 } } // namespace v8::internal |
| OLD | NEW |