Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(17)

Unified Diff: src/code-stubs.cc

Issue 22184004: Desugar bitwise negation into XOR and kill all UnaryOp stuff. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Rebased. Feedback. Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/code-stubs.cc
diff --git a/src/code-stubs.cc b/src/code-stubs.cc
index 4def2b572f940f9861ffc7a402ab649af849b5b5..d472fa287f0c03c0a40180267b6da29828c16325 100644
--- a/src/code-stubs.cc
+++ b/src/code-stubs.cc
@@ -204,65 +204,6 @@ void CodeStub::PrintName(StringStream* stream) {
}
-Builtins::JavaScript UnaryOpStub::ToJSBuiltin() {
- switch (operation_) {
- default:
- UNREACHABLE();
- case Token::BIT_NOT:
- return Builtins::BIT_NOT;
- }
-}
-
-
-Handle<JSFunction> UnaryOpStub::ToJSFunction(Isolate* isolate) {
- Handle<JSBuiltinsObject> builtins(isolate->js_builtins_object());
- Object* builtin = builtins->javascript_builtin(ToJSBuiltin());
- return Handle<JSFunction>(JSFunction::cast(builtin), isolate);
-}
-
-
-MaybeObject* UnaryOpStub::Result(Handle<Object> object, Isolate* isolate) {
- Handle<JSFunction> builtin_function = ToJSFunction(isolate);
- bool caught_exception;
- Handle<Object> result = Execution::Call(builtin_function, object,
- 0, NULL, &caught_exception);
- if (caught_exception) {
- return Failure::Exception();
- }
- return *result;
-}
-
-
-void UnaryOpStub::UpdateStatus(Handle<Object> object) {
- State old_state(state_);
- if (object->IsSmi()) {
- state_.Add(SMI);
- } else if (object->IsHeapNumber()) {
- state_.Add(HEAP_NUMBER);
- } else {
- state_.Add(GENERIC);
- }
- TraceTransition(old_state, state_);
-}
-
-
-Handle<Type> UnaryOpStub::GetType(Isolate* isolate) {
- if (state_.Contains(GENERIC)) {
- return handle(Type::Any(), isolate);
- }
- Handle<Type> type = handle(Type::None(), isolate);
- if (state_.Contains(SMI)) {
- type = handle(
- Type::Union(type, handle(Type::Smi(), isolate)), isolate);
- }
- if (state_.Contains(HEAP_NUMBER)) {
- type = handle(
- Type::Union(type, handle(Type::Double(), isolate)), isolate);
- }
- return type;
-}
-
-
void BinaryOpStub::Generate(MacroAssembler* masm) {
// Explicitly allow generation of nested stubs. It is safe here because
// generation code does not use any raw pointers.
@@ -348,28 +289,6 @@ void BinaryOpStub::GenerateCallRuntime(MacroAssembler* masm) {
#undef __
-void UnaryOpStub::PrintBaseName(StringStream* stream) {
- CodeStub::PrintBaseName(stream);
- if (operation_ == Token::BIT_NOT) stream->Add("Not");
-}
-
-
-void UnaryOpStub::PrintState(StringStream* stream) {
- state_.Print(stream);
-}
-
-
-void UnaryOpStub::State::Print(StringStream* stream) const {
- stream->Add("(");
- SimpleListPrinter printer(stream);
- if (IsEmpty()) printer.Add("None");
- if (Contains(GENERIC)) printer.Add("Generic");
- if (Contains(HEAP_NUMBER)) printer.Add("HeapNumber");
- if (Contains(SMI)) printer.Add("Smi");
- stream->Add(")");
-}
-
-
void BinaryOpStub::PrintName(StringStream* stream) {
const char* op_name = Token::Name(op_);
const char* overwrite_name;
« no previous file with comments | « src/code-stubs.h ('k') | src/code-stubs-hydrogen.cc » ('j') | src/x64/lithium-codegen-x64.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698