aboutsummaryrefslogtreecommitdiff
path: root/deps/v8/src/code-stubs.cc
diff options
context:
space:
mode:
authorBen Noordhuis <info@bnoordhuis.nl>2014-11-14 00:52:27 +0100
committerBen Noordhuis <info@bnoordhuis.nl>2014-11-14 16:34:58 +0100
commit5d1b6d3e0fa4b97a490ef964be48aed9872e3ec1 (patch)
treeab5f510c4d83b175681de629395525bf7ec7cedb /deps/v8/src/code-stubs.cc
parent3b3d89bad26f5dfebe73fef6ae284ee78acbd5c9 (diff)
downloadandroid-node-v8-5d1b6d3e0fa4b97a490ef964be48aed9872e3ec1.tar.gz
android-node-v8-5d1b6d3e0fa4b97a490ef964be48aed9872e3ec1.tar.bz2
android-node-v8-5d1b6d3e0fa4b97a490ef964be48aed9872e3ec1.zip
deps: upgrade v8 to 3.30.37
Diffstat (limited to 'deps/v8/src/code-stubs.cc')
-rw-r--r--deps/v8/src/code-stubs.cc92
1 files changed, 52 insertions, 40 deletions
diff --git a/deps/v8/src/code-stubs.cc b/deps/v8/src/code-stubs.cc
index 5c9e1a2b86..7442f3e134 100644
--- a/deps/v8/src/code-stubs.cc
+++ b/deps/v8/src/code-stubs.cc
@@ -2,10 +2,11 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "src/v8.h"
+#include "src/code-stubs.h"
+
+#include <sstream>
#include "src/bootstrapper.h"
-#include "src/code-stubs.h"
#include "src/cpu-profiler.h"
#include "src/factory.h"
#include "src/gdb-jit.h"
@@ -75,9 +76,10 @@ bool CodeStub::FindCodeInCache(Code** code_out) {
void CodeStub::RecordCodeGeneration(Handle<Code> code) {
IC::RegisterWeakMapDependency(code);
- OStringStream os;
+ std::ostringstream os;
os << *this;
- PROFILE(isolate(), CodeCreateEvent(Logger::STUB_TAG, *code, os.c_str()));
+ PROFILE(isolate(),
+ CodeCreateEvent(Logger::STUB_TAG, *code, os.str().c_str()));
Counters* counters = isolate()->counters();
counters->total_stubs_code_size()->Increment(code->instruction_size());
}
@@ -103,15 +105,14 @@ Handle<Code> PlatformCodeStub::GenerateCode() {
// Generate the new code.
MacroAssembler masm(isolate(), NULL, 256);
- // TODO(yangguo) remove this once the code serializer handles code stubs.
- if (FLAG_serialize_toplevel) masm.enable_serializer();
-
{
// Update the static counter each time a new code stub is generated.
isolate()->counters()->code_stubs()->Increment();
// Generate the code for the stub.
masm.set_generating_stub(true);
+ // TODO(yangguo): remove this once we can serialize IC stubs.
+ masm.enable_serializer();
NoCurrentFrameScope scope(&masm);
Generate(&masm);
}
@@ -153,9 +154,9 @@ Handle<Code> CodeStub::GetCode() {
if (FLAG_print_code_stubs) {
CodeTracer::Scope trace_scope(isolate()->GetCodeTracer());
OFStream os(trace_scope.file());
- OStringStream name;
+ std::ostringstream name;
name << *this;
- new_object->Disassemble(name.c_str(), os);
+ new_object->Disassemble(name.str().c_str(), os);
os << "\n";
}
#endif
@@ -198,12 +199,12 @@ const char* CodeStub::MajorName(CodeStub::Major major_key,
}
-void CodeStub::PrintBaseName(OStream& os) const { // NOLINT
+void CodeStub::PrintBaseName(std::ostream& os) const { // NOLINT
os << MajorName(MajorKey(), false);
}
-void CodeStub::PrintName(OStream& os) const { // NOLINT
+void CodeStub::PrintName(std::ostream& os) const { // NOLINT
PrintBaseName(os);
PrintState(os);
}
@@ -222,9 +223,8 @@ void CodeStub::Dispatch(Isolate* isolate, uint32_t key, void** value_out,
CODE_STUB_LIST(DEF_CASE)
#undef DEF_CASE
case NUMBER_OF_IDS:
- UNREACHABLE();
case NoCache:
- *value_out = NULL;
+ UNREACHABLE();
break;
}
}
@@ -279,7 +279,7 @@ void BinaryOpICStub::GenerateAheadOfTime(Isolate* isolate) {
}
-void BinaryOpICStub::PrintState(OStream& os) const { // NOLINT
+void BinaryOpICStub::PrintState(std::ostream& os) const { // NOLINT
os << state();
}
@@ -300,7 +300,7 @@ void BinaryOpICWithAllocationSiteStub::GenerateAheadOfTime(Isolate* isolate) {
void BinaryOpICWithAllocationSiteStub::PrintState(
- OStream& os) const { // NOLINT
+ std::ostream& os) const { // NOLINT
os << state();
}
@@ -315,7 +315,7 @@ void BinaryOpICWithAllocationSiteStub::GenerateAheadOfTime(
}
-void StringAddStub::PrintBaseName(OStream& os) const { // NOLINT
+void StringAddStub::PrintBaseName(std::ostream& os) const { // NOLINT
os << "StringAddStub";
if ((flags() & STRING_ADD_CHECK_BOTH) == STRING_ADD_CHECK_BOTH) {
os << "_CheckBoth";
@@ -463,17 +463,17 @@ void HydrogenCodeStub::TraceTransition(StateType from, StateType to) {
OFStream os(stdout);
os << "[";
PrintBaseName(os);
- os << ": " << from << "=>" << to << "]" << endl;
+ os << ": " << from << "=>" << to << "]" << std::endl;
}
-void CompareNilICStub::PrintBaseName(OStream& os) const { // NOLINT
+void CompareNilICStub::PrintBaseName(std::ostream& os) const { // NOLINT
CodeStub::PrintBaseName(os);
os << ((nil_value() == kNullValue) ? "(NullValue)" : "(UndefinedValue)");
}
-void CompareNilICStub::PrintState(OStream& os) const { // NOLINT
+void CompareNilICStub::PrintState(std::ostream& os) const { // NOLINT
os << state();
}
@@ -481,7 +481,7 @@ void CompareNilICStub::PrintState(OStream& os) const { // NOLINT
// TODO(svenpanne) Make this a real infix_ostream_iterator.
class SimpleListPrinter {
public:
- explicit SimpleListPrinter(OStream& os) : os_(os), first_(true) {}
+ explicit SimpleListPrinter(std::ostream& os) : os_(os), first_(true) {}
void Add(const char* s) {
if (first_) {
@@ -493,12 +493,12 @@ class SimpleListPrinter {
}
private:
- OStream& os_;
+ std::ostream& os_;
bool first_;
};
-OStream& operator<<(OStream& os, const CompareNilICStub::State& s) {
+std::ostream& operator<<(std::ostream& os, const CompareNilICStub::State& s) {
os << "(";
SimpleListPrinter p(os);
if (s.IsEmpty()) p.Add("None");
@@ -539,17 +539,17 @@ Type* CompareNilICStub::GetInputType(Zone* zone, Handle<Map> map) {
}
-void CallIC_ArrayStub::PrintState(OStream& os) const { // NOLINT
+void CallIC_ArrayStub::PrintState(std::ostream& os) const { // NOLINT
os << state() << " (Array)";
}
-void CallICStub::PrintState(OStream& os) const { // NOLINT
+void CallICStub::PrintState(std::ostream& os) const { // NOLINT
os << state();
}
-void InstanceofStub::PrintName(OStream& os) const { // NOLINT
+void InstanceofStub::PrintName(std::ostream& os) const { // NOLINT
os << "InstanceofStub";
if (HasArgsInRegisters()) os << "_REGS";
if (HasCallSiteInlineCheck()) os << "_INLINE";
@@ -594,6 +594,9 @@ void HandlerStub::InitializeDescriptor(CodeStubDescriptor* descriptor) {
CallInterfaceDescriptor HandlerStub::GetCallInterfaceDescriptor() {
if (kind() == Code::LOAD_IC || kind() == Code::KEYED_LOAD_IC) {
+ if (FLAG_vector_ics) {
+ return VectorLoadICDescriptor(isolate());
+ }
return LoadDescriptor(isolate());
} else {
DCHECK_EQ(Code::STORE_IC, kind());
@@ -614,6 +617,11 @@ void ElementsTransitionAndStoreStub::InitializeDescriptor(
}
+CallInterfaceDescriptor StoreTransitionStub::GetCallInterfaceDescriptor() {
+ return StoreTransitionDescriptor(isolate());
+}
+
+
static void InitializeVectorLoadStub(Isolate* isolate,
CodeStubDescriptor* descriptor,
Address deoptimization_handler) {
@@ -624,14 +632,13 @@ static void InitializeVectorLoadStub(Isolate* isolate,
void VectorLoadStub::InitializeDescriptor(CodeStubDescriptor* descriptor) {
InitializeVectorLoadStub(isolate(), descriptor,
- FUNCTION_ADDR(VectorLoadIC_MissFromStubFailure));
+ FUNCTION_ADDR(LoadIC_MissFromStubFailure));
}
void VectorKeyedLoadStub::InitializeDescriptor(CodeStubDescriptor* descriptor) {
- InitializeVectorLoadStub(
- isolate(), descriptor,
- FUNCTION_ADDR(VectorKeyedLoadIC_MissFromStubFailure));
+ InitializeVectorLoadStub(isolate(), descriptor,
+ FUNCTION_ADDR(KeyedLoadIC_MissFromStubFailure));
}
@@ -647,9 +654,6 @@ void FastNewClosureStub::InitializeDescriptor(CodeStubDescriptor* descriptor) {
void FastNewContextStub::InitializeDescriptor(CodeStubDescriptor* d) {}
-void ToNumberStub::InitializeDescriptor(CodeStubDescriptor* d) {}
-
-
void NumberToStringStub::InitializeDescriptor(CodeStubDescriptor* descriptor) {
NumberToStringDescriptor call_descriptor(isolate());
descriptor->Initialize(
@@ -690,6 +694,13 @@ void TransitionElementsKindStub::InitializeDescriptor(
}
+void AllocateHeapNumberStub::InitializeDescriptor(
+ CodeStubDescriptor* descriptor) {
+ descriptor->Initialize(
+ Runtime::FunctionForId(Runtime::kAllocateHeapNumber)->entry);
+}
+
+
void CompareNilICStub::InitializeDescriptor(CodeStubDescriptor* descriptor) {
descriptor->Initialize(FUNCTION_ADDR(CompareNilIC_Miss));
descriptor->SetMissHandler(
@@ -772,7 +783,7 @@ void ArgumentsAccessStub::Generate(MacroAssembler* masm) {
}
-void ArgumentsAccessStub::PrintName(OStream& os) const { // NOLINT
+void ArgumentsAccessStub::PrintName(std::ostream& os) const { // NOLINT
os << "ArgumentsAccessStub_";
switch (type()) {
case READ_ELEMENT:
@@ -792,18 +803,18 @@ void ArgumentsAccessStub::PrintName(OStream& os) const { // NOLINT
}
-void CallFunctionStub::PrintName(OStream& os) const { // NOLINT
+void CallFunctionStub::PrintName(std::ostream& os) const { // NOLINT
os << "CallFunctionStub_Args" << argc();
}
-void CallConstructStub::PrintName(OStream& os) const { // NOLINT
+void CallConstructStub::PrintName(std::ostream& os) const { // NOLINT
os << "CallConstructStub";
if (RecordCallTarget()) os << "_Recording";
}
-void ArrayConstructorStub::PrintName(OStream& os) const { // NOLINT
+void ArrayConstructorStub::PrintName(std::ostream& os) const { // NOLINT
os << "ArrayConstructorStub";
switch (argument_count()) {
case ANY:
@@ -823,8 +834,9 @@ void ArrayConstructorStub::PrintName(OStream& os) const { // NOLINT
}
-OStream& ArrayConstructorStubBase::BasePrintName(OStream& os, // NOLINT
- const char* name) const {
+std::ostream& ArrayConstructorStubBase::BasePrintName(
+ std::ostream& os, // NOLINT
+ const char* name) const {
os << name << "_" << ElementsKindToString(elements_kind());
if (override_mode() == DISABLE_ALLOCATION_SITES) {
os << "_DISABLE_ALLOCATION_SITES";
@@ -843,12 +855,12 @@ bool ToBooleanStub::UpdateStatus(Handle<Object> object) {
}
-void ToBooleanStub::PrintState(OStream& os) const { // NOLINT
+void ToBooleanStub::PrintState(std::ostream& os) const { // NOLINT
os << types();
}
-OStream& operator<<(OStream& os, const ToBooleanStub::Types& s) {
+std::ostream& operator<<(std::ostream& os, const ToBooleanStub::Types& s) {
os << "(";
SimpleListPrinter p(os);
if (s.IsEmpty()) p.Add("None");