// Copyright 2012 the V8 project authors. All rights reserved.
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following
-// disclaimer in the documentation and/or other materials provided
-// with the distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived
-// from this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
#include "v8.h"
arguments_length_(NULL),
info_(stub, isolate),
context_(NULL) {
- descriptor_ = stub->GetInterfaceDescriptor(isolate);
+ descriptor_ = stub->GetInterfaceDescriptor();
parameters_.Reset(new HParameter*[descriptor_->register_param_count_]);
}
virtual bool BuildGraph();
};
-Handle<Code> HydrogenCodeStub::GenerateLightweightMissCode(Isolate* isolate) {
- Factory* factory = isolate->factory();
+Handle<Code> HydrogenCodeStub::GenerateLightweightMissCode() {
+ Factory* factory = isolate()->factory();
// Generate the new code.
- MacroAssembler masm(isolate, NULL, 256);
+ MacroAssembler masm(isolate(), NULL, 256);
{
// Update the static counter each time a new code stub is generated.
- isolate->counters()->code_stubs()->Increment();
+ isolate()->counters()->code_stubs()->Increment();
// Generate the code for the stub.
masm.set_generating_stub(true);
template <class Stub>
-static Handle<Code> DoGenerateCode(Isolate* isolate, Stub* stub) {
+static Handle<Code> DoGenerateCode(Stub* stub) {
+ Isolate* isolate = stub->isolate();
CodeStub::Major major_key =
static_cast<HydrogenCodeStub*>(stub)->MajorKey();
CodeStubInterfaceDescriptor* descriptor =
isolate->code_stub_interface_descriptor(major_key);
if (descriptor->register_param_count_ < 0) {
- stub->InitializeInterfaceDescriptor(isolate, descriptor);
+ stub->InitializeInterfaceDescriptor(descriptor);
}
// If we are uninitialized we can use a light-weight stub to enter
// stub-failure deopt mechanism.
if (stub->IsUninitialized() && descriptor->has_miss_handler()) {
ASSERT(!descriptor->stack_parameter_count_.is_valid());
- return stub->GenerateLightweightMissCode(isolate);
+ return stub->GenerateLightweightMissCode();
}
ElapsedTimer timer;
if (FLAG_profile_hydrogen_code_stub_compilation) {
}
-Handle<Code> ToNumberStub::GenerateCode(Isolate* isolate) {
- return DoGenerateCode(isolate, this);
+Handle<Code> ToNumberStub::GenerateCode() {
+ return DoGenerateCode(this);
}
}
-Handle<Code> NumberToStringStub::GenerateCode(Isolate* isolate) {
- return DoGenerateCode(isolate, this);
+Handle<Code> NumberToStringStub::GenerateCode() {
+ return DoGenerateCode(this);
}
}
-Handle<Code> FastCloneShallowArrayStub::GenerateCode(Isolate* isolate) {
- return DoGenerateCode(isolate, this);
+Handle<Code> FastCloneShallowArrayStub::GenerateCode() {
+ return DoGenerateCode(this);
}
}
-Handle<Code> FastCloneShallowObjectStub::GenerateCode(Isolate* isolate) {
- return DoGenerateCode(isolate, this);
+Handle<Code> FastCloneShallowObjectStub::GenerateCode() {
+ return DoGenerateCode(this);
}
}
-Handle<Code> CreateAllocationSiteStub::GenerateCode(Isolate* isolate) {
- return DoGenerateCode(isolate, this);
+Handle<Code> CreateAllocationSiteStub::GenerateCode() {
+ return DoGenerateCode(this);
}
}
-Handle<Code> KeyedLoadFastElementStub::GenerateCode(Isolate* isolate) {
- return DoGenerateCode(isolate, this);
+Handle<Code> KeyedLoadFastElementStub::GenerateCode() {
+ return DoGenerateCode(this);
}
}
-Handle<Code> LoadFieldStub::GenerateCode(Isolate* isolate) {
- return DoGenerateCode(isolate, this);
+Handle<Code> LoadFieldStub::GenerateCode() {
+ return DoGenerateCode(this);
}
}
-Handle<Code> StringLengthStub::GenerateCode(Isolate* isolate) {
- return DoGenerateCode(isolate, this);
+Handle<Code> StringLengthStub::GenerateCode() {
+ return DoGenerateCode(this);
}
}
-Handle<Code> KeyedStoreFastElementStub::GenerateCode(Isolate* isolate) {
- return DoGenerateCode(isolate, this);
+Handle<Code> KeyedStoreFastElementStub::GenerateCode() {
+ return DoGenerateCode(this);
}
}
-Handle<Code> TransitionElementsKindStub::GenerateCode(Isolate* isolate) {
- return DoGenerateCode(isolate, this);
+Handle<Code> TransitionElementsKindStub::GenerateCode() {
+ return DoGenerateCode(this);
}
HValue* CodeStubGraphBuilderBase::BuildArrayConstructor(
}
-Handle<Code> ArrayNoArgumentConstructorStub::GenerateCode(Isolate* isolate) {
- return DoGenerateCode(isolate, this);
+Handle<Code> ArrayNoArgumentConstructorStub::GenerateCode() {
+ return DoGenerateCode(this);
}
}
-Handle<Code> ArraySingleArgumentConstructorStub::GenerateCode(
- Isolate* isolate) {
- return DoGenerateCode(isolate, this);
+Handle<Code> ArraySingleArgumentConstructorStub::GenerateCode() {
+ return DoGenerateCode(this);
}
}
-Handle<Code> ArrayNArgumentsConstructorStub::GenerateCode(Isolate* isolate) {
- return DoGenerateCode(isolate, this);
+Handle<Code> ArrayNArgumentsConstructorStub::GenerateCode() {
+ return DoGenerateCode(this);
}
}
-Handle<Code> InternalArrayNoArgumentConstructorStub::GenerateCode(
- Isolate* isolate) {
- return DoGenerateCode(isolate, this);
+Handle<Code> InternalArrayNoArgumentConstructorStub::GenerateCode() {
+ return DoGenerateCode(this);
}
}
-Handle<Code> InternalArraySingleArgumentConstructorStub::GenerateCode(
- Isolate* isolate) {
- return DoGenerateCode(isolate, this);
+Handle<Code> InternalArraySingleArgumentConstructorStub::GenerateCode() {
+ return DoGenerateCode(this);
}
}
-Handle<Code> InternalArrayNArgumentsConstructorStub::GenerateCode(
- Isolate* isolate) {
- return DoGenerateCode(isolate, this);
+Handle<Code> InternalArrayNArgumentsConstructorStub::GenerateCode() {
+ return DoGenerateCode(this);
}
}
-Handle<Code> CompareNilICStub::GenerateCode(Isolate* isolate) {
- return DoGenerateCode(isolate, this);
+Handle<Code> CompareNilICStub::GenerateCode() {
+ return DoGenerateCode(this);
}
}
-Handle<Code> BinaryOpICStub::GenerateCode(Isolate* isolate) {
- return DoGenerateCode(isolate, this);
+Handle<Code> BinaryOpICStub::GenerateCode() {
+ return DoGenerateCode(this);
}
}
-Handle<Code> BinaryOpWithAllocationSiteStub::GenerateCode(Isolate* isolate) {
- return DoGenerateCode(isolate, this);
+Handle<Code> BinaryOpWithAllocationSiteStub::GenerateCode() {
+ return DoGenerateCode(this);
}
}
-Handle<Code> StringAddStub::GenerateCode(Isolate* isolate) {
- return DoGenerateCode(isolate, this);
+Handle<Code> StringAddStub::GenerateCode() {
+ return DoGenerateCode(this);
}
}
-Handle<Code> ToBooleanStub::GenerateCode(Isolate* isolate) {
- return DoGenerateCode(isolate, this);
+Handle<Code> ToBooleanStub::GenerateCode() {
+ return DoGenerateCode(this);
}
Handle<Map> placeholder_map = isolate()->factory()->meta_map();
HValue* global = Add<HConstant>(
StoreGlobalStub::global_placeholder(isolate()));
- Add<HCheckMaps>(global, placeholder_map, top_info());
+ Add<HCheckMaps>(global, placeholder_map);
}
HValue* cell = Add<HConstant>(placeholder_cell);
}
-Handle<Code> StoreGlobalStub::GenerateCode(Isolate* isolate) {
- return DoGenerateCode(isolate, this);
+Handle<Code> StoreGlobalStub::GenerateCode() {
+ return DoGenerateCode(this);
}
}
-Handle<Code> ElementsTransitionAndStoreStub::GenerateCode(Isolate* isolate) {
- return DoGenerateCode(isolate, this);
+Handle<Code> ElementsTransitionAndStoreStub::GenerateCode() {
+ return DoGenerateCode(this);
}
}
-Handle<Code> FastNewClosureStub::GenerateCode(Isolate* isolate) {
- return DoGenerateCode(isolate, this);
+Handle<Code> FastNewClosureStub::GenerateCode() {
+ return DoGenerateCode(this);
}
}
-Handle<Code> FastNewContextStub::GenerateCode(Isolate* isolate) {
- return DoGenerateCode(isolate, this);
+Handle<Code> FastNewContextStub::GenerateCode() {
+ return DoGenerateCode(this);
}
}
-Handle<Code> KeyedLoadDictionaryElementStub::GenerateCode(Isolate* isolate) {
- return DoGenerateCode(isolate, this);
+Handle<Code> KeyedLoadDictionaryElementStub::GenerateCode() {
+ return DoGenerateCode(this);
}
}
-Handle<Code> RegExpConstructResultStub::GenerateCode(Isolate* isolate) {
- return DoGenerateCode(isolate, this);
+Handle<Code> RegExpConstructResultStub::GenerateCode() {
+ return DoGenerateCode(this);
}