Handle non-object constants in HConstant::GetMonomorphicJSObjectMap.

R=ulan@chromium.org
BUG=chromium:412162
LOG=N

Review URL: https://codereview.chromium.org/552243002

git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@23803 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
This commit is contained in:
jarin@chromium.org 2014-09-09 12:58:34 +00:00
parent 3dbb3c39d5
commit 01d63e43b2
2 changed files with 15 additions and 1 deletions

View File

@ -3493,7 +3493,7 @@ class HConstant FINAL : public HTemplateInstruction<0> {
virtual Handle<Map> GetMonomorphicJSObjectMap() OVERRIDE {
Handle<Object> object = object_.handle();
if (object->IsHeapObject()) {
if (!object.is_null() && object->IsHeapObject()) {
return v8::internal::handle(HeapObject::cast(*object)->map());
}
return Handle<Map>();

View File

@ -0,0 +1,14 @@
// Copyright 2014 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Flags: --allow-natives-syntax
function test() {
Math.abs(-NaN).toString();
}
test();
test();
%OptimizeFunctionOnNextCall(test);
test();